Jump to content
Sign in to follow this  
jaenak

Bool, array, string condition

Recommended Posts

I'm trying to make a trigger without typing forever. I have a chopper, and a group of people. What I want is:

Trigger:

Condidtion: the whole group is in the chopper

On Activation: chopper setfuel 1

Okay, the activation isn't the problem, the condition is. Lets say the group is made up of six people, s1-s6 and the group name is p1, and the chopper name is h1. I've tried;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

p1 in h1

[p1] in h1

units p1 in h1

{_x in h1} foreach units group p1

{_x in h1} foreach units p1

{_x in h1} foreach units s1

[s1,s2,s3,s4,s5,s6] in h1

{s1,s2,s3,s4,s5,s6} in h1

And the only thing I can get to work is;

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

s1 in h1 && s2 in h1 && s3 in h1 && s4 in h1 && s5 in h1 && s6 in h1

Does anyone know of a shorter way than typing out each individual unit? And what about two or more groups instead of just one?

Share this post


Link to post
Share on other sites

Try to use snYpirs script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;BEGIN SCRIPT

_chopper = _this select 0

_chopper LockWP true

; loop until all of the players squad have got in

#for1

~0.5

? (GetPos _chopper select 2) > 5 : _chopper land "GET IN"

; make the chopper wait until the whole squad is in

_lead = leader player

_playerArr = units group _lead

_num = count _playerArr

_incount = 0

_tmp = 0

#for2

? vehicle (_playerArr select _tmp) == _chopper : _incount = _incount + 1

? _tmp < (_num - 1) : _tmp = _tmp + 1; goto "for2"

? _incount != _num : goto "for1"

; the chopper will move off on it's waypoints

_chopper LockWP false

; END SCRIPTp

dunno if it'll work for you, try.

Share this post


Link to post
Share on other sites
group name is p1

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

s1 in h1 && s2 in h1 && s3 in h1 && s4 in h1 && s5 in h1 && s6 in h1

Does anyone know of a shorter way than typing out each individual unit?  And what about two or more groups instead of just one?

condition:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x in h1} count units p1 == {alive _x} count units p1

and for two groups in one heli:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x in h1} count (units p1)+(units p2) == {alive _x} count (units p1)+(units p2)

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  

×