-
Notifications
You must be signed in to change notification settings - Fork 313
Marker update #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Marker update #642
Changes from 7 commits
398d639
55efd7d
6aa1d57
32f44d7
c21754c
fb6fd42
8f16136
4a74ce6
ccafeec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,44 +3,34 @@ | |
| Author: Bryan "Tonic" Boardwine | ||
| Description: | ||
| Marks cops on the map for other cops. Only initializes when the actual map is open. | ||
| Marks cops on the map for other cops. | ||
| */ | ||
|
|
||
| private _markers = []; | ||
| private _cops = []; | ||
|
|
||
| sleep 0.5; | ||
| if (visibleMap) then { | ||
| _cops = playableUnits select {side _x isEqualTo west}; | ||
|
|
||
| //Create markers | ||
| { | ||
| if !(_x isEqualTo player) then { | ||
| private _marker = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x]; | ||
| _marker setMarkerColorLocal "ColorBLUFOR"; | ||
| _marker setMarkerTypeLocal "Mil_dot"; | ||
| _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
|
|
||
| _markers pushBack [_marker,_x]; | ||
| }; | ||
| true | ||
| } count _cops; | ||
|
|
||
| while {visibleMap} do { | ||
| { | ||
| _x params ["_marker","_unit"]; | ||
| if (!isNil "_unit" && {!isNull _unit}) then { | ||
| _marker setMarkerPosLocal (visiblePosition _unit); | ||
| }; | ||
| true | ||
| } count _markers; | ||
| if (!visibleMap) exitWith {}; | ||
| sleep 0.02; | ||
| { | ||
| if (side _x isEqualTo west) then { | ||
| private _marker = createMarkerLocal [format ["%1_marker",_x],getPosATL _x]; | ||
| _marker setMarkerColorLocal "ColorBLUFOR"; | ||
| _marker setMarkerTypeLocal "Mil_dot"; | ||
| _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
| _markers pushBack [_marker,_x]; | ||
| }; | ||
| } forEach (playableUnits - [player]); | ||
DomT602 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| while {visibleMap} do { | ||
| { | ||
| deleteMarkerLocal (_x select 0); | ||
| } count _markers; | ||
| _markers = []; | ||
| _cops = []; | ||
| _x params [ | ||
| ["_mark",""], | ||
| ["_unit",objNull] | ||
| ]; | ||
| if !(isNull _unit) then { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but what if it is? what if someone dies/respawns? (same for previous file) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just avoids moving the marker to [0,0,0] until they've closed the map it seems. |
||
| _mark setMarkerPosLocal (getPosATL _unit); | ||
| }; | ||
| } forEach _markers; | ||
| sleep 0.01; | ||
DomT602 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| { | ||
| _x params [["_mark",""]]; | ||
| deleteMarkerLocal _mark; | ||
| } forEach _markers; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,25 @@ | ||
| /* | ||
| File: fn_checkMap.sqf | ||
| Author: DomT602 | ||
| Description: | ||
| Checks if the map is being opened or closed, then puts markers according to side. | ||
| */ | ||
|
|
||
| params [ | ||
| ["_mapOpen",false,[false]] | ||
| ]; | ||
|
|
||
| if (_mapOpen) then { | ||
| switch playerSide do { | ||
| case west: {[] spawn life_fnc_copMarkers}; | ||
| case independent: {[] spawn life_fnc_medicMarkers}; | ||
| case civilian: {[] spawn life_fnc_civMarkers}; | ||
| }; | ||
|
|
||
| if (life_markers && {!(life_markers_active)}) then { | ||
| [true] spawn life_fnc_adminMarkers; | ||
| }; | ||
|
|
||
| } else { | ||
| life_markers_active = false; | ||
| }; | ||
| /* | ||
| File: fn_checkMap.sqf | ||
| Author: DomT602 | ||
| Description: | ||
| Checks if the map is being opened or closed, then puts markers according to side. | ||
| */ | ||
| params [ | ||
| ["_mapOpen",false,[false]] | ||
| ]; | ||
| if (_mapOpen) then { | ||
| switch playerSide do { | ||
| case west: {[] spawn life_fnc_copMarkers}; | ||
| case independent: {[] spawn life_fnc_medicMarkers}; | ||
| case civilian: {[] spawn life_fnc_civMarkers}; | ||
| }; | ||
| if (life_markers && {!life_markers_active}) then { | ||
| [true] spawn life_fnc_adminMarkers; | ||
| }; | ||
| } else { | ||
| life_markers_active = false; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,61 +1,53 @@ | ||
| /* | ||
| File: fn_medicMarkers.sqf | ||
| Author: Bryan "Tonic" Boardwine | ||
| Description: | ||
| Marks downed players on the map when it's open. | ||
| */ | ||
| private ["_markers","_units","_medics"]; | ||
| _markers = []; | ||
| _markersMedecin = []; | ||
| _units = []; | ||
| _medics = []; | ||
|
|
||
| sleep 0.25; | ||
| if (visibleMap) then { | ||
| {if (side _x isEqualTo independent) then {_medics pushBack _x;}} forEach playableUnits; //Fetch list of cops / blufor | ||
| { | ||
| _name = _x getVariable "name"; | ||
| _down = _x getVariable ["Revive",false]; | ||
| if (!isNil "_name" && !_down) then { | ||
| _units pushBack _x; | ||
| }; | ||
| } forEach allDeadMen; | ||
|
|
||
| { | ||
| if !(_x isEqualTo player) then { | ||
| _markerss = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x]; | ||
| _markerss setMarkerColorLocal "ColorIndependent"; | ||
| _markerss setMarkerTypeLocal "Mil_dot"; | ||
| _markerss setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
|
|
||
| _markersMedecin pushBack [_markerss,_x]; | ||
| }; | ||
| } forEach _medics; | ||
|
|
||
| //Loop through and create markers. | ||
| { | ||
| _marker = createMarkerLocal [format ["%1_dead_marker",_x],visiblePosition _x]; | ||
| _marker setMarkerColorLocal "ColorRed"; | ||
| _marker setMarkerTypeLocal "loc_Hospital"; | ||
| _marker setMarkerTextLocal format ["%1",(_x getVariable ["name","Unknown Player"])]; | ||
| _markers pushBack _marker; | ||
| } forEach _units; | ||
|
|
||
| while {visibleMap} do { | ||
| { | ||
| private ["_unit"]; | ||
| _unit = _x select 1; | ||
| if (!isNil "_unit" && !isNull _unit) then { | ||
| (_x select 0) setMarkerPosLocal (visiblePosition _unit); | ||
| }; | ||
| } forEach _markersMedecin; | ||
| if (!visibleMap) exitWith {}; | ||
| sleep 0.02; | ||
| }; | ||
| {deleteMarkerLocal (_x select 0);} forEach _markersMedecin; | ||
| _markersMedecin = []; | ||
| _medics = []; | ||
| waitUntil {!visibleMap}; | ||
| {deleteMarkerLocal _x;} forEach _markers; | ||
| }; | ||
| /* | ||
| File: fn_medicMarkers.sqf | ||
| Author: Bryan "Tonic" Boardwine | ||
| Description: | ||
| Marks downed players on the map when it's open. | ||
| */ | ||
| private _deadMarkers = []; | ||
| private _medicMarkers = []; | ||
|
|
||
| { | ||
| if (side _x isEqualTo independent) then { | ||
| private _marker = createMarkerLocal [format ["%1_marker",_x],getPosATL _x]; | ||
| _marker setMarkerColorLocal "ColorIndependent"; | ||
| _marker setMarkerTypeLocal "Mil_dot"; | ||
| _marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
| _medicMarkers pushBack [_marker,_x]; | ||
| }; | ||
| } forEach (playableUnits - [player]); | ||
DomT602 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| { | ||
| private _name = _x getVariable "name"; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private _down = _x getVariable ["Revive",false]; | ||
| if (!isNil "_name" && !_down) then { | ||
| private _marker = createMarkerLocal [format ["%1_dead_marker",_x],getPosATL _x]; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _marker setMarkerColorLocal "ColorRed"; | ||
| _marker setMarkerTypeLocal "loc_Hospital"; | ||
| _marker setMarkerTextLocal format ["%1",_name]; | ||
| _deadMarkers pushBack _marker; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
| } forEach allDeadMen; | ||
|
|
||
| while {visibleMap} do { | ||
| { | ||
| _x params [ | ||
| ["_mark",""], | ||
| ["_unit",objNull] | ||
| ]; | ||
| if !(isNull _unit) then { | ||
| _mark setMarkerPosLocal (getPosATL _unit); | ||
| }; | ||
| } forEach _medicMarkers; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| sleep 0.01; | ||
DomT602 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| { | ||
| _x params [["_mark",""]]; | ||
| deleteMarkerLocal _mark; | ||
| } forEach _medicMarkers; | ||
|
|
||
| { | ||
| deleteMarkerLocal _x; | ||
| } forEach _deadMarkers; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.