Griatch
unread,Aug 15, 2009, 9:43:55 PM8/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Evennia
Just a heads up that the API of the State system of Evennia changed in
rev643.
Before, when creating a state you just did
GLOBAL_STATE_TABLE.add_command(statename,...), creating the state
<statename> on the fly if it did not already exist. This turned out to
be quite clumsy to expand on. There is now a separate command add_state
(statename,...) with plenty of optional arguments. You must call this
in order to create the state before commands can be added to it. All
the examples in gamesrc/commands/examples have been updated to show
the new syntax.
This new function takes a host of arguments that allows you to
customize how much of the normal (global) command table you want to
include in your state - for example you can choose to include all of
it except just a few commands or vice versa. State system now also
optionally allows traversing exits and using objects.
Apart from the previously mentioned things you can do with the State
system - text editors, game menus, character creation wizards, the
expanded state system allows plenty more flexibility.
Some random ideas for use:
Have some commands only available during nighttime.
Change how the 'look' command works in darkness or when you are in a
drunken state.
Disallowing people to leave a room or start crafting when they are in
a "pinned down" state...
A 'ghost' state, or maybe 'Panic' state where people may run from
place to place without being able to study or interact with their
surroundings ...
etc.
There is a small test function added to gamesrc/commands/examples/
state_example.py which allows you to see the various states in action
(it's not flashy at all, it just shows that it works as advertised ...
hopefully ;) )
.
Griatch