The mission will simulate a reconnaissance flight of an American fighter jet over German territory. The player will have to fly over several key points.
Creating the mission
Open the editor, go to Project -> OpenProject and open the Bulge map. Go to the Mission Editor tab in the editor’s main toolbar. Find the ‘Create New Mission’ button and press it to create a new mission.
To open the mission’s properties window, press the ‘Properties and Trigger/Mission Objective Inforamation button. In the window that opens, open the ‘Mission Settings’ section, then find and open the ‘stars’ section in it, which is responsible for the mission’s time and date. Set the mission date to January 1st 1945 at 10 o’clock in the morning. To do this, you must change the values of the fields ‘year’, setting it to 1945; ‘month’, setting it to ‘1’, the first month; ‘day’, setting it to ‘1’, the first day; and ‘time’, setting it to ‘10’, which corresponds to 10 in the morning. Close the ‘stars’ section.
Find and open the ‘mission’ section. In the ‘name’ field, enter a name for the mission in English. Set ‘level’ to ‘bulge’ to make this location load for the player when the mission starts. Set the mission’s ‘type’ to ‘singleMission’, since that’s the kind of mission we want to make. The ‘restoreType’ field must be set to ‘attempts’ if you want the player to have multiple attempts to complete the mission. If you plan to give the player several airplanes to command, set this variable to ‘tactical control’, in which case the player will move to the next airplane in the squad after dying. The ‘campaign’ variable must be set at ‘western’, which will allow the mission to appear in the ‘Western Military Campaign’ section. In the ‘environment’ field, choose which type of sky you want the mission to have (choose a sky type that corresponds to the mission time you set earlier). In the ‘weather’ field, choose the type of weather you like best.
Creating a player airplane
Using the ‘Create unit’ button located in the ‘Mission Editor’ tab in the editor’s main toolbar, first making sure that the field to the right of this button is set to the ‘armada’ type, create a player airplane and place it above one of the large roads on the map. Open the object properties menu by pressing the ‘Show/hide object props panel’ button. In the window that appears, change the ‘Name:’ field to ‘player’. Raise the airplane to 800 meters by changing the ‘Position’ parameter, which consists of three points: ‘player’s position on X axis’, ‘player’s position on Y axis’ (height), ‘player’s position on Z axis’. In the ‘Class’ field, choose the type of airplane the player will fly: ‘p-39q_5’. For its armament, set the ‘Weapon’ field to ‘p_39q_5_default’. Open the ‘Properties’ section and find the ‘army’ field in its window. Set the army index value to 1. Below, in the ‘count’ field, set the value to 2. This will ensure that when the mission is launched, the enemy will have an AI-controlled opponent. Next press the ‘+ numInWing’ button and set the value to 2. This will allow the player’s squad to group up by twos. Now open the mission properties window again using the ‘Properties and Trigger/Mission Obj. Info’ button, find the ‘player_teamA’ section, open it and press the button next to the ‘wing’ field. In the resulting window, choose the player’s airplane. You just let the game know which airplane should be the player’s. Save the mission using the ‘Save mission’ button and launch it using the ‘Run mission’ button to make sure everything was done properly.
Placing travel waypoints
Find a large road near the player’s airplane. Using the ‘Create point zone’ located in the ‘Mission Editor’ tab on the editor’s main toolbar, create a zone in the shape of a point above the road. Select it and change the name to ‘waypoint01’, just like you changed the name of the player’s airplane. Create 8 more of these zones with the names ‘waypoint02’–’waypoint09’, placing them along the road several kilometers apart. Place the zones so that they are 200-300 meters above the road and raise only the last zone by one and a half to two kilometers.
Assigning a task to fly along the route
For the entire mission, we’ll have only one task: “fly along the route”. To add it, you must create a text document with the same name as the file in which you saved the mission, but with the extension ‘.csv’. Open this file using notepad and save it with UTF-8 encoding. Now add a line to this file:
"follow_to_waypoints";"Follow to checkpoints"
and save the file again. The line you added consists of three parts, each in quotation marks and divided by a semicolon. The first part, "follow_to_waypoints" is the task’s unique identifier. There shouldn’t be a second identifier with the same name in the same file. The second part—"Follow the checkpoints"—is the text of the task in English.
Now return to the game’s editor and use the ‘Properties and Trigger/Mission Obj. Info’ button to open the mission properties window. Find the ‘Triggers / Mission Ob. Navigation’ section. At the bottom of this section, you’ll see a row of buttons. Click ‘Mission Obj’ and select ‘abstractionMissionObjective’ in the resulting window. You’ll create a new mission objective. Select the mission objective you just made and change its name in the window on the right to the name of the identifier from the text file without quotation marks: follow_to_waypoints. Save the mission and launch it. Make sure that you receive the mission task at the start of the mission.
Initial waypoint task
To show the player where to fly to, you need to somehow highlight the route waypoint he has to reach. TO do this, go to the ‘Triggers / Mission Ob. Navigation’ section and press the ‘Trigger’ button to create a trigger. It is the triggers that will provide all the mission’s logic. Select the trigger you just created and in the window on the right, change its ‘Name:’ to ‘mission_start’. Under the trigger’s name, you can see the field ‘Enabled’ with a checkbox ticked. This means that the trigger will be active as soon as the mission begins. Lower down in the same window, you can see the ‘Elements’ field, which contains three empty trees: ‘Events’, which define when the trigger tries to fulfill itself; ‘Conditions’, which define which completion checks there are for the trigger; and ‘Actions’, which define what exactly takes place in the trigger. Right now, the event ‘periodicEvent’ is in the ‘Events’ tree. Select it and press the ‘Delete’ button located below the ‘Elements’ field to delete it. Now press the ‘Event’ button to add a new event. In the resulting window of available events, select ‘initMission’. Now this trigger will try to complete right after the mission begins. We don’t need any conditions to check for trigger completion, so just add a new command by clicking the ‘Action’ button. In the resulting window, select ‘missionMarkAsWaypoint’ and give it the parameters:
- In the ‘target’ field, choose the first route waypoint the player needs to fly through—‘waypoint01’.
- Tick the box next to the ‘visible’ field. This will display the waypoint on the game screen and in the map.
- Tick the box next to the ‘primary’ field. This will mark the waypoint for the player as the route’s primary waypoint.
Save the mission, launch it and check that everything is working as it should.
Checking whether the initial waypoint has been reached
Now we must check whether the player has reached the first route waypoint so that we can hide the first point, mark the second point as the primary one and show the third point. To do this, create a new trigger and call it ‘to_waypoint02’. Leave ‘Enabled’ ticked to make the check begin as soon as the mission starts. In the ‘Events’ list, leave the ‘periodicEvent’ event, since a check for the trigger being launched once per second suits. This allows us to check whether the waypoint has been reached once per second. In contrast to the previous trigger, we’ll need to add a completion condition to make sure the trigger activates only if the player approaches the waypoint. To do this, press the ‘Condition’ button and choose ‘playerDistanceBetween’ in the resulting window, filling in the fields:
- In the ‘target’ field, indicate the point towards which you need to detect an approach. This will be ‘waypoint01’.
- In the ‘value’ field, indicate the distance to which the point must be approached, for example ‘750’ meters.
- Leave the ‘math’ field set to ‘2d’, to make it so that it doesn’t matter which axis the check is performed on.
- Leave the other fields as they are. We’ll go into them in more detail in other examples
Now that we’ve provided a condition for the mission’s completion, let’s create a set of commands that must be fulfilled. The first command will be to disable the display of the waypoint the player reaches. To add this command, press the ‘Action’ button and in the resulting list, select ‘missionMarkAsWaypoint’ with the parameters:
- In the ‘target’ field, choose the waypoint the player has reached: ‘waypoint01’.
- Tick the box next to the ‘visible’ field. This will display the waypoint on the game screen and in the map.
Now let’s show the player the next waypoint. To do this, add a ‘missionMarkAsWaypoint’ command and give it the parameters:
- In the ‘target’ field, choose the first route waypoint the player needs to fly through—‘waypoint01’.
- Tick the box next to the ‘visible’ field. This will display the waypoint on the game screen and in the map.
- Tick the box next to the ‘primary’ field. This will mark the waypoint for the player as the route’s primary waypoint.
Save the mission, launch it and check that everything is working as it should.
Indicating subsequent waypoints
Create additional triggers with the names ‘to_waypoint03’–’to_waypoint09’ in a similar way to the previous one, but remove the tick next to ‘Enabled’ (located right below the trigger’s name) for all of them. This will prevent the triggers from activating as soon as the mission begins. Name the trigger leading to the last waypoint ‘to_the_end’. Now let’s activate the triggers as the player advances along the route. To do this, add a new command to the ‘to_waypoint02’ trigger: ‘triggerEnable’. Set the next trigger in the list as the ‘target’: ‘to_waypoint03’. Configure each subsequent trigger in the same way, each with the next trigger as its target. There’s no need in this case to disable the triggers you’ve already configured, as they work strictly one after another for us, and turn off on their own after completing all their commands. Add a ‘triggerEnable’ command with the correct ‘target’ to all the remaining triggers apart from the last one, called ‘to_the_end’. Save the mission and launch it to make sure everything is working correctly.
Completing the task of flying along the route
Now let’s go to the final trigger—‘to_the_end’—and add a command to it which will mark the task as completed. To do this, select ‘moSetObjectiveStatus’ from the list of commands. Set its ‘target’ to the task with the identifier ‘follow_to_waypoints’ and set its ‘status’ to ‘2’, which means the task is complete.
Ending the mission
In the ‘to_the_end’ trigger, add a ‘wait’ command, changing its ‘time’ value to ‘3’ seconds. This is done so that a little time passes between the announcement that the task is complete and the subsequent announcement of the mission’s end, rather than having the two messages come at the same time. Now add a ‘missionCompleted’ command. Save the mission and launch it to make sure everything was done correctly.
Placing anti-air batteries
Now let’s liven up the mission a little by making it harder. To do this, let’s place some anti-air batteries along the player’s path. Click the ‘Create unit’ button located in the ‘Mission Editor’ tab on the main toolbar, first making sure that the field to the right is set to ‘air_defence’. Place six batteries along the player’s path. Change the names of the anti-air batteries to something that will make it clear what they are and whose side they’re on. For example, ‘germ_air_def01’—‘germ_air_def06’. For each weapon, you must fill in the ‘class’ field, selecting ‘germ_20mm_flak38’ from the list, and set their ‘army’ field to 2 (for the player and his allies, this field must be set to 1). Save and launch the mission and make sure that the enemy anti-air batteries shoot at you when you fly past.
Placing tanks
Since the player is flying relatively low and can see objects on the ground well, let’s place a few German tanks on the straight part of the road, right between the ‘waypoint03’ and ‘waypoint04’ points, and make them drive along the road. To do this, click the ‘Create unit’ button, after first making sure that the field to the right is set to ‘tracked_vehicles’, and place a tank on the road. Change the tank’s name to ‘germ_tanks01’. In the ‘Class’ field, enter ‘germ_tiger1’, set ‘army’ to 2 and ‘count’ to 10.
Defining the movement path for tanks
To give the tanks a movement trajectory, you must define some key points. To do this, click the ‘Create waypoint’ button and indicate the places on the map where you want the tanks to drive through. After setting some key points, select the tank. In the tank properties window, find the ‘Waypoints’ field which contains a list of all the waypoints assigned to the tank. Select these waypoints in turn in this window and use your mouse wheel to scroll the tank properties window to the very bottom, to the ‘Waypoint Props’ section. Change the ‘speed’ parameter inside it to 0. Do this for all the tank’s waypoints. This way, we prevent the tank from moving from point to point. This means that it won’t leave the player’s path before it should.
Enabling tank movement
When the player reaches ‘waypoint03’, he’ll be able to see the tanks on the ground. Let’s make them start moving at that moment, so that the player has the illusion of seeing tanks on the move. To do this, go to the ‘to_waypoint04’ trigger and add a new ‘unitSetProperties’ command to it, filling in its fields in the following way:
- set the ‘object’ field to ‘germ_tanks01’.
- click the ‘+ speed’ button located below, and enter a speed of 20 in the resulting field.
Now the tanks will start moving along their route when the player reaches the waypoint called ‘waypoint03’.
Placing enemy fighters
Let’s make life even harder for the player by setting up a date in the middle of the route with jet-powered German Me-262 fighters. To do this, use the ‘Create unit’ button after making sure that the field to the right is set to ‘armada’, and place an enemy airplane next to one of the waypoints at a height of roughly 2 kilometers. Change the name to ‘germ_fighters’. Set the airplane type to ‘me-2662a-a1’, give it default weaponry, set the ‘army’ field to 2, the airplane ‘count’ to 2, and ‘numInWing’ to 2 as well.
Putting the enemy fighters to sleep
Since the idea is for the enemy fighters to attack the player only in the middle of the router, we must temporarily put them to sleep. To do this, go to the ‘mission_start’ trigger, which is fulfilled as soon as the mission begins, and add the command: ‘unitPutToSleep’, setting ‘target’ to ‘germ_fighters’.
Waking up the enemy fighters
When the player reaches the middle of the route, i.e. the waypoints at which we placed the German fighters, we’ll need to wake up those fighters. To do this, go to the ‘to_waypoint06’ trigger and add a ‘unitWakeUp’ command to it. Set ‘target’ to ‘enemy_fighters’.
Attacking the player’s airplane with the enemy fighters
The enemy fighters have woken up and it’s time to sic them on the player. To do this, add a new ‘unitAttackTarget’ command to ‘to_waypoint06’, giving it the following parameters:
- in the ‘object’ field, select the German fighters—‘germ_fighters’.
- in the ‘target’ field, select ‘player’.
- find the ‘fireRandom’ field, add it and tick its box so the enemy fighters will choose their targets at random from the player’s squadron rather than attacking the same target.
- find the ‘playerAttracted’ field, add it and tick its box, setting ‘playerAttractedCount to 1, so that at least one enemy fighter will always attack the player directly and not be distracted by other targets.
Save the mission and launch it for the final test