OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: cliff on 20 Sep 2003, 19:27:06

Title: How do i move a trigger ingame?
Post by: cliff on 20 Sep 2003, 19:27:06
I have a guard-triggerarea that I would like to move dynamically with a hostage. Can i affect the placing of triggers dynamically as the mission plays?
Title: Re:How do i move a trigger ingame?
Post by: SickSidewinder on 20 Sep 2003, 23:16:46
good question, that would be cool, but as far as i know, that's not in the game engine.  you could try grouping the triggers to ppl, but that might not be what u want.  you coudl also set a triggers condition to activate only when another trigger is tryu (u have to name the trigger)
Title: Re:How do i move a trigger ingame?
Post by: cliff on 20 Sep 2003, 23:28:42
Does anyone know what happens if I group a "guarded by east"-trigger to a unit that is moving? Sounds like it could work, will try it out and report.
Title: Re:How do i move a trigger ingame?
Post by: mikeb on 21 Sep 2003, 01:13:34
not sure if this works but can you setpos triggers like units?

if so execute a script that does the following:


#loop
TRIGGERNAME setpos (getpos UNITNAME)
~0.01
goto "loop"

this will reset the pos every o.o1 seconds so it follows the unit.

someone try it.  i can't at the moment.
Title: Re:How do i move a trigger ingame?
Post by: ACF on 21 Sep 2003, 01:19:24
You can move triggers around with SetPos:

triggername SetPos [x,y,z]

or, for you:

triggername SetPos (GetPos hostage)

The tricky bit is the triggername.  In my editor, the 'Name' and 'Text' fields on the Trigger's dialogue box are crossed over - what you type in the 'Text' field actually becomes the name of the trigger!

Might need to watch how often you update it's position if you're using countdown or timeout.  Hope it helps . . .
Title: Re:How do i move a trigger ingame?
Post by: ACF on 21 Sep 2003, 01:27:04
Damn!  Too slow!

But for cliff's question - if you group a group to a trigger, I believe it means ONLY that group (or a selection of it)can trigger the trigger.  It seems the grouping overrides the 'Activated By' choice.  As you can tell, this isn't one I've tried . . .
Title: Re:How do i move a trigger ingame?
Post by: deaddog on 21 Sep 2003, 02:46:26
The tricky bit is the triggername.  In my editor, the 'Name' and 'Text' fields on the Trigger's dialogue box are crossed over - what you type in the 'Text' field actually becomes the name of the trigger!

I've never had a problem with trigger names.  The name field of a trigger works just like the name field of a unit.
Title: Re:How do i move a trigger ingame?
Post by: cliff on 21 Sep 2003, 15:41:26
In my editor the name & text boxes are also switched, so IÂ'm aware of this.


*edit*
IÂ've tried to move triggers ingame by naming them and using setpos on them. WORKS FINE.

So now I have a moving "guarded by east" trigger centred on my hostage. Practical...and makes for some random action.