Now that we planned the mission, it is time to start developing! Let's start with the bulk of a mission, units; plenty of units! In order to place a unit, press F1 or select "Unit" on the right side (green button). Notice that the markers disappear, by pressing F6 or selecting "Markers", you can modify and display them.
We want to be able to preview the mission, to do so, doubleclick near the insertion marker. A Unit dialog (Image 1) will be opened, allowing you to select a unit to place on the map. Let's take a closer look at this dialog as it's one of the most important ones in the ArmA editor.
- Side- Select the side which the unit will be part of.
- Class- Select the class: armour/man/object etc.
- Control- Select whether the unit is AI, human or playable as human (used in MP and SP to add switchable characters)
- Info age- If a unit is known, it is - unlike in OFP - not shown on the player's map. The AI will react according to the knowledge level of enemy units, and it will also depend on how old the info is.
- Vehicle lock- Usable for a vehicle, determines if a vehicle can be entered or not.
- Rank- Determine who gets command of a group, and who is second in command etc. The more high ranking units, the better the group's morale.
- Unit- Select which type of unit you place.
- Special- In formation: unit starts in formation, In Cargo: if grouped with a vehicle the unit starts in cargo, Flying: an air unit will start in the air.
- Name- Used to give the unit commands in scripts by refering to their name. Should be unique.
Note: it creates a global variable with the name you place here. Except for player, as the player variable always exists in missions. But the player variable doesn't exit in outro's nor in intro's. Instead of the name field, you can use: varname = this. To name a unit.
- Skill- Determine AI skill level.
Note: the skill of a unit when inside a vehicle is the skill of the vehicle. If an AI soldier gets into a vehicle, it will use the skill of the vehicle while inside the vehicle.
Note: adjust the skill wisely, because it directly affects the performance of ArmA. Always remember to set the skill of "cosmetic" and "eye-candy" units to 0.
- Initialization- Any code inside gets activated upon loading the mission.
Note: the code present here is executed (in most cases) before any code present in the init.sqs and/or init.sqf.
- Description- Usable for MP. Give info about a unit which is displayed in the lobby (MP).
- Health/armor- Select the % of starting health/armor. Note that you can create a dead body by setting it to 0%.
Note: if you want to have a destroyed unit placed on the map from the beginning, but you don't want it to explode (for example, because it will kill soldiers nearby) do the following: set its ammo, fuel and health level to 0. If you don't the unit will explode.
- Fuel- Select the fuel in a vehicle.
Note: this is the level of the vehicle itself, not the cargo level. A fuel truck will still be full of fuel for other vehicles even after having it's fuel set to 0. setFuelCargo, setAmmoCargo and setRepaircargo commands should be used to affect the level of cargo for these vehicles.
- Ammunition- Select the ammunition in a vehicle.
- Azimut- Determines the direction a unit faces.
- Probability of presence- If you want to add some randomness, use this to prevent a unit from appearing everytime. Standard at 100%.
Note: this is also used to switch sides (see Chapter 4: Groups).
- Condition of presence- Set condition required for unit to be placed.
- Placement radius- Random emplacement in the designated radius of used.
I suggest that you place a few enemy units inside the town, to make the player's life harder. What to place? An empty (side: empty) shilka named "tank", an enemy officer named "officer" and any number of soldiers which you want to have as opponents.
A few hints: holding LMB and SHIFT on a unit allows you to change its azimut. You can use CTRL+C and CTRL+V to copy and paste units. This allows for faster placement - note that you have to select a unit before being able to copy him.
You might notice a few blue lines connecting enemy soldiers upon placing individual soldiers (Image 2). This means that individual units are grouped, enabling them to exchange information about enemies etc. If you want to ungroup them, press F2 or select "groups", click on a unit and hold the mouse while drawing a line - release it on empty ground (Image 3).
In the right menu, note a button named "preview", click it to check the location of the enemy soldiers. You might want to move your character a bit closer to the town to prevent you from walking a minute every time you want to check the emplacement.
After playing a bit with the unit positions (Image 4), ungrouping all the enemies and checking the mission so far with the help of "preview", it is time to place a few objects on the map. Basically, you have already placed one, the empty shilka. We will now continue to place an enemy MG nest. Complete with sandbags and a MG ready to make your life harder!
Let's place the MG nest at the northern side of the fishing village, to make any direct approach a hard one. For some reason its icon is 180 degrees turned, we need to have the MG azimut at 0. Don't forget to switch the side to "East". We don't want to place an empty MG.
To protect the gunner, let's place a few sandbags around it (Image 5). To place them, select Side: "empty", Class: "objects", Unit: "wood fence". You can now copy and paste the sandbag element to add even more protection. I suggest placing four or five elements. You can change the azimut by typing in another number. Or, hold the LMB on a sandbag element, and hold SHIFT - then turn to change its azimut. You might have to "Preview" a few times in order to make the MG fit in the sandbag wall. Don't forget to make sure that the sandbags overlap each other a tiny bit to ensure maximum protection!
When you put the very first unit of a side on the map from the editor, that side is created. Meaning that if you don't place any unit of a particuar side in the map, the side will not exist and you won't be able to create any units for that side from any script unless you create the side first with createCenter. This is a quite common mistake when creating dynamic missions without units at the beginning on the map, so remember that: no units = no sides = no way to create groups for these sides, so you'll be forced to use createCenter to create sides first.
If you want to create all the units dynamically and you don't want to mess up with createCenter command, then you need to add a single unit of each side, if required, set presence to 0%. Just place them all in the same spot and in careless mode, so they'll not interfere with the mission.