Lunar
Eclipse
OLC
Menu

OLC Main

AEdit

REdit

OEdit

MEdit

CMDEdit

RAEdit

HEdit

CEdit

Resets

Builders
Application

Lunar Eclipse
Main Page

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:
· When you are in the editor, hitting ENTER or DISPLAY will display the current command you are working on.  Type DONE to exit the editor.  Unlike the other editors the SHOW has a special meaning.  See below.
· When you are finished making changes to a command, type SAVE before you exit the editor.
· Typing COMMANDS within the cmdeditor shows you the list of valid options.
· Typing DELETE <command name> will delete the command and exit the editor. CAREFUL!
· Typing LIST will show a list of commands or functions implemented.  Syntax is list [commands/functions] [level min] [level max]  The level ranges are optional.  Ex. ‘list commands 102 110’ shows all commands for imms.
 

Command editing:
Syntax: cmdedit <an existing comnand> or
               cmdedit create <a new command>
Example: cmdedit shout
                   cmdedit create stats

To create the create command from within the cmdeditor
you can use ‘create <command name>’ while in cmdeditor.
Syntax: create <command name>
Example: create stats
 

Name:
Syntax: name <command name>
Example: name shout

The name will change the name of the command (flee, shout, etc.)
 

Function:
Syntax: function <function name>
Example: function do_flee

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:
Syntax: level <number>
Example: level 5

This will determine the mininum level a player must be at to use the command.
 

Position:
Syntax: position <position name>
Example: position sleeping

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:
Syntax: log <log flag>
Example: log log_normal

This is whether the command will be logged to the mud logfile or not.  For help on log flags type ‘? log’. 
log_normal means the command will only be logged if the character is being logged, log_always means the command is always logged, and log_never means the command is never logged.  Most non-imm commands will be log_normal.
 

Show:
This determines what list the command will be shown in when a player uses the COMMANDS command for a list of commands. 
Typing ‘? Show’ will display a list of valid categories.  By default show is set to ‘none’ for new commands, meaning they will not appear in the commands list until this is changed. 
 

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