Scenario scripts were introduced in version 1.0.36. They allow you to automate instructor actions and participant movements for a particular scenario. You as the designer can make as many scripts as you want, and during an exercise choose whichever script(s) you want to execute. Rather than having a single script for the whole exercise, we have found it better to make scripts tailored to specific needs, for example, one script to provide the overall scenario state changes for the exercise, another one to provide unit location initialization, and others to provide the twists you want to introduce in the exercise.
When you define a script that has actions dependent on a participant (such as moving a participant to a location), you are not locked into necessarily the same participant when you execute the script in later exercises. When you are running an exercise and choose to execute a script, CommandSim looks at all the specified units in the script and compares them to the current list of participants. If there is a discrepancy, CommandSim lets the instructor replace the participant name in the script with a participant currently in the exercise. In this way, you can make your scripts with participant names such as "First in Engine", and "First in Medic" rather than specific names. Then, when you run an exercise, you can match the First in Engine with the particular participant playing that role.
Creating a Script
There are two ways to create a scenario script:
- The easiest way to create a scenario script is to run an exercise (or go through the motions of running an exercise) and save the transcript. The transcript is in the same format that CommandSim uses to write a script. Here are the steps:
- Once you've run the exercise, or mock exercise, click on the File menu, and choose the item "Display Exercise Transcript"
- Enter the name of the script in the box at the top, then press GENERATE. CommandSim will display the transcript in XML format.
- Select all the text (either by clicking and dragging with your mouse, or pressing Ctrl+A), then copy it (press Ctrl+C).
- Open up a text editor (or even Notepad, which comes with Windows), and paste the text in (or press Ctrl+V). If you're using Notepad, make sure Word Wrap is OFF.
- Save the file with any name you choose, with the extension of xml (for example, myExercise.xml).
- You can edit or delete the information in the script as you choose.
- You can also create a scenario script from scratch. You'll need a text editor, or you can use Notepad, which comes with Windows (and similar tools come with Mac's).
See the article on Script Elements for detailed information about the contents of a script.
Using a Script
When you are running an exercise, you can click on the SCRIPTS panel title to open the panel:

In this panel, you will see the scripts associated with this scenario (to add associated scripts, use the SCRIPTS tab in the Scenario Designer tool). These scripts are not active until you select a script and press EXECUTE. You can preview the contents of a script by selecting one and pressing the PREVIEW button. The preview shows as follows:

When you press EXECUTE, the script elements are added to the timeline. There are two ways CommandSim can add a script, with respect to the timing specified in the script:
- Absolute Timing (RELATIVE TIMING box unchecked). The times given in the script are used exactly as they appear. In other words, if the script says to execute an action at 00:10:25, the action will be done at 10 minutes and 25 seconds according to the exercise clock (which you can start, stop, and reset). If a script action is added that has a time before the current clock, the action is performed immediately when the clock is running or re-starts.
- Relative Timing (RELATIVE TIMING box is checked). The times in the script are relative times to add the actions, relative to the current global clock. For example, if the time says 00:01:30, and RELATIVE TIMING is checked, and the current global time is 00:09:15, then the action will be added to the Timeline for execution at 00:10:45. You can see the difference between absolute and relative timing in the preview--relative timing has a + (plus) mark before the times.

Any participant names in the script that do not match current participant names are flagged by CommandSim, and you are presented with the opportunity to reassign script names to current participants:

The first drop-down list contains participant names from the script that are not currently in the exercise. The second drop-down list is a list of current participants. You select pairs consisting of one script participant name with one current participant, then press PAIR. The substitutions appear in the box below the lists. The substitutions do not occur immediately, rather, CommandSim assigns the pairings only when you press DONE. If you do not want to make the pairings, press CANCEL PAIRINGS.
CommandSim adds the script elements to the Timeline. If you have requested a substitution, that is performed when you press DONE (on the Pairing Panel). You can always use the SKIP STEP(S) button on the timeline with a selected step(s) to remove it from the timeline before it is executed.

If an action on the Timeline specifies a non-existent participant, the action is ignored and CommandSim generates a warning message in the Log.