Jump to content
Sign in to follow this  

Recommended Posts

I have a trigger, and anyone will activate it when they enter its radius. But how do I tell the trigger to do something to all units within its radius, or even simply all units? The only thing I can get it to affect is named units and players.

Share this post


Link to post
Share on other sites

Use the thislist command, it will give you a list of all the units in the area.

An example of this would be:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x setbehaviour {safe}" foreach thislist<span id='postcolor'>

RED

Share this post


Link to post
Share on other sites

I want to remove the hand grenades of all units on the map. So I made a trigger that is activated by anyone and has a radius of ten thousand meters. Now, you are usually supposed to put

this removemagazines "handgrenade"

in a soldier's init line to remove hand grenades. So I put

"_x removemagazines "handgrenade"" foreach thislist

in the "on activation" line of the trigger. The problem is that the trigger doesn't like the double quotation mark at the end of "handgrenade." I can't remove the quotation marks from around "handgrenade," either. How do I go about fixing this?

Share this post


Link to post
Share on other sites

You just need something to replace "handgrenade" , so try this

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">BOB="handgrenade"; "_x removemagazines BOB" foreach thislist<span id='postcolor'>

problem fixed, there is no more the double quotes that annoy OFP and you have a valid command that remove grenades wink.gif

Share this post


Link to post
Share on other sites

Curly brackets will do the job:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x removemagazines {handgrenade}" foreach thislist<span id='postcolor'>

RED

Share this post


Link to post
Share on other sites

Thanks for that, i never heard of that use of the brackets

I will now be able to gain space in my trigger activation line

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  

×