Jump to content
Sign in to follow this  
edc

Some basic scripting questions

Recommended Posts

Is it possible to make triggers that detect when anyone is withing a certain distance in a script? If so, how? And is it possible to do something to only the infrantry that is inside that trigger(not the armor)? I'm trying to make a simple chemical weapons script. Thanks.

Share this post


Link to post
Share on other sites

<s>Also one other thing, is there anyway I can add damage to people.  I don't mean set damage to a certain level, but just add damage to them, so like if they are 0.2 damaged, and I set it to add 0.1 damage, the person would be 0.3 damaged.</s>

edit:I solved this problem.

Share this post


Link to post
Share on other sites
Guest BratZ

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (edc @ April 11 2003,02:26)</td></tr><tr><td id="QUOTE">Is it possible to make triggers that detect when anyone is withing a certain distance in a script?  If so, how?  And is it possible to do something to only the infrantry that is inside that trigger(not the armor)?  I'm trying to make a simple chemical weapons script.  Thanks.<span id='postcolor'>

Said it yourself...trigger ,just set the radius to what you want

If you only want to damage soldiers ,do a check to see if they can walk or something is a way I have used before.

On Ofpec there is already some scripts too, thats why nobody answered, it may even be in the pinned stuff here as its a common question

Sorry I wasnt alot of help,been a while since I toyed with gas and electric fences and booby traps

Share this post


Link to post
Share on other sites

OK, I think I got most of the trigger part, I created triggers in the Mission Editor, named them and just moved them to the position I want them to be in. I have it set so on activation it stores the contents of thisList to a variable. In the external script I want it to do stuff to the people activated the trigger. I had it do this:

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

"_x setdamamge(damage _x+random 0.1)" foreach units List med;

<span id='postcolor'>

med was the variable I stored thisList to. Now when I do the mission it comes up and says that it can't do it since List med is an array and the foreach think only works on units or groups. Can any kind person out there help me?

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  

×