Home   Help Search Login Register  

Author Topic: Unit move thru marker positions  (Read 983 times)

0 Members and 1 Guest are viewing this topic.

Offline trinec

  • Members
  • *
  • I'm a llama!
Unit move thru marker positions
« on: 19 Aug 2005, 04:14:42 »
Im trying to figure out how to script when a unit reaches a certain area then another unit in a vehicle moves thru multiple marker positions.

I know you can use

unit doMove getmarkerpos "marker1" in the editor  but im not sure if thats the right way to place it in a script..


Thanks

Offline Blanco

  • Former Staff
  • ****
Re:Unit move thru marker positions
« Reply #1 on: 19 Aug 2005, 04:31:24 »
Ok, Let's say you got 3 markers, "M1","M2","M3"

Copy & paste this and save it as markermove.sqs
Code: [Select]
;markermove.sqs
_veh = _this select 0
_markers = ["M1","M2","M3"]

_c = count _markers
_i = 0

#START
_veh domove getmarkerpos (_markers select _i)

#1
?!alive _veh : exit
?unitready _veh : goto "2"
~2
goto "1"

#2
_i = _i + 1
?_i < _c : goto "START"
exit

Run it with

Code: [Select]
[name_of_vehicle] exec "markermove.sqs"

If you got more markers, simply add them in the _markers array.
Not tested.

Search or search or search before you ask.

Offline trinec

  • Members
  • *
  • I'm a llama!
Re:Unit move thru marker positions
« Reply #2 on: 19 Aug 2005, 05:29:33 »
Any Idea on having the unit driving to not stop then start when changing to the next marker or backup to change direction instead of just driving to the next marker.  But other then that it works great..

Thanks

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Unit move thru marker positions
« Reply #3 on: 19 Aug 2005, 08:25:30 »
as far as i know, this pausing at a marker/waypoint is a 'feature' of the way AI drives in flashpoint, and other than complex setvelocity calculations, there's nothing to be done about it.  :-\

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Unit move thru marker positions
« Reply #4 on: 19 Aug 2005, 10:58:22 »
You can cover each marker with a trigger.   When the unit enters the trigger area (experiment to find the right area) it is given the order to move to the next marker.    Thus it never reaches the first marker, so it doens't pause.

It works with choppers, don't know how it will go with ground vehicles.
Plenty of reviewed ArmA missions for you to play