Home   Help Search Login Register  

Author Topic: Help me with this switch trigger.  (Read 624 times)

0 Members and 1 Guest are viewing this topic.

Bad Maniac

  • Guest
Help me with this switch trigger.
« 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.

deaddog

  • Guest
Re:Help me with this switch trigger.
« Reply #1 on: 29 Apr 2003, 21:47:59 »
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.

 

Bad Maniac

  • Guest
Re:Help me with this switch trigger.
« Reply #2 on: 29 Apr 2003, 22:17:59 »
I need the leader patrol1, since the move command needs a unit or an array, not a group.

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Help me with this switch trigger.
« Reply #3 on: 29 Apr 2003, 23:09:31 »
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 !

Bad Maniac

  • Guest
Re:Help me with this switch trigger.
« Reply #4 on: 30 Apr 2003, 00:45:21 »
how come I searched for "Switch Trigger" on the forums, in the faq and in the tutorials, and I didn't find that???  >:(

deaddog

  • Guest
Re:Help me with this switch trigger.
« Reply #5 on: 30 Apr 2003, 01:02:58 »
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.  :)

Bad Maniac

  • Guest
Re:Help me with this switch trigger.
« Reply #6 on: 30 Apr 2003, 11:36:00 »
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