OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Captain Crunch on 02 May 2003, 16:13:16
-
Hi everyone! :)
I was just wondering if it is possible to attach a marker or maybe a game logic to a vehicle in a maner that the marker or game logic would stick to it even if moving, on a car for instance.
I've tried a few things around without succes, I'm out of ideas. Anyone can help me?
I've tried this here at last and thought it would work but...
-----I've put a marker (tried with game logic too) named "MM01" on the map.
-----A trigger with " [This] Exec "Script.sqs " in the "On Activation" field.
-----And the "Script.sqs" :
#Loop
TrabantPos = GetPos Trabant
TrabantPosX = (TrabantPos Select 0) + 1
TrabantPosY = TrabantPos Select 1
TrabantPosZ = TrabantPos Select 2
MM01 SetPos GetPos TrabantPos
~0.5
GoTo "Loop"
The idea of the "TrabantPosX = (TrabantPos Select 0) + 1" line is to put the marker (or game logic) beside the car and make it keep this position.
Does it make sense at all?? If not, how can it be done?
I greatly appreciate any help!
-
You'll have to change this line:
MM01 SetPos GetPos TrabantPos
into this one:
"MM01" Setmarkerpos TrabantPos
Good luck :)
-
Hmm! No, unfortunately it doesn't work. I try since a week now only to get this thing done. It seems simply impossible. Thanx for the help anyway! :-\
-
PLEASE ANYONE!!! :-\
I need some help. I am certain that there is a way to position a marker to an object and make it stay there even if the object moves!!!
I work around this stupid matter for A WEEK now!!! It still doesn't work!!
---My goal is to attach a marker or a game logic or a whatever that works a meter in front of an object that will be moving. WHY??? Because at some point, when the moving object(the one with the whatever attached to it) will stop and then I want a unit to move RIGHT THERE on the marker or the game logic or the whatever!
ABOUT THE MARKER! I added a marker named MM01 on the map in the editor, should it be instead a marker created in a script or someother thing???
Please end my misery!!!
:(
-
Copied and pasted from one of my scripts
#marker
"CSMmarker" setMarkerPos getPos (leader CSM)
~4
goto "marker"
Worry about the extra metre later.
-
Here's a script I use
_marker = _this select 0
_vcl = _this select 1
#LOOP
? ! canmove _vcl: exit
_pos = getpos _vcl
_marker setmarkerpos _pos
~1
goto "LOOP"
save it as movemarker.sqs. call it in the init of the vehicle-
["MM01",trabant] exec "movemarker.sqs" (use the quotation marks!)