Using Command Files
This section describes the creation and use of the Command Files.
Basic Command File Creation
The Command File itself is just a text file with the extension
".CMC". They are generally edited with the CM Editor, but really
any plain-text editor could be used. To create a new Command File
or to use an existing Command File, you just need to tell the
GUI which file you want to use. If the file exists, it will be used.
If it doesn't exist, a blank file with the right name will be created.
Command Files are usually named for the game itself, it's not necessary
that it match the map name as it is with CMS files. The extension must
be ".CMC" and the file must be located in the same folder as any maps
that references it. The CMC files are edited using the
Control Manager Editor.
Once the file has been created, you need to enter the commands. The
CM Editor is used to do this. See the sections on the CM Editor
and Editing CMC Files for more info on the mechanics of using
the editor.
The Command File is simply a list of Command Names with the actual
characters necessary to implement that command (the Command Definition)
next to it. For example, suppose we had a game that use "g" for landing
gear down, "G" for landing gear up, "f" for Flaps extend, and "F" for
Flaps retract. A Command File to define these commands might look like
this:
LandingGearDown g
LandingGearUp G
FlapsExtend f
FlapsRetract F
The Command Name starts in the first column and extends to the
first space or tab character. Everything beyond that is the command
definition. You can put as many spaces as you want to between the
name and the definition, it's just ignored.
Multiple-Character Commands
The definition can be more than a single character if necessary. For
example, if you wanted to create a command called "ChaffAndFlares" and
the command for "Chaff" was "c", that for "Flares" was "f", a Command
Definition might look like this:
ChaffAndFlares c f c f c f
which alternately drop three sets of chaff and flares automatically.
Command Anomalies
Another place in which the Command Files can be quite useful is in
remembering the little anomalies that show up with some commands. For
instance, suppose there was a command for "LandingGearToggle" where
clicking it once would drop the gear, clicking it again would raise the
gear. The definition might look like this:
LandingGearToggle g
That would work, but the since the "g" is a single character it would
repeat automatically. This could be a problem if you inadvertently held
the key down too long, you might end up with the gear going down and
then coming right back up. What you really want is that the "g" get send
only one time. If you define the command as:
LandingGearToggle NULL g
then the NULL will be automatically included when you use the command
and you needn't worry about remembering to enter it in the GUI as
"NULL LandingGearToggle" each time. Basically, you can put anything in
the command definition that you could put in the edit boxes themselves
under earlier versions.
Inserting Command Names into the Map
To enter the command name, you can type it in but since the names are
sometimes long or not easily remembered, there is an easier way.
Right-click on the edit box that you want to put the command in
(Normal Press, Shifted Press, etc.) The right-click menu will popup
and you'll see a selection there to "Insert Command". Pick that
and you'll get a dialog something like the Keystroke Recorder
that lists all the command names in the current command
definition file. Double-click the one you want, or highlight it
and click "Okay". The dialog will disappear and the command name
will show up in the box you right-clicked to begin the whole
process. Commands that have been used will have a yellow checkmark
next to them so you can tell at a glance which commands have already
been used.