Jump to content
Sign in to follow this  
terox

(vehicle east) countside list triggername

Recommended Posts

i am trying to return the number of units in a trigger area, including those in a vehicle

however using

<span style='color:blue'>(side countside list triggername)</span> does not count those units in a vehicle

and

<span style='color:blue'>((vehicle side) countside list triggername)</span>

gives an error message

what's the work around

Thx in advance for any help offered

Share this post


Link to post
Share on other sites
Guest

Im no scripting guru at all, but I do know that CTI uses thislist in the activation field of the flag owner checks, and then that count is broken down in the script by the use of the countside afterwords, just thought maybe thislist does transfer all the units instead of countside. Although you may be using thislist this way anyhow, ah well, I dont get a chance very often to try to return the help given me, so I tried.

Trigger activation: [thislist,town235] exec "1milliontownscheck.sqs"

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">a=[];{a=a+(units _x)} foreach thislist;hint format ["%1",west countside a]

seems to work

Edit: this got bugged when units were grouped. Worked with a manned tank and the player not grouped.

Share this post


Link to post
Share on other sites

thislist returns vehicles as one unit. try it for yourself. put three tanks in a trigger, west present, on activation "west_tanks = thislist". then find out what west_tanks is.

the only way to do this would be to somehow determine which of the units in the trigger area are vehicles. i tried this last night by using

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?((vehicle my_trigger select _i)==(my_trigger select _i))

where _i is looping through the overall trigger count. couldn't get it to work... i shall experiment a bit more...

Share this post


Link to post
Share on other sites

If you want to count the number of units+crew then this will do it:

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

{_Count=_Count+(Count (Crew _x))} ForEach ThisList

If you use the Crew command on an infantry guy, it returns himself in an array.

If you had a mixture of Civ and East in a vehicle and you only wanted to count East. Or your trigger is set for anybody, then use something like:

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

{_Count=_Count+({(Side _x)==East} Count (Crew _x))} ForEach ThisList

Share this post


Link to post
Share on other sites

Thx for all the help

Special thanks to UNN, that worked a treat

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  

×