States represent the sequence of states the room goes through.

This module includes the BaseState class and the StateHandler for managing states on the room.

The state handler operates on an Evscaperoom and changes its state from one to another.

A given state is given as a module in states/ package. The state is identified by its module name.

class evennia.contrib.full_systems.evscaperoom.state.StateHandler(room)[source]

Bases: object

This sits on the room and is used to progress through the states.


Initialize self. See help(type(self)) for accurate signature.


Load state without initializing it


Initialize a new state


Check if the current state is finished. This should be called whenever the players do actions that may affect the state of the room.


next_state (str, optional) – If given, override the next_state given by the current state’s check() method with this - this allows for branching paths (but the current state must still first agree that the check passes).


state_changed (bool) – True if the state changed, False otherwise.

class evennia.contrib.full_systems.evscaperoom.state.BaseState(handler, room)[source]

Bases: object

Base object holding all callables for a state. This is here to allow easy overriding for child states.

next_state = 'unset'
hints = []
__init__(handler, room)[source]


  • room (EvscapeRoom) – The room tied to this state.

  • handler (StateHandler) – Back-reference to the handler storing this state.


Get a hint for how to solve this state.

msg(message, target=None, borders=False, cinematic=False)[source]

Display messsage to everyone in room, or given target.

cinematic(message, target=None)[source]

Display a ‘cinematic’ sequence - centered, with borders.

create_object(typeclass=None, key='testobj', location=None, **kwargs)[source]

This is a convenience-wrapper for quickly building EvscapeRoom objects.

Keyword Arguments
  • typeclass (str) – This can take just the class-name in the evscaperoom’s objects.py module. Otherwise, a full path or the actual class is needed (for custom state objects, just give the class directly).

  • key (str) – Name of object.

  • location (Object) – If not given, this will be the current room.

  • kwargs (any) – Will be passed into create_object.


new_obj (Object) – The newly created object, if any.


Find a named non-character object for this state in this room.


key (str) – Object to search for.


obj (Object) – Object in the room.


Initializes the state (usually by modifying the room in some way)


Any cleanup operations after the state ends.


Get the next state after this one.


next_state (str, optional) – This allows the calling code to redirect to a different state than the ‘default’ one (creating branching paths in the game). Override this method to customize (by default the input will always override default set on the class)


state_name (str or None)

Name of next state to switch to. None

to remain in this state. By default we check the room for the “finished” flag be set.


Called when character enters the room in this state.


Called when character is whisked away (usually because of quitting). This method cannot influence the move itself; it happens just before room.character_cleanup()