Jump to content
Sign in to follow this  
amadman114

1 man alive trigger

Recommended Posts

Ello BIforums! ;)

I'm doing a PvP elimination mission, which means I want a trigger to activate when "the last man standing" is the only one left in the area.

There are 12 players in total. They are all on the same side (blufor), but not in the same squad.

I've tried the following with no luck

numW = 0; { numW = numW + ({ alive _x } count (crew _x))  } forEach thisList; (numW <= 1) and (time > 61);

and also

Make a trigger like this:

activation - bluefor

repeatedly

min-1 mid-1 max-1

then put your script in the DEACTIVATION part.

Make sure the trigger area covers the entire map.

The only problem you might have with that is if someone starts the game alone, they will trip the trigger and end it. Maybe set a ai in the map that dies after a couple min or something to stop that from happening.

Any ideas/workarounds you could think of?

Thanks

Share this post


Link to post
Share on other sites

blufor present

count thislist < 2

Won't that work fine for you?

Share this post


Link to post
Share on other sites

count thisList returns 1 if there is 5 units "inside" a vehicle, this below should solve both issues.

({(vehicle _x) in thisList} count playableUnits) < 2 AND ({isPlayer _x} count playableUnits) > 1

translation:

if player or player vehicle is inside trigger for all players total is less than 2 AND if there are more than 1 player in playableUnits list.

EDIT: if the check if more than 1 player (after the AND part) does not work, use a variable instead.

type this into init.sqf:

MoreThan1Player = false;

now create a new trigger, in condition use:

({isPlayer _x} count playableUnits) > 1

and in on act:

MoreThan1Player = true;

now in the main trigger, use this as a condition, then it will only be activated after there is atleast 2 players ingame, and less than 2 inside trigger area.

({(vehicle _x) in thisList} count playableUnits) < 2 AND MoreThan1Player

Edited by Demonized

Share this post


Link to post
Share on other sites

Thanks for the help, but I still cant get it to work, everything looks like it should though!

I tried "({(vehicle _x) in thisList} count playableUnits) < 2 AND time > 3" to see if that part of the script worked, but despite having 5 playable units on the field, the script instantly (after the 3 secs) activated :s

I tried the other way too

Edited by amadman114

Share this post


Link to post
Share on other sites
Thanks for the help, but I still cant get it to work, everything looks like it should though!

I tried "({(vehicle _x) in thisList} count playableUnits) < 2 AND time > 3" to see if that part of the script worked, but despite having 5 playable units on the field, the script instantly (after the 3 secs) activated :s

How is the trigger activated (ie by whom ?).

Share this post


Link to post
Share on other sites
Thanks for the help, but I still cant get it to work, everything looks like it should though!

I tried "({(vehicle _x) in thisList} count playableUnits) < 2 AND time > 3" to see if that part of the script worked, but despite having 5 playable units on the field, the script instantly (after the 3 secs) activated :s

I tried the other way too

playableUnits is empty in single player, i.e. the conditions are met in the editor.

My suggestion:

Activated: repeatedly by anyone (blufor won't work when a unit is renegade)

Condition: count thisList<2

Share this post


Link to post
Share on other sites

yeah as celery said, playableUnits will only work in MP, for testing in SP use switchableUnits, but again, if you just use count thisList<2 you will get 1 unit present inside a trigger if 5 players are inside a vehicle, it will count the 5 players in the same vehicle as 1, not 5, so you need to use the (vehicle _x) part i showed you.

Share this post


Link to post
Share on other sites
but again, if you just use count thisList<2 you will get 1 unit present inside a trigger if 5 players are inside a vehicle, it will count the 5 players in the same vehicle as 1, not 5, so you need to use the (vehicle _x) part i showed you.

That is a moot point in all vs. all pvp.

Share this post


Link to post
Share on other sites
That is a moot point in all vs. all pvp.

Probably, but he did not mention only foot soldiers or vehicles, so its important to be aware of the difference, cause in his case it could be a mission breaker.

It all comes down to the mission maker and if he plans on using vehicles.

Anyhow, the (vehicles _x) thing will work both ways, if unit is on foot and if unit is in a vehicle, count thisList will only function correctly if unit is on foot.

Share this post


Link to post
Share on other sites

The mission maker wont will be using vehicle's :)

Edited by VIPER[CWW]

Share this post


Link to post
Share on other sites

Yeah thanks guys, appreciate it :)!

I will be using vehicles, but people obviously wont be sharing them, but if they decided to for some obscure reason, I guess it would glitch. (ill just be using the "count thislist < 2"

playableUnits will only work in MP, for testing in SP use switchableUnits

I havent tested it yet, but I'm pretty sure that was the issue there, thanks again ;)!

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  

×