Evennia cheat sheet

by
Permalink
Here's a cheatsheet for Evennia, a Python MUD framework.

I'm creating a MUD using Evennia, a Python framework that is super powerful and extendable. I couldn't find a great cheat sheet online, so here's some notes from their tutorial series. I will update this as I go, and I may end up typesetting this into a PDF.

Evennia commands

These commands are done through the Evennia shell (i.e., through a MUD client). Typically, items can include me for oneself, here for the current location, or a database reference number like #8.

Basic interaction

Operation Code
Get help
help [item]
Look around
look [item]
Get detailed information
examine [item]
Pick up item
get [item]
See inventory
inventory
Use a named exit
<exit>
Move to a location
teleport <location>
Global search for something
find <item/location/exit...>

Creating items

Operation Code
Create an item (and drop it)
create[/drop] <item>[:<typeclass]
Add synonyms
name <item> = <alias>[;<alias>...]
Add descriptions
desc <item> = <details>
Move item to a location
teleport <item> = <location>
Delete item
destroy <item>
Set attribute
set/<attribute> = <name>

Creating locations

Operation Code
Add a named location from here
dig <location> = <exitname>[;<alias>...]
Add a cardinal direction
tunnel <n[orth]/s/e/w/nw/.../in/out/up/down> = <name>[;<alias>...]
Open from here to a previous location
open <exitname>[;<alias>...] = <location>

Administration

Operation Code
Temporarily decrease/restore permissions
quell/unquell
Add help entry
sethelp <entryname> = <details>
Reload world and code
reload

Locks and permissions

Lockfuncs can be defined in server/conf/lockfuncs.py. See Evennia's list of access_types.

Operation Code
Add/remove lock
lock[/del] <object> = <lockstring>
Lockstring format
<accesstype>: [NOT] lockfunc() [[AND/OR] [NOT] lockfunc() ...]
Add/remove account permissions
perm/account[/del] <user> = <permission>
Account levels Guest, Player, Helper, Builder, Admin, Developer
Add/remove object permissions
perm[/del] <object> = <permission>

Python commands

These commands can be used in the interactive Python shell (py within a MUD client) or through a Python script.

Creating things

Operation Code
Create a character, room, exit, or object
evennia.create_object('<typeclass>', key='<database_key>', [location=...,] [permissions=...,] [locks=...,] [attributes=...,])
Store persistent object values
<object>.db.<key> = ...
Creating an account, channel, or script
evennia.create_<account/channel/script>(...)
Object location
<object>.location
Object contents
<object>.contents
Exit destination
<exit>.destination
Add tags
<object>.tags.add("<tag>"[, category="<category>"])

Creating commands

Operation Code
Name of command
<Command>.key
Command function
<Command>.func()
Argument string provided to command
<Command>.args
Help function for command Defined in docstring of
<Command>
Message command caller
<Command>.msg("<msg>")
Add command to a commandset
self.add(Command)
in
<CmdSet>.at_cmdset_creation()
Remove command from a commandset
self.remove(Command)
in
<CmdSet>.at_cmdset_creation()

Searching

See the Evennia docs on Django queries for an explanation on how powerful and flexible Django queries can be.

Operation Code
Global search for an object
evennia.search_object("<name>")[0]
Search for an object relative to caller
<object>.search("<name>")
Search by tag
evennia.search_tag("<tag>")
Search by location
evennia.search_object("<name>", candidate=<location>.contents)
Search by attribute
evennia.search_object("<name>", attribute_name="<attribute>")
Search by typeclass
evennia.search_object("<name>", typeclass="<typeclass>")
Search by Django query
<Typeclass>.objects.<all/filter/get/exclude(db_key="<name>")>
Search by Django query (incl. subclasses)
<Typeclass>.objects.<all_family/filter_family/get_family/exclude_family(db_key="<name>")>

Directories

Directory Description
commands/
Commands and command sets
server/
Server files, see settings at server/conf/settings.py
typeclasses/
Templates for accounts, characters, scripts, rooms, etc.
web/
Website and webclient files
world/
Misc. files, useful for user-defined build scripts and modules

Other Posts

Theremin 1 - Ultrasonic sensor

I designed and implemented a theremin using an Arduino with an ultrasonic sensor.

How to start a blog

I'm starting a webring, so I'm sharing instructions for my friends to get started.

How I've set up a password manager, and why you should too

One password to rule them all, one password to find them, one password to bring them all and in the darkness bind them.