Jump to content
Sign in to follow this  
profcupcake

Dead Simple Tracker Markers Script

Recommended Posts

Hey, look, I released another script. I don't know how long it's been. I'm still keeping up the three-sentence gag though, so this one is going to have to be really extended so that I can explain that this is a script to make some map markers track units. 

 

KNOWN ISSUES

  • None. (yay)

Download Link

Share this post


Link to post
Share on other sites

Thanks for sharing. What's the advantage over some simple solution like

params [_marker, _vehicle, [_type, "warning"], [_text, ""], [_color, "ColorBlack"], [_alpha, 1]];

if (getMarkerColor _marker == "") then {
	createMarker [_marker, [0,0,0]];
	_marker setMarkerType _type;
	_marker setMarkerText _text;
	_marker setMarkerColor _color;
	_marker setMarkerAlpha _alpha;
};

while {alive _vehicle} do {
	_marker setmarkerpos (getpos _vehicle);
};

deletemarker _marker;

? (quickly put together as an example, not tested) From my brief look it looks you send a lot of things to diag_log, which is great for debug but not much else, right?

  • Like 1

Share this post


Link to post
Share on other sites

What's the advantage over some simple solution like

while {alive _vehicle} do {

    _marker setmarkerpos (getpos _vehicle);

};

Well for starters your solution would either finish almost immediately (if launched in unscheduled) or kill network and bring down performance for everyone, but mostly your client (if launched in scheduled)

Share this post


Link to post
Share on other sites

Thanks for sharing. What's the advantage over some simple solution like

params [_marker, _vehicle, [_type, "warning"], [_text, ""], [_color, "ColorBlack"], [_alpha, 1]];

if (getMarkerColor _marker == "") then {
	createMarker [_marker, [0,0,0]];
	_marker setMarkerType _type;
	_marker setMarkerText _text;
	_marker setMarkerColor _color;
	_marker setMarkerAlpha _alpha;
};

while {alive _vehicle} do {
	_marker setmarkerpos (getpos _vehicle);
};

deletemarker _marker;

? (quickly put together as an example, not tested) From my brief look it looks you send a lot of things to diag_log, which is great for debug but not much else, right?

 

That is a solution for making 1 mark. 

 

This script offloads that entire process, allowing you to make and delete as many marks as you want all around a mission. Think of it like offloading repeated operations to an external function. Keep your code dry and all that. 

It also unifies them, bringing them all into the same update loop, which should make things a lot more efficient than having a separate loop for each mark. 

That is a solution for making 1 mark. 

 

This script offloads that entire process, allowing you to make and delete as many marks as you want all around a mission. Think of it like offloading repeated operations to an external function. Keep your code dry and all that. 

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  

×