Jump to content
Sign in to follow this  
vincentz

Putting marker on all units on map (for debugging purpose)

Recommended Posts

I'm suspecting my enemy troops to desert, so I kinda want to be able to keep track of the enemy.

(maybe also adding it as "Intel Report" in end game as the area that needs to be cleared is rather large)

So I came up with this :

{_marker = createMarker ["_x", getpos _x]; "_x" setMarkerType "attack";} foreach allUnits;

but it only marks 1 unit. What am I doing wrong???

Edit : Also a bonus question if the above is too obvious ;)

Im making capture points that is invisible, but shows green flag when captured, and red flag if recaptured by enemy. However if I fly over the trigger, it detriggers (shows red flag) which is unintended.

Cap_0 = getmarkerpos "Area_0";
_trg=createTrigger["EmptyDetector", Cap_0]; _trg setTriggerArea[100,100,0,false]; _trg setTriggerActivation["ANY","PRESENT",true];
_trg setTriggerStatements["(count (thislist unitsBelowHeight 10) > 0) && (east countside thislist < west countside thislist)", "; caca = caca +1; 'Area_0' setMarkerType 'hd_flag'; 'Area_0' setMarkerColor 'ColorGreen';",
"'Area_0' setMarkerColor 'ColorRed'; caca = caca - 1"];
_trg setTriggerTimeout [10, 15, 20, false];

dbl edit : looking at the last question, I think I might have solved it with triggertimeout [x,x,x,true]

Edited by vincentz

Share this post


Link to post
Share on other sites

According to createMarker biki page additional notes, you would need to define shape as well in addition to type for it to be shown. As for the trigger; it's working as written, if there's no enemies in the area and you're flying above 10 meters - there's "any" unit "present" and the number of units below 10 meters is not greater than 0, thus triggering the "false case" script that shows the red marker.

Share this post


Link to post
Share on other sites

This should work, you can loop it to have moving markers:

number = 0;
for "_i" from 0 to number do {deletemarkerlocal format ["Vehicle_%1",_i];};
{
_markername = format ["Vehicle_%1",number];
_pos = getPos _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_class = typeOf _x;
_marker setMarkerTextLocal _class;
_marker setMarkerTypeLocal "Dot";
_marker setMarkerSizeLocal [0.45, 0.45];
_marker setMarkerColorLocal "ColorGreen";
_marker setMarkerAlphaLocal 0.75;
number = number + 1;
} forEach playableUnits;

Share this post


Link to post
Share on other sites

Just wanted to say thanks :D

I actually ended up using it as Intel gathered from the Officers killed in my gamemode Full Metal Arma.

It is called by a Radio Channel (Intel Report) to not overload server with constant updates, and requires the variable IPosXXX to be set as 0 when inactive (I set in Init) and to 1 when Intel have been acquired.

If (IPOSINF == 1) then {
//INF GROUP INTELLIGENCE
_getposvecs = allGroups;
for "_i" from 0 to number do {deletemarkerlocal format ["InfGroup_%1",_i];};
{
if ((side _x == east || side _x == resistance) && (vehicle leader _x == leader _x)) then { 
_markername = format ["InfGroup_%1",number];
_pos = getPos leader _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_marker setMarkerTypeLocal "o_inf";
_marker setMarkerSizeLocal [1, 1];
_marker setMarkerColorLocal "ColorRed";
};
number = number + 1;
} forEach _getposvecs;
};

If (IPOSCAR == 1) then {
//LIGHT VEHICLE INTELLIGENCE
_getposvecs = vehicles;
for "_i" from 0 to number do {deletemarkerlocal format ["LightVehicle_%1",_i];};
{
if (_x isKindOf "Car" && (side _x == east || side _x == resistance)) then { 
_markername = format ["LightVehicle_%1",number];
_pos = getPos _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_class = getText (configFile >> "cfgVehicles" >> typeof _x >> "displayName");
_marker setMarkerTextLocal _class;
_marker setMarkerTypeLocal "o_mech_inf";
_marker setMarkerSizeLocal [1, 1];
_marker setMarkerColorLocal "ColorRed";
};
number = number + 1;
} forEach _getposvecs;
};

If (IPOSARM == 1) then {
//TANK INTELLIGENCE
_getposvecs = vehicles;
for "_i" from 0 to number do {deletemarkerlocal format ["HeavyVehicle_%1",_i];};
{
if (_x isKindOf "Tank" && (side _x == east || side _x == resistance)) then { 
_markername = format ["HeavyVehicle_%1",number];
_pos = getPos _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_class = getText (configFile >> "cfgVehicles" >> typeof _x >> "displayName");
_marker setMarkerTextLocal _class;
_marker setMarkerTypeLocal "o_armor";
_marker setMarkerSizeLocal [1, 1];
_marker setMarkerColorLocal "ColorRed";
};
number = number + 1;
} forEach _getposvecs;
};

If (IPOSSTA == 1) then {
//STATIC WEAPON INTELLIGENCE
_getposvecs = vehicles;
for "_i" from 0 to number do {deletemarkerlocal format ["Static_%1",_i];};
{
if (_x isKindOf "StaticWeapon" && (side _x == east || side _x == resistance)) then { 
_markername = format ["Static_%1",number];
_pos = getPos _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_class = getText (configFile >> "cfgVehicles" >> typeof _x >> "displayName");
_marker setMarkerTextLocal _class;
_marker setMarkerTypeLocal "o_mortar";
_marker setMarkerSizeLocal [1, 1];
_marker setMarkerColorLocal "ColorRed";
};
number = number + 1;
} forEach _getposvecs;
};

If (IPOSAIR == 1) then {
//AIR INTELLIGENCE
_getposvecs = vehicles;
for "_i" from 0 to number do {deletemarkerlocal format ["AirVehicle_%1",_i];};
{
if (_x isKindOf "Air" && (side _x == east || side _x == resistance)) then { 
_markername = format ["AirVehicle_%1",number];
_pos = getPos _x;
_vpos = [_pos select 0, _pos select 1];
_marker = createMarkerLocal [_markername, _vpos];
_class = getText (configFile >> "cfgVehicles" >> typeof _x >> "displayName");
_marker setMarkerTextLocal _class;
if (_x isKindOf "Helicopter") then {_marker setMarkerTypeLocal "o_air";} else {_marker setMarkerTypeLocal "o_plane";};
_marker setMarkerSizeLocal [1, 1];
_marker setMarkerColorLocal "ColorRed";
};
number = number + 1;
} forEach _getposvecs;
};

Edited by vincentz

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  

×