Jump to content
Sign in to follow this  
hellstorm77

Attach markers

Recommended Posts

I was wondering what the script code was for attaching markers to a vehicle? i want the marker to always be there even when the vehicle respawns.

Share this post


Link to post
Share on other sites

Not sure if you could use attachTo but you could do this

vehicle init:

while {alive this} do
{
 "mymarker" setMarkerPos getPos this;
 "mymarker" setMarkerDir getDir this;
 sleep 1; //Decrease if you want it to be more smooth
};

Share this post


Link to post
Share on other sites

I have this script and for the life of me i can't remember how to called it up on a vehicle so the marker named chopper1 will attach to the chopper so when you look at the map you see the marker moving with the chopper.

marker_units.sqf

private ["_unit","_marker","_delay"];
_unit = _this select 0;
_marker = _this select 1;
_delay = _this select 2;
while {true} do
{
_marker setMarkerAlpha 1;
while {alive _unit} do 
{
	_marker setMarkerPosLocal getPos _unit;
	sleep _delay;
};
_marker setMarkerAlpha 0;
waitUntil {alive _unit};
};

Share this post


Link to post
Share on other sites

it would be this in the vehicle init:

[this, "marker_name", 1] execVM "marker_units.sqf";

Share this post


Link to post
Share on other sites
it would be this in the vehicle init:

[this, "marker_name", 1] execVM "marker_units.sqf";

it didnt work

Share this post


Link to post
Share on other sites
it didnt work

hi,

try this, it works:

you need a marker named chopper1, and write in init of vehicle:

null = [this, "chopper1", 1] execVM "marker_units.sqf";

Share this post


Link to post
Share on other sites

try this if wrong sorry really tired will test tomorrow

-------init.sqf-------

[] spawn {
while{not isnull Heli1} do {"Marker" setmarkerpos getpos Heli1; sleep 0.4;};
};

--------------------------

Explanation:

Heli1 = Unit the marker follows

"Marker = Name of the marker

sleep 0.4 = time the marker updates - here 0.4 seconds

Share this post


Link to post
Share on other sites

i did try this yesterday null = [this, "chopper1", 1] execVM "marker_units.sqf"; and it worked :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×