mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 23:06:31 +01:00
Add at_object_creation() to basicobject.py. I'll be adding at_object_destruction() later, ran out of time right now to do so. Also added some elaboration on the purpose of __init__ to basicobject.py.
This commit is contained in:
parent
36e23bfd4a
commit
4bcbfd855a
3 changed files with 23 additions and 2 deletions
|
|
@ -12,12 +12,28 @@ from src.ansi import ANSITable
|
|||
class EvenniaBasicObject(object):
|
||||
def __init__(self, scripted_obj, *args, **kwargs):
|
||||
"""
|
||||
Get our ducks in a row.
|
||||
Get our ducks in a row. You should generally never override this. Note
|
||||
that this will not be called on object creation in a manner typical to
|
||||
most Python objects. This is only called when the script parent is
|
||||
cached or recalled on an object. This means that this function is not
|
||||
called until someone does something to warrant calling get_scriptlink().
|
||||
|
||||
If you're wanting to do something on object/player creation, override
|
||||
at_object_creation() (in basicobject.py) or at_player_creation()
|
||||
(in basicplayer.py).
|
||||
|
||||
scripted_obj: (Object) A reference to the object being scripted (the child).
|
||||
"""
|
||||
self.scripted_obj = scripted_obj
|
||||
|
||||
def at_object_creation(self):
|
||||
"""
|
||||
This is triggered after a new object is created and ready to go. If
|
||||
you'd like to set attributes, flags, or do anything when the object
|
||||
is created, do it here and not in __init__().
|
||||
"""
|
||||
pass
|
||||
|
||||
def at_desc(self, pobject=None):
|
||||
"""
|
||||
Perform this action when someone uses the LOOK command on the object.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue