Home   Help Search Login Register  

Author Topic: Seek and destroy WP in script?  (Read 1010 times)

0 Members and 2 Guests are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Seek and destroy WP in script?
« on: 05 Oct 2005, 09:49:34 »
I need to create a "Seek and destroy" WP from a script. There is way to createWP or someshing?

details: I want write a script, wich triggered if player detected by enemy. There is an enemy base with lot of troops and if script start, two squad of enemy board to vehicle and drive to the last known position of player. Get out and "seek and destroy". Seek for a while and try destroy the player, but if they not found him - after about 2 mins - get in and drive back to the base.

doMove doesn't good, because this area is very wet (lots of lake and river) and if I wrote a searching pattern with doMove calculated from player's last known pos, maybe they doMove to the water.
Fix bayonet!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Seek and destroy WP in script?
« Reply #1 on: 05 Oct 2005, 10:13:19 »
You cannot create waypoints.   Fortunately you don't need to.  Use switch triggers.   For example, say your group is on patrol round the base, then go to hunt the player, then go back to patrolling the base.   Your waypoint sequence would look something like this.


MOVE  <------ synchro switch trigger 1
MOVE
MOVE
CYCLE <------ synchro switch trigger 2
GETIN
GETOUT
SEEK&DESTROY
GETIN
GETOUT

Both triggers are set to repeatedly.   At the start of the mission trigger 1 is set to true (and trigger 2 to false).  The group will move immediately to the second move WP.   They will then cycle round the move waypoints until switch trigger 2 is fired: this also uses setWPPos to move the S&D waypoint to whereever you want it, and sets trigger1 to false.    The group will then get in and do everything up to the getout waypoint, which automatically fires trigger1 again so that they return to the patrol sequence.

It sounds a bit complicated but actually its very straightforward once you get the hang of it.    You'll need to adjust and experiment until you get exactly what you want.   Use variables to turn the triggers on and off.
Plenty of reviewed ArmA missions for you to play

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re:Seek and destroy WP in script?
« Reply #2 on: 05 Oct 2005, 10:23:58 »
Thank you for your quick answer!

Code: [Select]
MOVE  <------ synchro switch trigger 1
MOVE
MOVE
CYCLE <------ synchro switch trigger 2
GETIN
GETOUT
SEEK&DESTROY
GETIN
GETOUT

There is no need a last CYCLE waypoint on the first MOVE wp?
Becouse I need this patrol process infinit times.
Fix bayonet!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Seek and destroy WP in script?
« Reply #3 on: 05 Oct 2005, 12:00:09 »
When trigger1 is true, the group will go immediately to the second move waypoint, and then through the other move waypoints till they get to cycle, then to the nearest waypoint to the cycle one.

Just experiment till you get what you want.    Make a test missionette with easy-to-observe waypoint positions so that you can see what is going on.
Plenty of reviewed ArmA missions for you to play

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re:Seek and destroy WP in script?
« Reply #4 on: 05 Oct 2005, 12:05:04 »
When trigger1 is true, the group will go immediately to the second move waypoint, and then through the other move waypoints till they get to cycle, then to the nearest waypoint to the cycle one.

I understand, but when they return from seek and destroy, no need a cycle wp to link to the first WP?


Just experiment till you get what you want.    Make a test missionette with easy-to-observe waypoint positions so that you can see what is going on.

I'll do this, but now I'm working and I can run the OFP only at home...  :D
Fix bayonet!

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re:Seek and destroy WP in script?
« Reply #5 on: 07 Oct 2005, 08:39:07 »
McGuba! Thanks your idea. Finally I don't use the first trigger and put a last Cycle waypoint to link back to the first one, and it's working!

Thanks again!
Fix bayonet!