Welcome to The Few Good Men

Thanks for visiting our club and having a look around, there is a lot to see. Why not consider becoming a member?

Simple How to end your mission

B

Breaklight

Guest
From POS:

Simple question- How can I make my home-made missions end?
I know it's something to do with 'triggers' and 'scripts' but I haven't a clue where to begin.
Do I have to somehow go into the game coding and type a line of jibberish in there?
For example a good ending would be when all enemy units are killed.
Also I'd like to put a time limit on all my missions to make them automatically end after say half an hour, or an hour etc, how do I do that?
(I've glanced at the script links but they're a mystery to me)

To answer this question, I'm going to put together a simple mission and take you through the steps i did to achieve it.

Hopefully with this visual show-how, you'll be able to grasp the basics and get started.
This is the easiest method and does'nt involve difficult scripting etc.

First off, I open the mission editor and place my player.
In this case a US Javelin soldier.
Note: That i have given the soldier the name "p1". Its a good habit to give player and enemy characters names. Short and simply as later on, as you get to grasps with scripts and triggers you are going to need to refer to them. And this you do by calling them by the name you give them. In this case its player One, and i use the abbreviation "p1".

arma2OA2011-01-1819-12-46-02.jpg

Next I have added a single enemy soldier.
Note: That again i have given it a simple and easy name, in this case "eny1".
Also interesting are the Special and Control boxes.

Control
Defines who controls the entity. This option is not available for Game Logic or Empty side objects. All non-player controlled units will be controlled by AI. If the selected object is a vehicles, extra options will become available.

1: Non playable - Self explanatory.
2: Player (as vehicle position) - This unit will be controlled in single player mode. There can only be one Player controlled unit on the map. The player's unit is marked by a red circular icon.
3: Playable (as vehicle position(s)) - Is used to define units that may be player controlled in multiplayer mode, and are available via Team Switch in single player mode.
Playable units are marked by a magenta circular icon.Players joining your game are then able in the lobby to select this position as their character.

Special

Defines special placement options for the starting position for the unit at the very beginning of a mission. If the unit is part of a group, default AI behaviour will make it try to return to formation as soon as the mission begins.

None - If you wish the unit to begin the mission out of formation, choose 'None' from this list. It will start the mission at it's location in the mission editor.
{{This what you probably where looking for POS in your first mission, with all those trucks}}

In Cargo - If the unit's group possess a vehicle with empty cargo spaces, choosing "In Cargo" will place the unit in one of those cargo spaces. If no cargo seats are available, it will start at it's location in the mission editor as it would if it's special setting was None.

Flying - Aircraft units will begin the mission in the air, and in formation around the group leader irrespective of the unit's map position. If the unit can not fly, it will begin the mission as it would if it were In Formation.

In Formation - The unit will begin in formation around the group leader, irrespective of the unit's position in the mission editor.

arma2OA2011-01-1819-12-55-69.jpg

Next, at the bottom of the map I have added a group of three soldiers, nameing them respectively eny2, eny3 and eny4.

To read more about the options you have in the placement unit box see here!

I now have all characters in place. I now need to create the triggers.
When i kill the single enemy soldier, i want the game to end.
I do this by adding a Trigger.

arma2OA2011-01-1819-13-51-95.jpg

Note that i have made the size on axis A and B 0. Thats because this trigger doesnt need to be activated by a unit or player passing thru it. And to keep the clutter down especailly by larger more complex missions

Next i have made the trigger be activated by Opfor. Thats because it is an Opfor unit which returns the variable (Variable being is unit eny1 alive yes/no)
So if you wanted to do this for a Blufor unit you would make it activated by Blufor.

Next make Type into end#1. You will see that you have several options, this is to accompany for missions where different endings are possibly.

The text box i have entered a name telling me what the trigger does. As this text name appears in the editor only and helps me to quickly identify all my triggers

And the most important the condition box.
Here you need to enter the condition that needs to be meet for the trigger to be activated! In this case our variable, is eny1 alive or dead?
(!alive [name of your unit here])
How it works. The computer thruogh out the game will every 0.5 second or so check to see if unit "eny1" is alive. When the return comes that the unit is dead, the trigger is activated and thus activates end of mission

Can you see the connection of giving simple names to the units you place?
(at least the units of importance or influence to your mission)


But, what if we have a group of enemy like at the bottom?
Then the solution can be

arma2OA2011-01-1819-13-58-10.jpg

As you can see, all i have done is add the names of the other units.
eny2, eny3 and eny4 in the condition box.
Now the computer will every 0.5 seconds check if all these units are alive.
If all are dead then the trigger will fire.
The trigger wont fire if only eny2 and eny3 are dead

(!alive [unit name]) && (!alive [unit name])​

You can also make a group ID and set that as the variable. So when the group is dead the trigger will fire but i'm not shure how to do this


Follow these simply steps to add the trigger option to your objectives
(ie kill the tank at... or elimate the enemy patrol) and you have your simply and effective mission ending.
 
After all this is done your editor screen will look something like this :

arma2OA2011-01-1819-12-40-79.jpg

1: Your time triggers (see thread here)
2: Your end mission triggers activated by death of enemy soldiers
3: Single enemy solder
4: group of three enemy soldiers
 
To view this example mission i made download the attachment.
Unzip and place it in your arma2 profile mission folder.
For me thats

C:\Users\Breaklight\Documents\ArmA 2\missions

Load up arma2 and then the editor. Choose the desert map and you should see
Endmission when you select load and scroll the options down.

View attachment endmission.Desert_E.rar
 
Ok mate thanks again, I just made another Editor test mission and it worked fine, the game ended when I shot him..:)
 
Back
Top