OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: stephen271276 on 01 Feb 2011, 12:20:25
-
Is it possible to attatch a trigger to a unit?
In a previous thread I asked about attatching a marker which is great now I need to attatch a trigger which will activate dialogue when the unit in question is found and approached>?
-
The easiest way is to change trigger condition to e.g.:
player distance unitname < 5
The trigger size dont then matter and you can set it zero, instead you give the distance in that condition (in meters).
-
There are a couple of ways to attach a trigger
name the trigger trig1
then in a units init,gamelogic script ect put this trig1 attachto [unitname,[0,0,0]]
0,0,0 are x,y,z so it can be offset.
Z won't work on triggers but will be the height if used to attach an object to an object.
Also
trig1 attachto [unitname]
would attach the trigger relative to the players position.
some objects usually small one can't be attached to anything using attachto.
You would then have to do it by moving it to the object in a loop
trig1 setpos [getpos unitname select 0, getpos unitname select 2, getpos unitname select 2, ];
this would have to be used in a loop or it would move to just the current location as a one off.
SaOk is right though as that's all you need in this case. Keep it simple when you can.