Commit graph

34 commits

Author SHA1 Message Date
Griatch
df29defbcd Added gamesrc/utils.py as a convenient shorthand for often-used methods from the engine
Added a @deluser command and gave it and @boot an option to give a reason for booting/deleting a player
Fixed a bug in @dig that confused exit directions in text
Small bug fixes
/Griatch
2009-12-20 20:51:26 +00:00
Griatch
81bec61d7d Added the apropos command for broader help searching (uses icontains).
The suggestions: footer used in help gave too narrow results, now using apropos-style search instead.
Bug fix of state-help command to make it accept switches.
Added several new example commands and cleaned up old ones to be more user-friendly.
Added protection in @delevent to make it harder to delete system events.
Some small bug fixes and other cleanup.
2009-12-20 12:39:08 +00:00
Griatch
c7cbc4854e Reworked object command tables.
Object commands used to require re-adding every call in the script parent's __init__ or factory functions, adding the commands to a new command table directly on the object. Since all other attributes can be set up in at_object_creation(), this was both inconsistent and a bit confusing to work with. There is now a method add_commands() directly defined on all objects. It takes the same arguments as the normal add_command()o but use a reserved attribute to create and update a command table on the object. This has the advantange of completely removing the __init__ call in the script parent, all definitions can now be kept in at_object_creation() and are, more importantly, persistent without having to be recreated every call.
- I updated the examine command to show all the commands defined on an object (if any).
- I updated gamesrc/parents/examples/red_button.py considerably using the new command methodology and also using the updated Events.
.
Griatch
2009-12-03 00:41:53 +00:00
Griatch
a6ae6e936a Patched the batch-processor's interactive mode so it will not abort if it processes an object/script parent that changes the player's state. Also added a variable BATCH_IMPORT_PATH to config so one can keep all batch scripts in one location and don't have to write the full path to get them. Default is the new directory game/gamesrc/world.
Added the permission genperms.admin_nostate so that builders can avoid entering a state when working on a room with a state-changing parent. Superusers have to set the flag ADMIN_NOSTATE on themselves to achieve the same effect (this is necessary since superusers always have all permissions, so they would otherwise never be able to enter states).
/Griatch
2009-10-20 22:21:01 +00:00
Griatch
a711e07b80 Added the capability of evennia commands to consist of more than one word. So the examples.red_button parent can now be pressed with the command 'push button' instead of 'pushbutton' as before. The variable COMMAND_MAXLEN in the config defines how many words your commands may maximum contain (don't set it higher than needed for efficiency reasons).
The main drawback of multi-word commands are that they can not have any switches; they are intended for in-game use (in states and on objects). Use normal one-word commands for administration and more complex commands with many options.
/Griatch
2009-10-18 19:29:18 +00:00
Griatch
84aeabb272 Some cleanup. Fixed all examples to match the changes in the states and help systems, also
ran them through pylint to pretty them up.
/Griatch
2009-10-15 09:43:34 +00:00
Griatch
8074617285 Largely rewrote and refactored the help system.
The help entry database structure has changed! You have to resync or purge
your database or your will get problems!

New features:
* Help entry access now fully controlled by evennia permissions
* Categories for each help entry
* All entries are created dynamically, with a See also: footer calculated
  after the current state of the database.
* Indexes and topic list calculated on the fly (alphabetically/after category)
* Added auto-help help entries for all default commands.
* Only shows commands _actually implemented_ - MUX help db moved into 'MUX' category
  which is not shown by default.
* More powerful auto-help markup - supports categories and permissions (and inheritance).
* Global on/off switch for auto-help, when entering production
* Auto_help_override switch for selectively activating auto-help when developing
  new commands (like the old system).
* Refactored State help system; no more risk of overwriting global help entries.
* State help now defers to main help db when no match found; makes system more transparent.
* State help entries also support categories/permissions (state categories are not
  used much though).

Other updates:
* Added more commands to the batch processor
* Many bug-fixes.

/Griatch
2009-10-14 18:15:15 +00:00
Griatch
f99614346d Made the StateSystem example commands in gamesrc/commands/examples/state_example more elaborate and informative. These
are the commands:
 entermenu (shows a simple menu system)
 enterstate (enters one of six different states with descriptions and hints of usage)
Leave all states with @exit.
/Griatch
2009-09-28 19:27:35 +00:00
Griatch
eebfa0d387 Added a command batch processor to Evennia. The @batchprocess is a super-user only command that reads normal Evennia-commands
from a special-format batchfile. It is intended for large-scale offline world creation (especially things like room descriptions),
where a real text editor is often easier to use than online alternatives. The @batchprocess also has an /interactive mode which allows
stepping through the batch script, allowing to only execute selected entries; e.g. for editing/updating/debugging etc.  There is
an example batchfile in the gamesrc/commands/examples directory.
/Griatch
2009-09-04 08:01:43 +00:00
Griatch
929786638d Cleaning up erroneous commit. 2009-08-28 19:13:25 +00:00
Griatch
72ec7377b9 Added some changes to revision conttrol. 2009-08-28 19:07:25 +00:00
Griatch
2640bd057a Fixed some minor typos. 2009-08-23 09:30:09 +00:00
Griatch
6bbdde763d Minor fix of an argument typo as well as making an example more compacent with the wiki. 2009-08-16 09:09:55 +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
Griatch
1314629a06 Minor bugfix of addcom command, some other cleanup. 2009-05-02 15:55:47 +00:00
Griatch
5bc1db70ed Added help/del to the state-help system, made some appearance tweaks on the examples. 2009-05-02 08:55:12 +00:00
Griatch
fd050f75ca Some adjustments of the formatting for auto_help. Added some colours to the state_example menu. 2009-05-02 08:25:37 +00:00
Griatch
cafbdf720e Minor typo-fixes as well as making some variable names more intuitive. 2009-05-01 15:56:19 +00:00
Griatch
0efe2c3095 Created a state system. See
http://groups.google.com/group/evennia/browse_thread/thread/66a7ff6cce5303b7
for more detailed description.

Created a new folder gamesrc/commands/examples and moved all examples in there.
/Griatch
2009-05-01 15:34:43 +00:00
Griatch
ba623af351 Took out some useless code and imports left in after testing this. 2009-05-01 06:42:37 +00:00
Greg Taylor
a5efca450d Looks like there's an import in here that doesn't exist. Commenting it out. Starkiel, was this supposed to do anything? 2009-05-01 05:03:52 +00:00
Griatch
3eb4cddf42 - implemented @destroy as per the MUX help specifications. As part of this, fixed the object recycling routines to actually properly replace GARBAGE-flagged objects (it crashed before).
- Set up a global cleaner event to clean all @destroyed objects every 30 minutes (makes their dbrefs available).
- Added the @recover command for recovering @destroyed objects up until the point that the cleaner runs and actually destroys them. This can recover @destroyed objects, rooms and exits to the same state as before @destroy. It could easily be made to recover player objects too, but I'm thinking this would be a security issue.
- Added to @dig in order to allow for creating rooms with a particular parent. Also auto-creates exits in each room if desired. The only things that is not implemented is the aliases of the exits, I don't really know how to do that.
- Changed the @create command format to match the @dig (it uses : to mark the parent instead of = now, since MUX' @dig reserve = to the exit list.)
- Added extra security in the example event to guard against the bug that causes the whole scheduler to freak out if the event_function() gives a traceback.
- Changed many instances of type to point to the defines_global.OTYPE instead of giving the integer explicitly.
/Starkiel
2009-04-30 15:01:59 +00:00
Griatch
8799a0fd55 Added example of how to handle event errors gracefully without them taking down the server with with unhandled exceptions (this should be handled somewhere above exception too, but it's hard to tell when to do it since twisted is raising them). /Starkiel 2009-04-30 08:23:54 +00:00
Griatch
b63bcc6132 Removed an unneeded debug logger entry from the example event to avoid spamming the log. 2009-04-26 11:04:54 +00:00
Griatch
a9dbac8aae - Made many small bugfixes to the @parent and @create functions as well as their underlying methods.
- Made it so user #1 is also affected by the on_player_creation() function.
- Added an event folder for custom events, including a working example
- Expanded the example commands and parents to include the changes to how they should be initialized.
- Added an optional ansi scheme (not active by default)
2009-04-25 20:51:12 +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
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
a7ba0d0feb Adding example command module. 2009-01-27 16:34:21 +00:00
Greg Taylor
f0f31a9a69 Finish cleaning up the script stuff. Added a README to the base parents directory warning not to modify the classes there. 2008-12-15 05:58:32 +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
Greg Taylor
00297d336a Big change here is that you now either need to run manage.py (with or without arguments) in order to create your settings.py file when doing initial setup. Or creating it works too.
Also get ready to start separating things out into the new game directory.
2008-12-15 04:56:47 +00:00
Greg Taylor
5249f27074 Things should be working again, minus the web stuff. 2008-12-15 04:35:00 +00:00