CMDEdit |
(Command Editor)
How to create a command: 1) First you must write the code for the command and insert it in the appropriate module. (act_comm.c for channels, act_info.c for informational commands). Normally by convention it is named do_something(). 2) Add a declaration for the command to the command.h header file. i.e. COMMAND(do_something). 3) Run ‘make clean’ and then ‘make’. Until there are no errors of course. 4) Reoot the mud via shutdown & startup OR copyover. 5) Enter CMDEdit new something to
add the new command.
Beginning notes:
Command editing:
To create the create command from within
the cmdeditor
Name:
The name will change the name of the command
(flee, shout, etc.)
Function:
This is the name of the C function that
will called to execute the command. The default for a new command
is do_nothing, which of course does nothing. The function must exist
– see above. If it doesn’t exist it will tell you. Multiple
commands may be assigned to the same function (see - say and ‘).
Level:
This will determine the mininum level a
player must be at to use the command.
Position:
This is the minimum position a player must
be in to use the command. For help on valid positions type ‘? Position’.
Use the long name of the position not the short name. The lowest
position is dead and the highest is standing. Most commands should
fall between sleep and standing. Position fighting is special.
It means the command can only be executed while fighting. Information
commands like WHO are normally sleeping. Observation commands like
LOOK are normally resting. Object manipulation commands are usually
resting or higher.
Log:
This is whether the command will be logged
to the mud logfile or not. For help on log flags type ‘? log’.
Show:
NOTE that this is a new feature and not completely implemented yet. It is intended that a second argument parameter passed to the COMMANDS command which will show commands in that category. Already existing commands (prior to OLC 2.0) have been set to ‘undef’. Setting show to anything but none will make it appear in the COMMANDS list. |
|
| page
created by:
Siouxsie and Antilochos of Lunar Eclipse © 2000, 2001 |
Back to Top of Page |