Jump to content
Sign in to follow this  
Meatball0311

Attaching moveable map markers to units?

Recommended Posts

how do you set a varname??

When you create a unit in the editor you can enter a name, that can then be used for triggers, scripts and so on.

f.E. you could have an UH60 that is named "chopper" and in a trigger you might use "chopper flyInHeight 50"

sth like that. Anyway, these are vehiclevarnames.

I'll have to get around to finally test that script, just to be sure its actually functional. (you never know) I'll report back once I've done that, however I'm pretty confident that it works.

Share this post


Link to post
Share on other sites
What I am trying to accomplish is having each member of a fireteam to have a movable map marker attached to track movement. I remember in ArmA doing this and actually had it to show a green marker for units that are alive and a red marker for units that are dead.

There's a component of F2 that does this, using small yellow triangles to denote the position and orientation of each member of a player's group (although it removes the marker once a unit is dead). Have a look here:

http://ferstaberinde.com/f2/en/index.php?title=ShackTactical_Fireteam_Member_Markers

Important tip: if you're writing for MP you should ensure that you use the local marker commands - it puts no load on the network.

Share this post


Link to post
Share on other sites

@Tajin

This script works great however how do you put in player names rather than the class name?

_temp = _this select 0;
_varname = vehicleVarName _temp;
_unit = objnull;


createMarkerLocal [_varname, [0,0]];
_varname setMarkerShape "ICON";
_varname setMarkerColor "ColorBlack";
_varname setMarkerSize [1,1];
_varname setMarkerType "Arrow";

while {true} do {
   waitUntil {
       call compile format ["_unit = %1",_varname];
       alive _unit;
   };

   while {alive _unit} do {
       if (side _unit == west) then {
           _varname setMarkerColor "ColorBlue";
       };
       if (side _unit == east) then {
           _varname setMarkerColor "ColorRed";
       };
       _varname setMarkerDir getDir _unit;
       _varname setMarkerPos getPos _unit;

       sleep 0.5;
   };
   _varname setMarkerColor "ColorBlack";
   sleep 5;
};

Share this post


Link to post
Share on other sites

The varname is the player name if I'm reading that right. I'm not sure how you are getting class names from that script...?

Share this post


Link to post
Share on other sites

@Apocal

The marker in game reads it as what type of unit it is. For example if its a corpsman it shows up as a moving green marker that says corpsman, or team leader, heavy gunner, and so on.

I think I might have fixed my problem with the script below it looks like it is working in COOP Mission.

marker.sqf

waituntil {(alive player)};

_unit = player;
_nameP = name _unit;

_markerobjp = createMarker [_namep,[0,0]];
_markerobjp setMarkerShape "ICON";
_markerobjp setMarkerType "mil_dot";
_markerobjp setMarkerColor "ColorGreen";
_markerobjp setMarkerText _nameP;
_markerobjp setMarkerSize [1,1];


while {alive _unit} do {
_markerobjp setmarkerdir (getdir _unit);
_markerobjp setMarkerPos (getPos _unit);
_markerobjp setMarkerText _nameP;
sleep 5;
};

deleteMarker _markerobjp;
[] execVM "scripts\marker.sqf";
exit;

Edited by cobra4v320

Share this post


Link to post
Share on other sites
If you want to use it for respawning units, give this one a try:

_temp = _this select 0;
_varname = vehicleVarName _temp;
_unit = objnull;


createMarkerLocal [_varname, [0,0]];
_varname setMarkerShape "ICON";
_varname setMarkerColor "ColorBlack";
_varname setMarkerSize [1,1];
_varname setMarkerType "Arrow";

while {true} do {
waitUntil {
	call compile format ["_unit = %1",_varname];
	alive _unit;
};

while {alive _unit} do {
	if (side _unit == west) then {
		_varname setMarkerColor "ColorBlue";
	};
	if (side _unit == east) then {
		_varname setMarkerColor "ColorRed";
	};
	_varname setMarkerDir getDir _unit;
	_varname setMarkerPos getPos _unit;

	sleep 0.5;
};
_varname setMarkerColor "ColorBlack";
sleep 5;
};

nul=[this] execVM "marker.sqf";

Important: Any soldier you use this on, has to have a varname.

It's based on an script I used for giving orders to respawning AI soldiers, only just changed it (it's not tested).

Hi Tajin...

Tell me... I have inserted youre script to test it, and it works..

Now my Questions

1. is this MP Compatible ?

2. How can i add a Markername on each vehicle i use it on? ( Vehiclename in Mapeditor)

3. can i Stop turning the Markers ? cause they turn the same direction as the Vehicle

Greetz

Claus

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  

×