OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bad Maniac on 29 Apr 2003, 21:37:45
-
I have an east group, called "patrol1", set up on a patrol of 4 waypoints, on cycle, so they patrol infinite. then I have a switch trigger, if west detected by east, since I want them to return to the base when it gets attacked. I have a marker in the base called "return_point"
this is in the on activation field of the switch trigger:
leader patrol1 Move getpos return_point;
but the patrol just stop dead, and don't do anything. please give me a hand here.
-
Use getmarkerpos "return_point" instead. you can also drop the "leader" part. :)
The group may try to resume their patrol when they reach the marker. I'm not sure about this. If so, put "patrol1 lockwp true" in front of the move command.
You could also use the setwppos command to move all their wapoints to the marker but that is a bit messy.
-
I need the leader patrol1, since the move command needs a unit or an array, not a group.
-
Actually, you needn't use any command : the switch trigger will simply "destroy" former waypoints, which means that you simply can add waypoints after your "cycle". I learned that here :
http://www.ofpec.com/editors/resource_view.php?id=475#comments
Thank you the Real Armstrong !
-
how come I searched for "Switch Trigger" on the forums, in the faq and in the tutorials, and I didn't find that??? >:(
-
The move command works on both groups and objects. Check it out:
group move pos
Operand types:
group: Object or Group
pos: Array
Type of returned value:
Nothing
Description:
Creates waypoint move on given position (format Position) and makes it actual group waypoint.
Example:
groupOne move getPos player
That's good to know about the switch trigger. :)
-
I challenge the wisdom of whatever source you got that deaddog.
I have:
patrol1 = group this; in the officers init field
then if I do patrol1 move getmarkerpos "return_point"; it says error blah blah, expected unit or array.
So I hereby declare that the move command does NOT take a group, but an array or a unit. Hence I use "leader patrol1" and it works absolutely perfect.
but now that I have figured out switch triggers, I dont really need it :D