Local object command tables are now in. See game/gamesrc/parents/examples/red_button.py for example. Note that local command matches will override global matches. Command handler short circuits on the first command match. This will typically be the object with the lowest ID.

This commit is contained in:
Greg Taylor 2009-04-25 06:11:42 +00:00
parent 723cdab4aa
commit ffa03309fc
5 changed files with 40 additions and 13 deletions

View file

@ -7,6 +7,7 @@ NOTE: This file should NOT be directly modified. Sub-class the BasicObject
class in game/gamesrc/parents/base/basicobject.py and change the
SCRIPT_DEFAULT_OBJECT variable in settings.py to point to the new class.
"""
from src.cmdtable import CommandTable
from src.ansi import ANSITable
class EvenniaBasicObject(object):
@ -25,6 +26,7 @@ class EvenniaBasicObject(object):
scripted_obj: (Object) A reference to the object being scripted (the child).
"""
self.scripted_obj = scripted_obj
self.command_table = CommandTable()
def at_object_creation(self):
"""