29 Sep, 2015, Griatch wrote in the 1st comment:
Votes: 0
I just released the "rpsystem contrib" for the Python-based MUD-development system Evennia. Contribs are meant to be "snippets" of more game-specific code you can easily import into your game project and make use of.

This contrib s an utility for adding author-stance emoting, poses, sdescs and language obfuscation.

As usual in Evennia, it's very easy to adjust and modify this to your own game specifics - this is to be seen as a solid base to build from rather than forcing you into a mold. The modules are evennia/contrib/rpsystem.py and rplanguage.py. Just import what you want from here and/or (re-)inherit (or mixin) your Objects/Characters from the supplied classes to get all the included goodies and commands automatically.

Example of use

> look

Quote
The red Dragon tavern
You are in a busy tavern.
A tall man is standing by the bar.
A very shifty elvish dude is looking at the performer on stage.
A very cheerful girl in colorful garb is performing on stage.


What we see above are sdescs + poses. We set our own, so people looking can tell what we are doing at a glance:

> pose is standing in the door of the tavern looking around.

Quote
Pose will read 'A wizened old man is standing in the door of the tavern looking around.'


You can reference any sub-string of an sdesc, including spaces

> look cheerful girl in colorful

Quote
A very cheerful girl in colorful garb is performing on stage.
She is a small jesterly woman in colorful clothes and a big smile. Her
cap n' bells are perched atop a dark tuft of unruly hair.


> emote /me looks around, nodding slightly at /tall and /shifty elvish dude.

Quote
Griatch looks around, nodding slightly at A tall man and A very shifty elvish dude.


Kelketek (the tall man) will see:

Quote
A wizened old manlooks around, nodding slightly at Kelketek and A very shifty elvish dude.


Volund (the very shifty elvish dude) will see:

Quote
A wizened old man looks around, nodding slightly at A tall man and Volund.


> :With a quick step, /me walks over to the bar and says to /tall, "Hi there, friend." (":" is an alias to emote)

Quote
With a quick step, Griatch walks over to the bar and says to A tall man, "Hi there, friend".


Quote
A Tall man nods to Griatch. "Good 'ta meet ya, oh wise one. I'm Kelketek the magnificent."


> recog tall as Kelketek the slightly obnoxious

Quote
Griatch will now remember A tall man as Kelketek the slighly obnoxious.


> pose is standing in the bar talking to /slightly obnoxius.

Quote
Pose will read 'A wizened old man is standing in the bar talking to A tall man'.


Let's look at the basic masking/disguise functionality

Quote
Kelketek raises the hood of his cape, his features disappearing in the shadows.


(Kelketek now did the command mask A hooded figure before emoting again.)

Quote
A hooded figure [masked] says, "See you around."


> emote /me waves to /kelketek as he leaves.

Quote
No match for /kelketek.


> recog hooded as Kelketek

Quote
Can't recognize someone who is masked.


> emote /me waves to /hooded figure.

Quote
Griatch waves to A hooded figure [masked] as he leaves.


And some error handling. Like everywhere else in (default) Evennia, the server never "guesses" in the case of ambivalence, but always ask for specifics

> emote /me looks at /very and says (elvish)"Excuse me, but it's rare to see an elf around here.

Quote
Multiple possibilities for 'very':
1-very (A very cheerful girl in colorful garb)
2-very (A very shifty elvish dude)


> emote /me looks at /1-very and says (elvish)"Excuse me, my elvish is rusty, but it's rare to see an elf around here."

(Now for some things which are possible but requires more game-mechanics to be built in order to be useful. This is an example where the language module has been brought to bear during the processing of the emote (this goes through an overloadable method on the Character object itself). For example, if Griatch or Volund is poor at elvish, the language module could be used to obfuscate the result Volund sees:

Quote
A wizened old man looks at Volundand says (elvish)"Guaevu me, my acahait is qu'aee, but it's wuina to aig an elf moshive aisn."


(Back to Griatch's perspective again, let's assume the return language goes through ok:)

Quote
A very shifty elvish dude leans over and whispers back, (elvish)"She's pretty cute, that girl up on stage, isn't she?"


(Now, if the game had a distance measure within the room or maybe a skill in eavesdrop or similar, the whisper might not be fully heard by the girl on stage, and she might see only a distorted estimate:)

Quote
A very shifty elvish dudeleans over and whispers back, (elvish)"Sh.'s p..tt. c.t., t..t g… .p .. st.g., is.t sh.?"


——

This is a snippet from the official announcement, with clarifications for non-Evennia users. The full post with more technical details can be found here on the Evennia mailing list.

Cheers,
Griatch
29 Sep, 2015, Griatch wrote in the 2nd comment:
Votes: 0
Looking at it, I suppose this should rather go into Custom since it relates to one specific codebase. Sorry about that. Could a mod move, please?
.
Griatch
0.0/2