Jump to content
Sign in to follow this  
JacobJ

Respawn = same playername? compare list?

Recommended Posts

Hello all

I have a problem. I have given all my playable units names w1 to w10 and e1 to e10.

I have then done this in a trigger: !alive w1 && !alive w2 and so on...

In the triggers I have made end1 og end2

The one trigger doesnt end the game when all easts are dead and the other trigger only ends the game for east players, so west-players can run around and still shoot, alltho there arent any bad guys left.

I have an enclosed respawn area that I could use to count the units in it.

Can I somehow make a trigger covering all opfor units and a trigger that covers all blufor units at the start of the game and then make a trigger in the respawn-area to count how many of the guys spawned at the beginning is the the respawn-area-trigger and that way end the game?

Any other ideas?

/Jacob

Share this post


Link to post
Share on other sites

thisList is any alive unit inside a trigger, same command as list triggername in a outside script.

side is side of unit.

a opfor present trigger with condition:

this AND ({alive _x} count thisList) < 5

on act:

hint "there are less than 5 alive opfor units inside trigger area"

note that a thisList returns 1 on a vehicle even if vehicle have 5 units inside it.

so 1 truck with 5 units inside + 2 units on foot returns 3 total.

Edit: allUnits is a list of all alive units on the entire map, you can use it to check distance from something and then choose to count it based on its side.

Share this post


Link to post
Share on other sites

Okay thanks a lot for the quick reply. I took what you posted and turned into this:

Starting with counting all the spawned units:

Blufor present (Once)

cond: this

On act: westbuffer = count thislist

Then I took another trigger and placed it over the respawn:

Blufor present (Once)

cond: this AND count thislist == westbuffer;

#End5

the same for the opfor. It seems to work..

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  

×