Forum Jump :

Author Message


Posts: 24
Rank:


Level: Member

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

 
#1 Posted at 2013-08-29 12:20        
     
I'm trying to set up a mission in which waves attack a settlement from different directions. The issue i am having is finding a trigger that is activated once a wave has been defeated (i.e all enemy units from that specific wave are killed). Anyone know of any scripts/ways of doing this? I know of the !alive but don't really want to have to input 30/40 unit names into the trigger condition if possible..


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#2 Posted at 2013-08-29 12:53        
     
then use a trigger that covers the area that has to be clean
check for all opfor units in the trigger if they are alive


Advertisement


Author Message


Posts: 24
Rank:


Level: Member

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

 
#3 Posted at 2013-08-29 13:19        
     
I suppose but that means the trigger would have to cover the enemies approach, assault and end phase of their assault, which is difficult using the square/oval trigger zones. Ideally i'd like a trigger where you could link units to, that would trigger when the linked units are killed, is that possible?


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#4 Posted at 2013-08-29 13:35        
     
yes, with names :D
but you might to group one wave and then instead of using names you only check the group
wave1 = group this;
init of groupleader of first wave
wave = 1;
in init.sqf


Author Message


Posts: 24
Rank:


Level: Member

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

 
#5 Posted at 2013-08-29 13:44        
     
Perfect :) thank you!


Author Message


Posts: 333
Rank:


Level: Member

Country: de
Location:
Occupation: Student
Age: 28
In-game name:

 
#6 Posted at 2013-08-29 13:46        
     
and then run this script from init.sqf:
_active = true;
while {_active} do
{
	if (wave == 5) then//means a maximum number of waves is 4
	{
		_active = false;
	}
	else
	{
		_countAlive = 0;
		_actualEnemyGroup = missionNamespace getVariable [format["wave%1", wave], 1];
		{
			if (alive _x) then
			{
				_countAlive = _countAlive + 1;
			};
		}
		forEach (units _actualEnemyGroup);
		if (_countAlive == 0) then
		{
			wave = wave + 1;
		};
	};
	sleep 1;
};
sleep ((random 5)+5);
["end1", true, true] call BIS_fnc_endMission;