Jump to content
Sign in to follow this  
nam_viet

display the number of westunits in an "hint"

Recommended Posts

Hello

sorry for that bad english ;)

I am trying to display the number of units alive in the side west in a hint message:

1st thing a put a trigger on west present and on activation:

wnumber=count thislist ;hint"%wnumber"

but it display %wnumber

can you help me please ?

ps: is it possible to get percent number of unit is alive in west side in a message ?

eg: 85% west soldiers are alive

Share this post


Link to post
Share on other sites

try this in the onactivation field of your WEST present trigger :

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

hint format ["%1 WEST soldiers are alive",count thislist]

Share this post


Link to post
Share on other sites

I would like to run it in a script

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

~1

hint format ["%1 U.S dispo",count thislist]

? not alive player:goto "exit"

~5

goto "start"

#exit

this one works but I would like get a message like that:

28 West

34 East

can you help me with that ?

Share this post


Link to post
Share on other sites

that's a nasty *BLING* every 6 seconds...

Man, I guess you don't play with headphones.  crazy_o.gif

ok...

Use the countside command instead :

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

hint format ["WEST %1\nEAST %2",WEST countside thislist,EAST countside thislist]

in the onact of ur trig   smile_o.gif

Or via chat :

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

Player globalchat format ["WEST %1\nEAST %2",WEST countside thislist,EAST countside thislist]

...or onscreen via titletext

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

Titletext [format["WEST %1\nEAST %2",WEST countside thislist,EAST countside thislist],"PLAIN DOWN"]

Note : A vehicle will be counted as 1, the crew inside is not counted.

Share this post


Link to post
Share on other sites

Thanks Blanco  this is nice  but

in my script

Est is always on "O"

and West works fine

is it a game bug ?

but via a trigger it works but dispay it one time   only sad_o.gif

same for radio,hint, title

ps: a globale channel radio is pretty much quiet  smile_o.gif

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

~1

Player globalchat format ["WEST %1--------EAST %2",WEST countside thislist,EAST countside thislist]

? not alive player:goto "exit"

~10

goto "start"

#exit

Share this post


Link to post
Share on other sites

Make sure your trigger covers the whole map,m8

Place Radio trigger Alpha  , repeatedly

and in the onact field that code again:

Player globalchat format ["WEST %1--------EAST %2",WEST countside thislist,EAST countside thislist]

should work smile_o.gif

Share this post


Link to post
Share on other sites

Is there a way that i can get the computer to detect if there is only one person on a squad left alive and if there is to play a special song, possibly easily through a trigger?

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">Count units group1 == 1

Something like that in a triggers condition field?

Share this post


Link to post
Share on other sites

Or better yet, this way

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"alive _X" Count units group1 == 1

This counts the alive units, using Korax's method might take awhile for the game to recognise that only 1 unit is left.

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  

×