Forum Jump :

Author Message


Posts: 24
Rank:


Level: Member

Country: uk
Location: Warwickshire
Occupation: Student
Age: 25
In-game name:

 
#1 Posted at 2013-09-05 15:21        
     
Hi :)

I am wondering if there is some means of creating a trigger that fires once a certain percentage of the enemy units it is synced to have been killed, or, after a percentage of the enemy remains.

For example, an enemy rifle squad of 8 men attacks your position, the trigger telling them to retreat fires once 6/8 men have died or 2/8 are surviving.

Any help greatly appreciated!


Author Message


Posts: 48
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2013-09-05 17:43        
     
Name your group of attackers (group_attack = group this; in the group leader init), then in your trigger you can do something like that:

condition : ((count units group_attack) < 3)

If you want to do something less specific I recommend that you store the number of alive units in your group at the start of the mission in a variable.
Could look like this :

init.sqf
//arrayOfGroups = [group1, group2, group3...]; //could be useful with the loop thingy
nbUnitsGroup1 = count units group1; //there must be a way to do this with a loop using compile but I can't recall
nbUnitsGroup2 = count units group2; //there must be a way to do this with a loop using compile but I can't recall
...

then in a your triggers
condition : ((count units group1 * whateverPercentageYouWant) < nbUnitsGroup1)


Advertisement


Author Message


Posts: 24
Rank:


Level: Member

Country: uk
Location: Warwickshire
Occupation: Student
Age: 25
In-game name:

 
#3 Posted at 2013-09-05 20:00        
     
Thats exactly what i was after! thank you :)