evennia.contrib.rpg.rpsystem.rpsystem¶
Roleplaying base system for Evennia
Contribution - Griatch, 2015
This module contains the ContribRPObject, ContribRPRoom and ContribRPCharacter typeclasses. If you inherit your objects/rooms/character from these (or make them the defaults) from these you will get the following features:
Objects/Rooms will get the ability to have poses and will report the poses of items inside them (the latter most useful for Rooms).
Characters will get poses and also sdescs (short descriptions)
that will be used instead of their keys. They will gain commands for managing recognition (custom sdesc-replacement), masking themselves as well as an advanced free-form emote command.
In more detail, This RP base system introduces the following features to a game, common to many RP-centric games:
- emote system using director stance emoting (names/sdescs).
This uses a customizable replacement noun (/me, @ etc) to represent you in the emote. You can use /sdesc, /nick, /key or /alias to reference objects in the room. You can use any number of sdesc sub-parts to differentiate a local sdesc, or use /1-sdesc etc to differentiate them. The emote also identifies nested says and separates case.
- sdesc obscuration of real character names for use in emotes
and in any referencing such as object.search(). This relies on an SdescHandler sdesc being set on the Character and makes use of a custom Character.get_display_name hook. If sdesc is not set, the character’s key is used instead. This is particularly used in the emoting system.
- recog system to assign your own nicknames to characters, can then
be used for referencing. The user may recog a user and assign any personal nick to them. This will be shown in descriptions and used to reference them. This is making use of the nick functionality of Evennia.
masks to hide your identity (using a simple lock).
- pose system to set room-persistent poses, visible in room
descriptions and when looking at the person/object. This is a simple Attribute that modifies how the characters is viewed when in a room as sdesc + pose.
- in-emote says, including seamless integration with language
obscuration routine (such as contrib/rpg/rplanguage.py)
Installation:
Add RPSystemCmdSet from this module to your CharacterCmdSet:
# mygame/commands/default_cmdsets.py
# ...
from evennia.contrib.rpg.rpsystem.rpsystem import RPSystemCmdSet <---
class CharacterCmdSet(default_cmds.CharacterCmdset):
# ...
def at_cmdset_creation(self):
# ...
self.add(RPSystemCmdSet()) # <---
You also need to make your Characters/Objects/Rooms inherit from the typeclasses in this module:
# in mygame/typeclasses/characters.py
from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPCharacter
class Character(ContribRPCharacter):
# ...
# in mygame/typeclasses/objects.py
from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPObject
class Object(ContribRPObject):
# ...
# in mygame/typeclasses/rooms.py
from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPRoom
class Room(ContribRPRoom):
# ...
Examples:
> look Tavern The tavern is full of nice people
A tall man is standing by the bar.
Above is an example of a player with an sdesc “a tall man”. It is also an example of a static pose: The “standing by the bar” has been set by the player of the tall man, so that people looking at him can tell at a glance what is going on.
> emote /me looks at /Tall and says “Hello!”
- I see:
Griatch looks at Tall man and says “Hello”.
- Tall man (assuming his name is Tom) sees:
The godlike figure looks at Tom and says “Hello”.
Note that by default, the case of the tag matters, so /tall will lead to ‘tall man’ while /Tall will become ‘Tall man’ and /TALL becomes /TALL MAN. If you don’t want this behavior, you can pass case_sensitive=False to the send_emote function.
Extra Installation Instructions:
In typeclasses/character.py: Import the ContribRPCharacter class:
from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPCharacter
- Inherit ContribRPCharacter:
Change “class Character(DefaultCharacter):” to class Character(ContribRPCharacter):
- If you have any overriden calls in at_object_creation(self):
Add super().at_object_creation() as the top line.
- In typeclasses/rooms.py:
Import the ContribRPRoom class: from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPRoom
- Inherit ContribRPRoom:
Change class Room(DefaultRoom): to class Room(ContribRPRoom):
- In typeclasses/objects.py
Import the ContribRPObject class: from evennia.contrib.rpg.rpsystem.rpsystem import ContribRPObject
- Inherit ContribRPObject:
Change class Object(DefaultObject): to class Object(ContribRPObject):
Reload the server (reload or from console: “evennia reload”)
- Force typeclass updates as required. Example for your character:
type/reset/force me = typeclasses.characters.Character
-
evennia.contrib.rpg.rpsystem.rpsystem.
parse_language
(speaker, emote)[source]¶ Parse the emote for language. This is used with a plugin for handling languages.
- Parameters
speaker (Object) – The object speaking.
emote (str) – An emote possibly containing language references.
- Returns
(emote, mapping) (tuple) –
- A tuple where the
emote is the emote string with all says (including quotes) replaced with reference markers on the form {##n} where n is a running number. The mapping is a dictionary between the markers and a tuple (langname, saytext), where langname can be None.
- Raises
evennia.contrib.rpg.rpsystem.LanguageError – If an invalid language was
specified. –
Notes
Note that no errors are raised if the wrong language identifier is given. This data, together with the identity of the speaker, is intended to be used by the “listener” later, since with this information the language skill of the speaker can be offset to the language skill of the listener to determine how much information is actually conveyed.
-
evennia.contrib.rpg.rpsystem.rpsystem.
parse_sdescs_and_recogs
(sender, candidates, string, search_mode=False, case_sensitive=True, fallback=None)[source]¶ Read a raw emote and parse it into an intermediary format for distributing to all observers.
- Parameters
sender (Object) – The object sending the emote. This object’s recog data will be considered in the parsing.
candidates (iterable) – A list of objects valid for referencing in the emote.
string (str): The string (like an emote) we want to analyze for keywords. search_mode (bool, optional): If True, the “emote” is a query string
we want to analyze. If so, the return value is changed.
- case_sensitive (bool, optional): If set, the case of /refs matter, so that
/tall will come out as ‘tall man’ while /Tall will become ‘Tall man’. This allows for more grammatically correct emotes at the cost of being a little more to learn for players. If disabled, the original sdesc case is always kept and are inserted as-is.
- fallback (string, optional): If set, any references that don’t match a target
will be replaced with the fallback string. If None (default), the parsing will fail and give a warning about the missing reference.
- Returns
(emote, mapping) (tuple) –
- If search_mode is False
(default), a tuple where the emote is the emote string, with all references replaced with internal-representation {#dbref} markers and mapping is a dictionary {“#dbref”:obj, …}.
- result (list): If search_mode is True we are
performing a search query on string, looking for a specific object. A list with zero, one or more matches.
- Raises
EmoteException – For various ref-matching errors.
Notes
The parser analyzes and should understand the following _PREFIX-tagged structures in the emote: - self-reference (/me) - recogs (any part of it) stored on emoter, matching obj in candidates. - sdesc (any part of it) from any obj in candidates. - N-sdesc, N-recog separating multi-matches (1-tall, 2-tall) - says, “…” are
-
evennia.contrib.rpg.rpsystem.rpsystem.
send_emote
(sender, receivers, emote, msg_type='pose', anonymous_add='first', **kwargs)[source]¶ Main access function for distribute an emote.
- Parameters
sender (Object) – The one sending the emote.
receivers (iterable) – Receivers of the emote. These will also form the basis for which sdescs are ‘valid’ to use in the emote.
emote (str) – The raw emote string as input by emoter.
msg_type (str) – The type of emote this is. “say” or “pose” for example. This is arbitrary and used for generating extra data for .msg(text) tuple.
anonymous_add (str or None, optional) – If sender is not self-referencing in the emote, this will auto-add sender’s data to the emote. Possible values are - None: No auto-add at anonymous emote - ‘last’: Add sender to the end of emote as [sender] - ‘first’: Prepend sender to start of emote.
- Kwargs:
- case_sensitive (bool): Defaults to True, but can be unset
here. When enabled, /tall will lead to a lowercase ‘tall man’ while /Tall will lead to ‘Tall man’ and /TALL will lead to ‘TALL MAN’. If disabled, the sdesc’s case will always be used, regardless of the /ref case used.
- any: Other kwargs will be passed on into the receiver’s process_sdesc and
process_recog methods, and can thus be used to customize those.
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
SdescHandler
(obj)[source]¶ Bases:
object
This Handler wraps all operations with sdescs. We need to use this since we do a lot preparations on sdescs when updating them, in order for them to be efficient to search for and query.
The handler stores data in the following Attributes
_sdesc - a string _regex - an empty dictionary
-
__init__
(obj)[source]¶ Initialize the handler
- Parameters
obj (Object) – The entity on which this handler is stored.
-
add
(sdesc, max_length=60)[source]¶ Add a new sdesc to object, replacing the old one.
- Parameters
sdesc (str) – The sdesc to set. This may be stripped of control sequences before setting.
max_length (int, optional) – The max limit of the sdesc.
- Returns
sdesc (str) – The actually set sdesc.
- Raises
SdescError – If the sdesc is empty, can not be set or is
longer than max_length. –
-
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
RecogHandler
(obj)[source]¶ Bases:
object
This handler manages the recognition mapping of an Object.
The handler stores data in Attributes as dictionaries of the following names:
_recog_ref2recog _recog_obj2recog
-
__init__
(obj)[source]¶ Initialize the handler
- Parameters
obj (Object) – The entity on which this handler is stored.
-
add
(obj, recog, max_length=60)[source]¶ Assign a custom recog (nick) to the given object.
- Parameters
obj (Object) – The object ot associate with the recog string. This is usually determined from the sdesc in the room by a call to parse_sdescs_and_recogs, but can also be given.
recog (str) – The replacement string to use with this object.
max_length (int, optional) – The max length of the recog string.
- Returns
recog (str) – The (possibly cleaned up) recog string actually set.
- Raises
SdescError – When recog could not be set or sdesc longer than max_length.
-
get
(obj)[source]¶ Get recog replacement string, if one exists.
- Parameters
obj (Object) – The object, whose sdesc to replace
- Returns
recog (str or None) –
- The replacement string to use, or
None if there is no recog for this object.
Notes
This method will respect a “enable_recog” lock set on obj (True by default) in order to turn off recog mechanism. This is useful for adding masks/hoods etc.
-
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
RPCommand
(**kwargs)[source]¶ Bases:
evennia.commands.command.Command
simple parent
-
aliases
= []¶
-
help_category
= 'general'¶
-
key
= 'command'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'command', 'no_prefix': ' ', 'tags': '', 'text': 'simple parent'}¶
-
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdEmote
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
Emote an action, allowing dynamic replacement of text in the emote.
- Usage:
emote text
Example
emote {prefix}me looks around. emote With a flurry {prefix}me attacks {prefix}tall man with his sword. emote “Hello”, {prefix}me says.
Describes an event in the world. This allows the use of {prefix}ref markers to replace with the short descriptions or recognized strings of objects in the same room. These will be translated to emotes to match each person seeing it. Use “…” for saying things and langcode”…” without spaces to say something in a different language.
-
key
= 'emote'¶
-
aliases
= [':']¶
-
locks
= 'cmd:all()'¶
-
arg_regex
= re.compile('', re.IGNORECASE)¶
-
get_help
(caller, cmdset)[source]¶ Return the help message for this command and this caller.
By default, return self.__doc__ (the docstring just under the class definition). You can override this behavior, though, and even customize it depending on the caller, or other commands the caller can use.
- Parameters
caller (Object or Account) – the caller asking for help on the command.
cmdset (CmdSet) – the command set (if you need additional commands).
- Returns
docstring (str) – the help text to provide the caller for this command.
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all()'¶
-
search_index_entry
= {'aliases': ':', 'category': 'general', 'key': 'emote', 'no_prefix': ' :', 'tags': '', 'text': '\n Emote an action, allowing dynamic replacement of\n text in the emote.\n\n Usage:\n emote text\n\n Example:\n emote {prefix}me looks around.\n emote With a flurry {prefix}me attacks {prefix}tall man with his sword.\n emote "Hello", {prefix}me says.\n\n Describes an event in the world. This allows the use of {prefix}ref\n markers to replace with the short descriptions or recognized\n strings of objects in the same room. These will be translated to\n emotes to match each person seeing it. Use "..." for saying\n things and langcode"..." without spaces to say something in\n a different language.\n\n '}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdSay
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
speak as your character
- Usage:
say <message>
Talk to those in your current location.
-
key
= 'say'¶
-
aliases
= ['"', "'"]¶
-
locks
= 'cmd:all()'¶
-
arg_regex
= re.compile('', re.IGNORECASE)¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all()'¶
-
search_index_entry
= {'aliases': '" \'', 'category': 'general', 'key': 'say', 'no_prefix': ' " \'', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say <message>\n\n Talk to those in your current location.\n '}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdSdesc
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
Assign yourself a short description (sdesc).
- Usage:
sdesc <short description> sdesc - view current sdesc sdesc clear - remove sdesc
Assigns a short description to yourself.
-
key
= 'sdesc'¶
-
locks
= 'cmd:all()'¶
-
aliases
= []¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all()'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'sdesc', 'no_prefix': ' ', 'tags': '', 'text': '\n Assign yourself a short description (sdesc).\n\n Usage:\n sdesc <short description>\n sdesc - view current sdesc\n sdesc clear - remove sdesc\n\n Assigns a short description to yourself.\n\n '}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdPose
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
Set a static pose
- Usage:
pose <pose> pose default <pose> pose reset pose obj = <pose> pose default obj = <pose> pose reset obj =
Examples
pose leans against the tree pose is talking to the barkeep. pose box = is sitting on the floor.
Set a static pose. This is the end of a full sentence that starts with your sdesc. If no full stop is given, it will be added automatically. The default pose is the pose you get when using pose reset. Note that you can use sdescs/recogs to reference people in your pose, but these always appear as that person’s sdesc in the emote, regardless of who is seeing it.
-
key
= 'pose'¶
-
aliases
= []¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'pose', 'no_prefix': ' ', 'tags': '', 'text': "\n Set a static pose\n\n Usage:\n pose <pose>\n pose default <pose>\n pose reset\n pose obj = <pose>\n pose default obj = <pose>\n pose reset obj =\n\n Examples:\n pose leans against the tree\n pose is talking to the barkeep.\n pose box = is sitting on the floor.\n\n Set a static pose. This is the end of a full sentence that starts\n with your sdesc. If no full stop is given, it will be added\n automatically. The default pose is the pose you get when using\n pose reset. Note that you can use sdescs/recogs to reference\n people in your pose, but these always appear as that person's\n sdesc in the emote, regardless of who is seeing it.\n\n "}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdRecog
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
Recognize another person in the same room.
- Usage:
recog recog sdesc as alias forget alias
Example
recog tall man as Griatch forget griatch
This will assign a personal alias for a person, or forget said alias. Using the command without arguments will list all current recogs.
-
key
= 'recog'¶
-
aliases
= ['forget', 'recognize']¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'forget recognize', 'category': 'general', 'key': 'recog', 'no_prefix': ' forget recognize', 'tags': '', 'text': '\n Recognize another person in the same room.\n\n Usage:\n recog\n recog sdesc as alias\n forget alias\n\n Example:\n recog tall man as Griatch\n forget griatch\n\n This will assign a personal alias for a person, or forget said alias.\n Using the command without arguments will list all current recogs.\n\n '}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
CmdMask
(**kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.RPCommand
Wear a mask
- Usage:
mask <new sdesc> unmask
This will put on a mask to hide your identity. When wearing a mask, your sdesc will be replaced by the sdesc you pick and people’s recognitions of you will be disabled.
-
key
= 'mask'¶
-
aliases
= ['unmask']¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'unmask', 'category': 'general', 'key': 'mask', 'no_prefix': ' unmask', 'tags': '', 'text': "\n Wear a mask\n\n Usage:\n mask <new sdesc>\n unmask\n\n This will put on a mask to hide your identity. When wearing\n a mask, your sdesc will be replaced by the sdesc you pick and\n people's recognitions of you will be disabled.\n\n "}¶
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
RPSystemCmdSet
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
Mix-in for adding rp-commands to default cmdset.
-
key
= 'rpsystem_cmdset'¶
-
at_cmdset_creation
()[source]¶ Hook method - this should be overloaded in the inheriting class, and should take care of populating the cmdset by use of self.add().
-
path
= 'evennia.contrib.rpg.rpsystem.rpsystem.RPSystemCmdSet'¶
-
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
ContribRPObject
(*args, **kwargs)[source]¶ Bases:
evennia.objects.objects.DefaultObject
This class is meant as a mix-in or parent for objects in an rp-heavy game. It implements the base functionality for poses.
-
get_search_result
(searchdata, candidates=None, **kwargs)[source]¶ Override of the parent method for producing search results that understands sdescs. These are used in the main .search() method of the parent class.
-
get_posed_sdesc
(sdesc, **kwargs)[source]¶ Displays the object with its current pose string.
- Returns
pose (str) –
- A string containing the object’s sdesc and
current or default pose.
-
get_display_name
(looker, **kwargs)[source]¶ Displays the name of the object in a viewer-aware manner.
- Parameters
looker (TypedObject) – The object or account that is looking at/getting inforamtion for this object.
- Keyword Arguments
pose (bool) – Include the pose (if available) in the return.
ref (str) – The reference marker found in string to replace. This is on the form #{num}{case}, like ‘#12^’, where the number is a processing location in the string and the case symbol indicates the case of the original tag input - t - input was Titled, like /Tall - ^ - input was all uppercase, like /TALL - v - input was all lowercase, like /tall - ~ - input case should be kept, or was mixed-case
noid (bool) – Don’t show DBREF even if viewer has control access.
- Returns
name (str) –
- A string of the sdesc containing the name of the object,
if this is defined. By default, included the DBREF if this user is privileged to control said object.
-
get_display_characters
(looker, pose=True, **kwargs)[source]¶ Get the ‘characters’ component of the object description. Called by return_appearance.
-
get_display_things
(looker, pose=True, **kwargs)[source]¶ Get the ‘things’ component of the object description. Called by return_appearance.
- Parameters
looker (Object) – Object doing the looking.
**kwargs – Arbitrary data for use when overriding.
- Returns
str – The things display data.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.objects.objects.DefaultObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject'¶
-
typename
= 'ContribRPObject'¶
-
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
ContribRPRoom
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject
Dummy inheritance for rooms.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.rpg.rpsystem.rpsystem.ContribRPRoom'¶
-
typename
= 'ContribRPRoom'¶
-
exception
-
class
evennia.contrib.rpg.rpsystem.rpsystem.
ContribRPCharacter
(*args, **kwargs)[source]¶ Bases:
evennia.objects.objects.DefaultCharacter
,evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject
This is a character class that has poses, sdesc and recog.
-
get_display_name
(looker, **kwargs)[source]¶ Displays the name of the object in a viewer-aware manner.
- Parameters
looker (TypedObject) – The object or account that is looking at/getting inforamtion for this object.
- Keyword Arguments
pose (bool) – Include the pose (if available) in the return.
ref (str) – The reference marker found in string to replace. This is on the form #{num}{case}, like ‘#12^’, where the number is a processing location in the string and the case symbol indicates the case of the original tag input - t - input was Titled, like /Tall - ^ - input was all uppercase, like /TALL - v - input was all lowercase, like /tall - ~ - input case should be kept, or was mixed-case
noid (bool) – Don’t show DBREF even if viewer has control access.
- Returns
name (str) –
- A string of the sdesc containing the name of the object,
if this is defined. By default, included the DBREF if this user is privileged to control said object.
Notes
The RPCharacter version adds additional processing to sdescs to make characters stand out from other objects.
-
at_pre_say
(message, **kwargs)[source]¶ Called before the object says or whispers anything, return modified message.
- Parameters
message (str) – The suggested say/whisper text spoken by self.
- Keyword Arguments
whisper (bool) – If True, this is a whisper rather than a say.
-
get_sdesc
(obj, process=False, **kwargs)[source]¶ Single method to handle getting recogs with sdesc fallback in an aware manner, to allow separate processing of recogs from sdescs. Gets the sdesc or recog for obj from the view of self.
- Parameters
obj (Object) – the object whose sdesc or recog is being gotten
- Keyword Arguments
process (bool) – If True, the sdesc/recog is run through the appropriate process method for self - .process_sdesc or .process_recog
-
process_sdesc
(sdesc, obj, **kwargs)[source]¶ Allows to customize how your sdesc is displayed (primarily by changing colors).
- Parameters
sdesc (str) – The sdesc to display.
obj (Object) – The object to which the adjoining sdesc belongs. If this object is equal to yourself, then you are viewing yourself (and sdesc is your key). This is not used by default.
- Kwargs:
- ref (str): The reference marker found in string to replace.
This is on the form #{num}{case}, like ‘#12^’, where the number is a processing location in the string and the case symbol indicates the case of the original tag input - t - input was Titled, like /Tall - ^ - input was all uppercase, like /TALL - v - input was all lowercase, like /tall - ~ - input case should be kept, or was mixed-case
- Returns
sdesc (str) –
- The processed sdesc ready
for display.
-
process_recog
(recog, obj, **kwargs)[source]¶ Allows to customize how a recog string is displayed.
- Parameters
recog (str) – The recog string. It has already been translated from the original sdesc at this point.
obj (Object) – The object the recog:ed string belongs to. This is not used by default.
- Returns
recog (str) – The modified recog string.
-
process_language
(text, speaker, language, **kwargs)[source]¶ Allows to process the spoken text, for example by obfuscating language based on your and the speaker’s language skills. Also a good place to put coloring.
- Parameters
text (str) – The text to process.
speaker (Object) – The object delivering the text.
language (str) – An identifier string for the language.
- Returns
text (str) – The optionally processed text.
Notes
This is designed to work together with a string obfuscator such as the obfuscate_language or obfuscate_whisper in the evennia.contrib.rpg.rplanguage module.
-
exception
DoesNotExist
¶ Bases:
evennia.objects.objects.DefaultCharacter.DoesNotExist
,evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned
,evennia.contrib.rpg.rpsystem.rpsystem.ContribRPObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.rpg.rpsystem.rpsystem.ContribRPCharacter'¶
-
typename
= 'ContribRPCharacter'¶
-