In my previous post, in order to get accurate measurements of how far an SCV travels over very small time intervals, I used some of the programming features of the map editor. This post will not go over the basics of creating a map, but it will give most of the details of the map I created so that the experiment can be reproduced. There are many YouTube videos that can help with learning how to use the map editor, but I found the following channel particularly useful: GalaxyEditorTutorial.
The map we will create will allow the player to order an SCV to move between two predefined points by pressing a keyboard key. The map will also include a timer and a list box, and will be programmed to print the relative position of the SCV into the list box every 0.0625 game seconds. Here is an overview of the steps needed to create the map:
- Create two points with a distance of 4 grids between them.
- Create global timer and list box variables.
- Create an SCV positioned at the first point, angled toward the second point.
- Create a trigger to initialize the timer and list box.
- Create a trigger that will order the SCV to move to the second point and will also calculate the distance from the first point every 0.0625 game seconds (one game tick).
The first step is to setup the map with two points with a distance of 4 grids and an SCV at the first point.
Next create global variables for the dialog, list box, and timer.
All new maps start with a Melee Initialization trigger, which contain actions that are not useful for this type of map. First delete those actions and add the following actions to initialize the global variables.
Finally, the last trigger is activated by the user pressing the 0 key. This trigger first orders the SCV to move to the second point. The rest of the actions consist of pairs of wait and print commands. Each wait command forces the trigger to wait another game tick. Each print command calculates the distance of the SCV from the first point and adds the value to the list box.
Finally this map can be run by dragging the map file onto the SC2 launcher desktop icon. After the user presses the 0 button, the distances will be displayed in the list box.