Jump to content
Sign in to follow this  
mia389

End trigger help

Recommended Posts

Im trying to figure out a way for my end trigger.

Here is what I am doing. There is a very large boarder going all the way across the bottom of Takistan. I have multiple triggers on it, all with the same ON ACT.

(({isplayer _x && alive _x} count playableunits) == (count thislist)) && taskCompleted taskAAcamp3 AND taskCompleted taskAAcamp4 AND taskCompleted taskAAcamp2 AND taskCompleted taskAAcamp1

Its a count down trigger that when activated will trigger my end trigger. So when all objectives are complete, and all players are in the trigger it counts down 2 minutes then mission end trigger activates.

My problem comes with the multiple trigggers. When a couple of guys are in a different trigger with same ACT it wont work of course. I cant put one big one because my border is not strait. :-( Need some help with this one

Share this post


Link to post
Share on other sites

So the players have to finish all the objectives, then leave the area, then wait 2 minutes for the mission to end?

Why not just end it two minutes after the objectives are complete? Or even 20 seconds really, why the long wait when there's nothing to do?

You might also have one trigger that checks all the objectives, then have your side border triggers check if that one was activated and just check if players are in the zone?

Share this post


Link to post
Share on other sites

sorry I wrote garbage first...

what I think you need is this: You want to check that all the men who are alive are in either of the zones. This can be done like so:

Each zone trigger should be:

REPEAT,

BLUFOR, PRESENT, (or whatever condition)

trigger_zone_X = thislist

where X is a number for each trigger.

Then a master trigger Condition could look like so:

men = units group1 + units group2; living = {alive _x} count men; {_x in trigger_zone_1 or _x in trigger_zone_2 .........} count men == living;

where groupX is each group that you might have which can be defined in the init field of each squad leader like so:

group1 = group this;

etc.

hope that helps.

Edited by wamingo

Share this post


Link to post
Share on other sites

You might replace 'thislist' with 'list triggerobj or list triggerobj2' etc. Not very pretty, but I think that's what you mean by your problem being people in different triggers.

Share this post


Link to post
Share on other sites

Yep, it would then look something like this:

(({isplayer _x && alive _x} count playableunits) == ({alive _x} count (list trig1 + list trig2 + list trig3))) && taskCompleted taskAAcamp3 AND taskCompleted taskAAcamp4 AND taskCompleted taskAAcamp2 AND taskCompleted taskAAcamp1

Share this post


Link to post
Share on other sites

You guys rock! Thank you much.

Share this post


Link to post
Share on other sites

Does isPlayer only work in MP? I'm trying this in the init to create an array of the human players

if (isserver) then
{
Player_array = [];
{
	[color="Red"]if (alive _x) && (isPlayer _x) then[/color]
	{
		Player_array = Player_array + [_x];
	};
} forEach [unit1,Unit2...];

};

but it isn't working. I normally use this method to create arrays of AI units (minus the isPlayer part obviously), and it always works fine. At the moment, all I need it for is to fire a trigger when all human players are present and a variable is true (AI will most likely be present in the trigger as well).

Assuming it is MP, would this work?

(({isplayer _x && alive _x} count playableunits) == ({isplayer _x && alive _x} count (list MyTrigger))) && MyVariable

Or is there an alternative method that would work in both SP and MP?

EDIT

Huh, actually I just changed that red line up there to if ((alive _x) && (isPlayer _x)) then and it seems to work now. I knew it would be something stupid!

Edited by 2nd Ranger

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  

×