Jump to content
Sign in to follow this  
katipo66

Trigger condition: faction x kills (number) of faction y

Recommended Posts

I believe I have seen this somewhere but cannot find it or ask the right search question.

I want a trigger condition where for example west kills a certain number of east to be true

Share this post


Link to post
Share on other sites

you need to use killed eventhandlers on every unit, and then add to a variable.

place this in init.sqf:

eastKilled  = 0;
westKilled = 0;

place this in all west and east units:

this addEventHandler ["killed", {
_dead = (side (_this select 0));
_killer = (side (_this select 1));
if (_dead == west AND _killer == east) then {
	westKilled = westKilled + 1;
	publicVariable "westKilled";
};
if (_dead == east AND _killer == west) then {
	eastKilled = eastKilled + 1;
	publicVariable "eastKilled";
};
}];

end trigger condition:

eastKilled > 10

on act:

hint "more than 10 east have been killed by west units, west wins";

Share this post


Link to post
Share on other sites

do you actually want kill counts from units or just a quick trigger for number of opfor units dead?

if so you can try:

AllOpfor = [];
AllBlufor = [];
{
   if (side _x == EAST) then {
        AllOpfor = AllOpfor + [_x]
   };
   if (side _x == WEST) then {
        AllBlufor = AllBlufor + [_x]
   };
} foreach allUnits

then lets say you want trigger to activate when 3/4 of Opfor are dead:

OrigOpforCount = AllOpfor;
OrigBluforCount = AllBlufor;
while {(count AllOpfor) < (AllOpfor / 4)} do
{if (!alive _x) then {AllOpfor = AllOpfor - [_x]}; sleep 0.3} foreach AllOpfor;
sleep 0.5
};

Not the greatest approach, but works

Share this post


Link to post
Share on other sites

I have seize triggers for east/west setup with multiple conditions including the presence of a waypoint marker inside the triggers - this all working, what i want is for there to be some engagement inside the trigger before it activates and marker moves to new set off seize triggers

Edited by Katipo66

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×