Commit graph

22 commits

Author SHA1 Message Date
Griatch
eb6f82fea0 Added an at_obj_receive hook to basic player/object script parents. This allows
e.g. room parents to react when a player enters them.
2009-10-25 15:25:15 +00:00
Greg Taylor
d06ac3e239 Not sure how we ended up with bold cyan as the default object name color, reverting that to bold white as per MUX/MUSH. 2009-10-24 03:54:03 +00:00
Griatch
656ecd9f97 Added VisibleKey, allowing objects to be locked so they are not visible by normal look command.
Fixed bug in create_object that sometimes caused rooms to be created with a location !=None
Expanded @destroy to better handle names and not just dbrefs.
/Griatch
2009-10-22 19:44:16 +00:00
Griatch
557c4eb07b Fixed bug in destroy command; cleaned up @dig a bit. 2009-10-22 14:30:57 +00:00
Griatch
c4114938cc Many small but useful bug fixes in various modules.
/Griatch
2009-10-20 20:38:24 +00:00
Griatch
46e2cd3ecb Added FuncKeys - locking of objects depending on the result from an arbitrary function.
Added AttrKeys and FlagKeys - locks depending on the value of the unlocker's attribute or if they have a flag set.
Finally I updated @lock to handle all these lock types. There are a large amount of possible configurations though, so more testing is needed.
/Griatch
2009-10-12 20:58:15 +00:00
Griatch
66095a0b16 Implemented locks.
The main command to use is @lock, which accept three types of locks at the moment, and three types of keys:
 Locks: DefaultLock, UseLock, EnterLock
 Keys: ObjectIDs, Groups, Permissions
This offers the most useful functionality - stopping people from picking up things, blocking exits and stopping
anyone from using an object.
If the attributes lock_msg, use_lock_msg and enter_lock_msg are defined on the locked object, these will be used
as error messages instead of a standard one (so "the door is locked" instead of "you cannot traverse that exit").

Behind the scenes, there is a new module, src/locks.py that defines Keys and Locks. A Locks object is a collection
of Lock types. This is stored in the LOCKS attribute on objects. Each Lock contains a set of Keys that might be
of mixed type and which the player must match in order to pass the lock.
/Griatch
2009-10-05 20:04:15 +00:00
Griatch
a5a0d92985 Added some more information to the move-announcement hooks; these also know from where the object is coming from (this can be useful for admins wanting to produce e.g. 'player arrives from <foo>' messages insteda of the default uninformative 'player arrives.'. )
/Griatch
2009-09-20 00:02:57 +00:00
Griatch
4cee971169 Fixed some bugs in move reporting. Made feedback from default commands a bit more informative and consistent. Added some more text and error handling to the login commands. 2009-09-19 20:48:06 +00:00
Griatch
8fbeea99dc Moved the last hard-wired emits from objects/models.py into scriptparent hooks. This allows the admin to customize this without having to mess with the engine.
Other small bugfixes, fixes to @dig to properly call creation hooks of all newly created objects (it was not setting anything before). Also fixed some of the annoying bugs around using several of the building commands that didn't properly handle spaces around the separator = symbol.
/Griatch
2009-09-19 15:18:42 +00:00
Griatch
1d4f075ca7 * Updated and expanded the State system; the API changed a bit. You now have to first *create* the state using
GLOBAL_STATE_TABLE.add_state() before adding commands to it. The state can now be much more configured by including as much or as
little of the normal default commands into it as wanted (so you can now have states which are almost as normal, except some
commands are missing or change their behaviour ... illness or darkness comes to mind). The possibilities here are limitless.
* States now also optionally allow traversing exits as well as using command tables defined on objects.
* States now better handle error messages (so if you try 'look' in a state which does not contain a look command you will no
longer get the 'Huh?' but will be told that the command is not available at the moment).
* All examples in commands/examples/ have been updated to use the new State system. Also added a @test_state function for trying out
the functionality.
* Added hooks at_before_move() and at_after_move(), useful for character based move-restrictions and checks (e.g. movement speed)
* Minor tweaks to the event system; avoiding the counters to go negative should they hit an uncaught traceback.
* Small fixes of typos and minor extra safety checks.
/Griatch
2009-08-16 01:18:58 +00:00
Griatch
05554e290a Moved the object's 'description' into an attribute, as suggested in the code. This means that get_description() and set_description() should no longer be used; instead use set_attribute('desc',value) and get_attribute('desc') as you would any attribute. 'desc' is used by the default look command, but apart from that, desc has no special status anymore.
/Griatch
2009-05-03 16:55:42 +00:00
Greg Taylor
0ad8c88c22 Comment elaboration. 2009-04-25 06:32:47 +00:00
Greg Taylor
ffa03309fc 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. 2009-04-25 06:11:42 +00:00
Greg Taylor
ee8bd34bb3 Renamed at_pre_destroy() to at_object_destruction() to be consistent with at_object_creation() and at_player_creation(). Added additional documentation as well. 2009-04-17 01:43:45 +00:00
Greg Taylor
4bcbfd855a 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. 2009-04-16 14:37:58 +00:00
Greg Taylor
36e23bfd4a Modularizing ANSI parsing. This may break stuff. It's not quite where I want it just yet. 2009-04-13 22:44:44 +00:00
Greg Taylor
5a465746c5 Adjust some function names in the script parents to be at_ instead of a_. Also re-designed the scheduling system to be a lot more pythonic and easy to use. Utilizes classes to represent events. Much easier to plug in events from within the game directory now as well. 2009-04-06 16:19:07 +00:00
Greg Taylor
b3c386a2c3 Clean up some of the methods on the script parent system. I have no idea why I was being silly and passing things around through dictionaries. Yick. Also added a at_player_creation method to basicplayer.py that is triggered after player objects are created and ready to go, but before they are logged in. 2009-03-30 00:54:05 +00:00
Greg Taylor
df69011134 Working on getting command tables implemented on individual objects. It's probably not a good idea to update to this revision in a 'production' environment yet. 2009-01-30 03:28:41 +00:00
Greg Taylor
462628ab55 Builders start seeing dbrefs for the most part. 2009-01-15 16:24:52 +00:00
Greg Taylor
122bf4e3ff Splitting the scripted parent system out into the gamesrc directory. There will be more explanation of this later. 2008-12-15 05:55:04 +00:00
Renamed from src/scripts/basicobject.py (Browse further)