OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Calamity on 23 Jan 2005, 16:35:01

Title: Trigger Definitions/Options/Peramiters
Post by: Calamity on 23 Jan 2005, 16:35:01
Is there a way, from inside a script, to get the dimentions of a trigger?

I am working on a new flare trap.
What I want to do - which I haven't found - is create a trigger with the dimentions of Y=2 X=n. This would form a "TripLine"
When fired, the executing trigger passes it's name to the script. With this name I can get the 'direction' of the trigger. What I need is the X length. that way I can randomly create the flare somewhere allong the length of the 'tripwire'. I'm also thinking of making the script randomly drop a Shell73 so the TripLine can also simulate triggering a "ClayMore Mine".

I have alternitive methods, such as passing the dimention to the script. But it required defining the X dimention in two locations. This is cumbersome, and not as user friendly as I would like.

Any help here guys. thanks.
Calamity.
Title: Re:Trigger Dimentions
Post by: Triggerhappy on 23 Jan 2005, 17:25:22
i'm afraid you're out of luck
you'll have to pass the dimension to the script
Title: Re:Trigger Definitions/Options/Peramiters
Post by: Calamity on 25 Jan 2005, 02:04:57
Ok, I've given up on the whole getting the trigger Dimensions thing. I've moved on a bit. Instead I want to automatically pass the name of the trigger.
The Test
Create a trigger, Anybody present. 1x25, rectangle - A trip line - INIT =
HINT FORMAT["Tripping Unit = %1", this]

Turns out if I use the keyword "THIS" as the passed parameter, then 'sometimes' it will supply the name of the unit that tripped the trigger. More often though it will return a Boolean.

If, however I set the INIT =
HINT FORMAT["Tripping Unit = %1", thislist select 0]

Then the trigger will ALWAYS return the tripping unit. (See attached mission).
However, If I create a small delay on the trigger. Say 4 seconds. Then the unit has time to move out of the trigger. Apparently when the trigger's time delay ENDS it builds the list. Hence I get a scalier instead.

So, My question boils down to this. Is there a way to codify the passing of the trigger name? This way I can automatically pass the trigger name to the script and temporarily disable the trigger. (This is to give a small break for the TripLine to 'Reset' and will also prevent every member of the group from tripping the line in turn)

Thanks Guys.
Title: Re:Trigger Definitions/Options/Peramiters
Post by: macguba on 25 Jan 2005, 11:09:41
Just a guess, but could you use name this in some way?   Dunno if it would work on a trigger, might be worth a try.