many changes. includes rework of baselocation-asset storage format

This commit is contained in:
2024-02-05 17:42:31 -08:00
parent f450f4611b
commit f588ffa4a0
32 changed files with 657 additions and 382 deletions

View File

@@ -1,3 +1,5 @@
#include "..\script_component.hpp"
params [
["_className", "", [""]],
["_markerType", "hd_dot", [""]],
@@ -12,11 +14,11 @@ if (count _markerColor isEqualTo 0) exitWith {
["No marker color provided!"] call BIS_fnc_error;
};
if (count _assetObjects isEqualTo 0) exitWith {
["No vehicles provided!"] call BIS_fnc_error;
["No vehicles to draw markers for!"] call BIS_fnc_error;
};
private _baseMarkerStoreVar = "milsim_fbcb2_assets_baseMarkerStore";
private _assetMarkerStoreVar = "milsim_fbcb2_assets_assetMarkerStore";
private _baseMarkerStoreVar = QGVAR(baseMarkerStore);
private _assetMarkerStoreVar = QGVAR(assetMarkerStore);
private _baseMarkerStore = localNamespace getVariable [
_baseMarkerStoreVar,
@@ -35,15 +37,15 @@ if (not (count _baseMarkerStore > 0)) then {
// create a circle marker with range as the detection range of assets
_newMarker = createMarkerLocal [
format["milsim_fbcb2_assets_base_marker_%1", _forEachIndex + 1],
format["%1_%2", QGVAR(baseCircleMarker), _forEachIndex + 1],
getPosASL _base
];
_newMarker setMarkerTypeLocal "mil_dot";
_newMarker setMarkerColorLocal "ColorGreen";
_newMarker setMarkerShapeLocal "ELLIPSE";
_newMarker setMarkerSizeLocal [
milsim_fbcb2_assets_setting_detectionRangeFromBase,
milsim_fbcb2_assets_setting_detectionRangeFromBase
GVAR(setting_detectionRangeFromBase),
GVAR(setting_detectionRangeFromBase)
];
_newMarker setMarkerAlphaLocal 0.5;
_newMarker setMarkerTextLocal str(_forEachIndex + 1);
@@ -55,19 +57,19 @@ if (not (count _baseMarkerStore > 0)) then {
// create a flag marker at base position
_newMarker = createMarkerLocal [
format["milsim_fbcb2_assets_base_flag_marker_%1", _forEachIndex + 1],
format["%1_%2", QGVAR(baseFlagMarker), _forEachIndex + 1],
getPosASL _base
];
_newMarker setMarkerTypeLocal "mil_flag";
_newMarker setMarkerColorLocal "ColorGreen";
_newMarker setMarkerSizeLocal [0.7, 0.7];
_newMarker setMarkerTextLocal ([_base] call milsim_util_fnc_getNameOfBase);
_newMarker setMarkerTextLocal ([_base] call EFUNC(util,getNameOfBase));
_baseMarkerStore pushBack [
_base,
_newMarker
];
} forEach milsim_baseObjects;
} forEach GVARMAIN(baseObjects);
localNamespace setVariable [_baseMarkerStoreVar, _baseMarkerStore];
};
@@ -85,9 +87,12 @@ private _start = (count _assetMarkerStore) + 1;
> -1
) then {continue};
// check if the asset is within base detection range
if (not ([_asset] call FUNC(isAssetInRangeOfBase))) then {continue};
// create a marker for the asset
private _newMarker = createMarkerLocal [
format["milsim_fbcb2_assets_marker_%1", _start],
format["%1_%2", QGVAR(assetMarker), _start],
getPosASL _asset
];
_newMarker setMarkerAlphaLocal 1;