OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: hashmus on 02 Jan 2003, 19:16:19

Title: moveable marker??
Post by: hashmus on 02 Jan 2003, 19:16:19
i want to make a car that drives to a place that the player decides, but the car should NOT be in group with the player...
ive thought about makin a moveable marker, cause ive learned how to make the car drive to a marker... it could bemoved by dragging it (if possible) or it could be moved by radiocommands:
in a triggers "on activation field":
getmarkerposition marker1 "store as" "variables z and x"; marker1 setmarkerpos [z x+10]
is it possible or should i make it in another way???
perhaps by letting the car join me and then when it is at the right position let it be kicked out from my group... (is it possible??)
THANKS!
Title: Re:moveable marker??
Post by: Ranger on 02 Jan 2003, 20:06:30
If you have Resistance, the easiest way to do what you want is to use the onMapSingleClick command.  In your init.sqs script, put the following code:

Code: [Select]
onMapSingleClick {car1 doMove _pos}
Whereever the player single clicks on the map, car1 will move there.  Obviously, rename car1 to whatever your car is really called.  Good luck!  :D

Edit: Note that this method does not require the use of markers.  It's far simpler.  If you want to use markers in addition, you can create a script to do more complicated things.