OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gogs 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?
-
On activation: {_x exec "yourscript.sqs"} foreach thislist
Every unit(s) that activates the trigger should then run the script.
-
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.
-
Thats brilliant guys. Thanks. I'll go and have a play and get it working. Cheers! :D