OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: trinec 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
-
Ok, Let's say you got 3 markers, "M1","M2","M3"
Copy & paste this and save it as markermove.sqs
;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
[name_of_vehicle] exec "markermove.sqs"
If you got more markers, simply add them in the _markers array.
Not tested.
-
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
-
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. :-\
-
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.