Updates to the State system

10 views
Skip to first unread message

Griatch

unread,
Aug 15, 2009, 9:43:55 PM8/15/09
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

Greg Taylor

unread,
Aug 17, 2009, 8:45:05 AM8/17/09
to eve...@googlegroups.com
Sounds interesting, I'll take a look at this in more detail soon.

Greg Taylor
Level Eleven Solutions, LLC
Cell: (864) 888-7964
http://l11solutions.com
Reply all
Reply to author
Forward
0 new messages