OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 18 Jan 2004, 04:15:49
-
Hi everyone!
Does anyone know if it's possible to know which unit activated a trigger?
My example:
An alarm trigger activated by west, detected by east.
I would like to setpos the seek and destroy waypoint of a troop on whom activated the trigger. (Where the activator of the trigger was last seen)
I guess it's possible but can't remember how! can someone help me please! many thanx!!!
-
You can try this in the activation field of the trigger:
"markername" setmarkerpos getpos (thislist select 0)
-
Hmm! I tried several things and it doesn't work. It must be possible. I've had problems with that in the past and I remember never being able to solve it.
I have a patrol (BMP with a few units in) going back and forth with the help of two "Move" waypoints, a "Cycle" waypoint (synchronised with alarm trigger) and finaly, the "Seek And Destroy" waypoint.
In the alarm trigger, I've typed in the "On Activation" field:
[AK1, 3] SetWPPos GetPos (ThisList Select 0)
Where "AK1" is the group name patroling.
"3" is the number of the "Seek And Destroy" waypoint
and "SetWPPos GetPos (ThisList Select 0)" is supposed to set the waypoint on whom activated the trigger.
I have noticed that the "Seek And Destroy" waypoint actualy stays where I have set it in the Editor. It is not positioned on the activator. Anyone has an idea?
-
with the help of two "Move" waypoints, a "Cycle" waypoint and finaly, the "Seek And Destroy" waypoint
= 4 waypoints, =
[AK1, 4] SetWPPos GetPos (ThisList Select 0)
~S~ CD
-
with the help of two "Move" waypoints, a "Cycle" waypoint and finaly, the "Seek And Destroy" waypoint
= 4 waypoints, =
[AK1, 4] SetWPPos GetPos (ThisList Select 0)
~S~ CD
Actually, the first waypoint is "0". So the "Seek And Destroy" waypoint is "3". I pay atention as much as I can!! ;D :P
-
Not 100% sure.......but I think the waypoints might be numbered starting from 1, at least as far as referencing them goes.
Planck
-
WPs start countin from 1
cuz each sqad gets 1st wp on its startin position :P
LCD OUT
-
Thanks guys! :D
I thought I had to check in the waypoint itself under the "Waypoint Order:" field.!! ::)
Cos there it's typed: "3: Seek And Destroy"
-
Oh man! How many thanx guys!!!
;D :D 8) :'( IT WORKS!!! FINALLY!!!!!!!!!! And it works great too!
I was making two different mistakes.
1. The one You guys just corrected
2. I was typing "AK1=GroupThis" in the "Init" field of the leader instead of "AK1=Group This"! (with a space between Group and This)
The engine told me no error message so I thought it was good. Does anyone know if the "GroupThis" command actually works?
...He thanx again guys. You're great!
-
The engine told me no error message so I thought it was good. Does anyone know if the "GroupThis" command actually works?
No it does not, the engine just makes "ak1" empty this way, since there is nothing in the var groupthis.
-
OK, another question;
Is there a command to return a troop/unit to its first waypoint while it is on a "Seek And Destroy" waypoint? Like once the detected unit is killed, return to the normal move/move/cycle waypoints?
many thanx in advance! ;)
-
Yes.
Use switch triggers to control how groups move forward and backwards through their waypoints. Though it sounds like you might actually want a GUARD waypoint rather than S&D.
-
Thanx MacGuba! :)
Euh! If i'm not abusing, i'm looking for the correct syntax to check if a _unit is alive or not from a trigger.
I try this, ofcourse without success:
AlarmOff And Not Alive (List MyTrigger)
My goal is to check if the unit who activated another trigger named MyTrigger is alive or not.