Hostile Markers replacement
Changed the markings of hostile movement in the observing area of a radio tower from the small markers to a painted area of 250x250m. The alpha level of the marker increases if more units are inside that area.
This commit is contained in:
parent
68ba097466
commit
6f47c78b4e
|
@ -1,37 +1,36 @@
|
|||
private [ "_hostile_markers", "_hostile_groups", "_nextgroup", "_marker" ];
|
||||
private ["_kp_markers_array","_kp_markers_start","_kp_markers_change","_kp_markers_pos","_kp_markers_posx","_kp_markers_posy","_kp_markers_name","_kp_markers_color"];
|
||||
|
||||
_hostile_markers = [];
|
||||
waitUntil {!isNull player};
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
!isNil "blufor_sectors"
|
||||
};
|
||||
|
||||
while { true } do {
|
||||
|
||||
{ deleteMarkerLocal _x } foreach _hostile_markers;
|
||||
_hostile_markers = [];
|
||||
_hostile_groups = [];
|
||||
_kp_markers_array = [];
|
||||
_kp_markers_start = 0.2;
|
||||
_kp_markers_change = 0.05;
|
||||
|
||||
while {true} do {
|
||||
{deleteMarkerLocal _x;} forEach _kp_markers_array;
|
||||
_kp_markers_array = [];
|
||||
{
|
||||
private [ "_nextgroup" ];
|
||||
_nextgroup = _x;
|
||||
if ( (side _nextgroup == GRLIB_side_enemy) && (({ !captive _x } count ( units _nextgroup ) ) > 0)) then {
|
||||
if ( [(getpos leader _nextgroup), GRLIB_side_friendly, GRLIB_radiotower_size] call F_getNearestTower != "" ) then {
|
||||
if ((side _x == GRLIB_side_enemy) && (({!captive _x} count (units _x) ) > 0) && ([(getpos leader _x), GRLIB_side_friendly, GRLIB_radiotower_size] call F_getNearestTower != "")) then {
|
||||
_kp_markers_pos = getPosATL leader _x;
|
||||
_kp_markers_posx = floor ((_kp_markers_pos select 0) / 100);
|
||||
_kp_markers_posx = _kp_markers_posx - (_kp_markers_posx mod 5);
|
||||
_kp_markers_posy = floor ((_kp_markers_pos select 1) / 100);
|
||||
_kp_markers_posy = _kp_markers_posy -(_kp_markers_posy mod 5);
|
||||
_kp_markers_name = format["kp_marker_grid_%1_%2", _kp_markers_posx, _kp_markers_posy];
|
||||
_kp_markers_color = format["Color%1", side _x];
|
||||
_kp_markers_count = (count (units _x)) - 1;
|
||||
|
||||
_hostile_groups pushback _nextgroup;
|
||||
if ((markerShape _kp_markers_name) isEqualTo "RECTANGLE") then {
|
||||
_kp_markers_name setMarkerAlphaLocal ((markerAlpha _kp_markers_name) + (_kp_markers_count * _kp_markers_change));
|
||||
} else {
|
||||
createMarkerLocal[_kp_markers_name, [(_kp_markers_posx * 100) + 250, (_kp_markers_posy * 100) + 250, 0]];
|
||||
_kp_markers_name setMarkerShapeLocal "RECTANGLE";
|
||||
_kp_markers_name setMarkerSizeLocal [250,250];
|
||||
_kp_markers_name setMarkerColorLocal _kp_markers_color;
|
||||
_kp_markers_name setMarkerAlphaLocal (_kp_markers_start + (_kp_markers_count * _kp_markers_change));
|
||||
_kp_markers_array pushBack _kp_markers_name;
|
||||
};
|
||||
};
|
||||
} foreach allGroups;
|
||||
|
||||
{
|
||||
_marker = createMarkerLocal [format ["hostilegroup%1",_x], markers_reset];
|
||||
_marker setMarkerColorLocal GRLIB_color_enemy_bright;
|
||||
_marker setMarkerTypeLocal "mil_warning";
|
||||
_marker setMarkerSizeLocal [ 0.65, 0.65 ];
|
||||
_marker setMarkerPosLocal ( [ getpos (leader _x), random 50, random 360 ] call BIS_fnc_relPos );
|
||||
_hostile_markers pushback _marker;
|
||||
} foreach _hostile_groups;
|
||||
|
||||
sleep (60 + (random 60));
|
||||
} forEach allGroups;
|
||||
uiSleep (60 + (random 60));
|
||||
};
|
Loading…
Reference in New Issue