Home   Help Search Login Register  

Author Topic: Returning the units within a trigger....  (Read 533 times)

0 Members and 1 Guest are viewing this topic.

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Returning the units within a trigger....
« on: 17 Nov 2005, 19:03:02 »
I'm working on a script. I have the meat and bones of it out the way, but this is my sticking point. I want to check for any East units within a certain radius of the player, and run the script for these units specifically. I don't want to be running the script seperately for each East unit, simply for lag reasons. I'm not explaining this very well. What I want is...

  • Activates a script when an enemy unit gets within a certain distance of the player....
  • The enemy's unit name is returned, so that it can be used in the script.
Looking at what I just wrote, its clearly more of a triggering issue than a scripting one. Anybody got any ideas?

Offline Trapper

  • Honoured Contributor
  • ***
  • I'm a llama!
Re:Returning the units within a trigger....
« Reply #1 on: 17 Nov 2005, 20:51:01 »
On activation: {_x exec "yourscript.sqs"} foreach thislist

Every unit(s) that activates the trigger should then run the script.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Returning the units within a trigger....
« Reply #2 on: 17 Nov 2005, 22:09:19 »
A looping script/gamelogic moves Trapper's trigger to the player's position, and controls a variable which makes the trigger fire each time.

Obviously the size of the trigger is the distance you want.  Trigger should be "East present" (or whatever) with the variable in the Condition field.
Plenty of reviewed ArmA missions for you to play

Offline Gogs

  • Contributing Member
  • **
  • WWIIEC - Gracefully retired boss
Re:Returning the units within a trigger....
« Reply #3 on: 18 Nov 2005, 12:32:36 »
Thats brilliant guys. Thanks. I'll go and have a play and get it working. Cheers!  :D