Skip to content

Commit

Permalink
Merge pull request #299 from Global-Conflicts-ArmA/dev
Browse files Browse the repository at this point in the history
Dev to master 1.1.8
  • Loading branch information
joewhite94 authored Sep 30, 2024
2 parents 835390b + a376f1a commit 41d25cc
Show file tree
Hide file tree
Showing 135 changed files with 2,635 additions and 1,445 deletions.
4 changes: 3 additions & 1 deletion core/functions/fn_eventSpawned.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ if (
) then {
private _newCurrent = _current + 1;
private _newTotal = _total + 1;
TRACE_3("Setting new alive count",_unit,_newTotal,_newCurrent);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_3("Setting new alive count",_unit,_newTotal,_newCurrent);
};
(_team select 0) set [3, _newTotal];
(_team select 0) set [4, _newCurrent];
};
Expand Down
8 changes: 6 additions & 2 deletions core/functions/fn_untrackUnit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
params ["_unit", ["_forcedSide", sideEmpty, [sideEmpty]]];

private _forced = _forcedSide isNotEqualTo sideEmpty;
TRACE_2("untrackUnit",_unit,_forced);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_2("untrackUnit",_unit,_forced);
};

if (GETVAR(_unit,Tracked,false) || {_forced}) then {
private _team = GVAR(Teams) select {
Expand All @@ -40,7 +42,9 @@ if (GETVAR(_unit,Tracked,false) || {_forced}) then {
) then {
private _newCurrent = _current - 1;
private _newTotal = _total - 1;
TRACE_3("Setting new alive count",_unit,_newTotal,_newCurrent);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_3("Setting new alive count",_unit,_newTotal,_newCurrent);
};
(_team select 0) set [3, _newTotal];
(_team select 0) set [4, _newCurrent];
};
Expand Down
2 changes: 2 additions & 0 deletions core/preinitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ if (
{(toLower serverName) find "main" isNotEqualTo -1}
) then {
GVAR(debugMessagesEnabled) = false;
GVAR(verboseDebugEnabled) = false;
} else {
GVAR(debugMessagesEnabled) = ([missionConfigFile >> QGVAR(debugSettings) >> "debugMessagesEnabled", "number", 1] call CBA_fnc_getConfigEntry) == 1;
GVAR(verboseDebugEnabled) = ([missionConfigFile >> QGVAR(debugSettings) >> "verboseDebugEnabled", "number", 0] call CBA_fnc_getConfigEntry) == 1;
};

GVAR(DiaryRecords) = [];
Expand Down
12 changes: 9 additions & 3 deletions core/preinitServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ GVAR(UsedGearTypes) = [];

[QGVAR(spawnedEvent), {
params ["_unit"];
TRACE_1("spawned Event",_unit);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_2("spawned Event",_unit,typeOf _unit);
};
[{CBA_missionTime > 3}, {
params ["_unit"];
_unit call FUNC(eventSpawned);
Expand All @@ -19,13 +21,17 @@ GVAR(UsedGearTypes) = [];

[QGVAR(untrackEvent), {
params ["_unit", ["_forced", sideEmpty, [sideEmpty]]];
TRACE_2("untrack Event",_unit,_forced);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_2("untrack Event",_unit,_forced);
};
[_unit, _forced] call FUNC(untrackUnit);
}] call CBA_fnc_addEventHandler;

[QGVAR(killedEvent), {
params [["_unit", objNull, [objNull]], ["_killer", objNull, [objNull]]];
TRACE_2("killed Event",_unit,_killer);
if (GETMVAR(verboseDebugEnabled,false)) then {
TRACE_2("killed Event",_unit,_killer);
};
[_unit, _killer] call FUNC(EventKilled);
}] call CBA_fnc_addEventHandler;

Expand Down
5 changes: 5 additions & 0 deletions core/xeh/fn_initCAManBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@ params ["_unit"];
//LOG("Spawned_Event called");

if !(local _unit) exitWith {};
if (
_unit isKindOf "B_UAV_AI" ||
_unit isKindOf "O_UAV_AI" ||
_unit isKindOf "I_UAV_AI"
) exitWith {};

[QGVAR(spawnedEvent), [_unit]] call CBA_fnc_serverEvent;
5 changes: 5 additions & 0 deletions core/xeh/fn_killedCAManBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

params ["_unit"];
if !(local _unit) exitWith {};
if (
_unit isKindOf "B_UAV_AI" ||
_unit isKindOf "O_UAV_AI" ||
_unit isKindOf "I_UAV_AI"
) exitWith {};

LOG("Killed_Event called");
[QGVAR(KilledEvent), _unit] call CBA_fnc_serverEvent;
Expand Down
5 changes: 5 additions & 0 deletions core/xeh/fn_respawnCAManBase.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

params ["_unit", "_body"];
if !(local _unit) exitWith {};
if (
_unit isKindOf "B_UAV_AI" ||
_unit isKindOf "O_UAV_AI" ||
_unit isKindOf "I_UAV_AI"
) exitWith {};

LOG("Respawned_Event called");
//Makes the player go into spectator mode when dead or respawn if he has respawn tickets
Expand Down
1 change: 1 addition & 0 deletions customization/debugSettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ testingDisableFriendlyAI = false;

// Only disable debug messages when the mission is released
debugMessagesEnabled = true;
verboseDebugEnabled = false;
20 changes: 10 additions & 10 deletions customization/endConditions.sqf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
private _westCasualty = "USMC" call FUNC(CasualtyPercentage); //Gets the casualty percentage of team "USMC"
private _eastCasualty = "VDV" call FUNC(CasualtyPercentage); //Gets the casualty percentage of team "VDV"

if (_westCasualty >= 50) exitWith {
"VDV VICTORY<br />USMC has retreated due to casualties." call FUNC(EndMission);
};

if (_eastCasualty >= 75) exitWith {
"USMC VICTORY<br />VDV has retreated due to casualties." call FUNC(EndMission);
};
//private _westCasualty = "USMC" call FUNC(CasualtyPercentage); //Gets the casualty percentage of team "USMC"
//private _eastCasualty = "VDV" call FUNC(CasualtyPercentage); //Gets the casualty percentage of team "VDV"
//
//if (_westCasualty >= 50) exitWith {
// "VDV VICTORY<br />USMC has retreated due to casualties." call FUNC(EndMission);
//};
//
//if (_eastCasualty >= 75) exitWith {
// "USMC VICTORY<br />VDV has retreated due to casualties." call FUNC(EndMission);
//};

/*
Soft Ending the Mission
Expand Down
64 changes: 38 additions & 26 deletions modules/ao_limit/functions/AOLIM/fn_init.sqf
Original file line number Diff line number Diff line change
@@ -1,50 +1,62 @@
#include "script_component.hpp"

private _anySide = sideEmpty;
private _processingMarkers = [];
private _allowedOutside = true;
private _vehicle = (vehicle player);
private _startPos = getPosATL _vehicle;
player setVariable [QGVAR(pos), _startPos, false];

GVAR(markers) apply {
_x params ["_side", "_name"];

if (_side == (side player) || _side == _anySide) then {
_processingMarkers pushBack _name;

if (_vehicle inArea _name) then {
if (_side == (side player) || _side == sideEmpty) then {
if (_vehicle inArea _name) exitWith {
_allowedOutside = false;
};
};
};

/* diag_log format ["INFO: Processing markers = %1", _processingMarkers]; */

private _delay = 0.1;
[{
(_this select 0) params ["_vehicle1", "_processingMarkers1", "_allowedOutside1", "_startPos1"];
_vehicle1 = (vehicle player);
private _pos = player getVariable [QGVAR(pos), _startPos1];

if !(_vehicle1 isKindOf "Air") then {
GVAR(mainAOLimitLoop) = [{
params ["_args", "_idPFH"];
_args params [
"_allowedOutside",
"_lastInPos"
];
if (GVAR(markers) isEqualTo []) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _vehicle = (vehicle player);
if !(_vehicle isKindOf "Air") then {
private _outSide = true;
_processingMarkers1 apply {
if (_vehicle1 inArea _x) exitWith {
_outSide = false;
//TRACE_1("starting AOLIMIT loop", GVAR(markers));
GVAR(markers) apply {
_x params ["_side", "_name"];
if (_side == (side player) || _side == sideEmpty) then {
if (_vehicle inArea _name) exitWith {
_outSide = false;
//TRACE_1("in AO marker", _name);
};
};
};

if (_outSide) then {
if (!(_allowedOutside1) && (_vehicle1 call EFUNC(FW,isAlive)) && local _vehicle1) then {
_vehicle1 setPosATL _pos;
_vehicle1 setVelocity (velocity _vehicle1 apply {- _x});
if (
!(_allowedOutside) &&
{(_vehicle call EFUNC(FW,isAlive))} &&
{local _vehicle}
) then {
//TRACE_1("outside all AOs, resetting pos", _lastInPos);
_vehicle setPosATL _lastInPos;
_vehicle setVelocity (velocity _vehicle apply {- _x});
} else {
//TRACE_1("outside all AOs but allowed", _lastInPos);
};
} else {
_allowedOutside1 = false;
player setVariable [QGVAR(pos), (getPosATL _vehicle1), false]
_lastInPos = getPosATL _vehicle;
//TRACE_1("in AO limit", _lastInPos);
_allowedOutside = false;
_args set [0, _allowedOutside];
_args set [1, _lastInPos];
};
} else {
_allowedOutside1 = true;
_allowedOutside = true;
};
}, _delay, [_vehicle, _processingMarkers, _allowedOutside, _startPos]] call CBA_fnc_addPerFrameHandler;
}, 0, [_allowedOutside, _startPos]] call CBA_fnc_addPerFrameHandler;
2 changes: 1 addition & 1 deletion modules/ao_limit/postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ GVAR(markers) = [];

#include "settings.sqf"

if ((count GVAR(markers)) > 0) then {
if (GVAR(markers) isNotEqualTo []) then {
[] call FUNC(init);
};
10 changes: 10 additions & 0 deletions modules/cover_map/functions/CoverMap/fn_live.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

//Covers Map outside marker and centers map on marker center in game map
if !(hasinterface) exitwith {};

params [
"_marker",
["_centered", true, [true]],
Expand All @@ -10,6 +11,15 @@ params [
["_bgColour", "BH_checkLOS_colorNotVisible", [""]],
["_condition", true, [true, {}]]
];

if (count _this isEqualTo 1) then {
private _AOArray = GVAR(AONamespace) getOrDefault [_marker, []];;
_centered = _AOArray select 0;
_zoomlevel = _AOArray select 1;
_name = _AOArray select 2;
_bgColour = _AOArray select 3;
_condition = _AOArray select 4;
};

//delete old markers if present
if !(GVAR(map_cover) isEqualTo []) then {
Expand Down
2 changes: 1 addition & 1 deletion modules/cover_map/preinitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GVAR(map_currentAO) = "";
["_zoomLevel", 0.4, [0]],
["_name", "", [""]],
["_bgColour", "ColorBlack", [""]],
["_condition", true, [true, {}]]
["_condition", false, [false, {}]]
];
private _text = "Switch Map to " + _name;
private _MapChangeAction = ["switch_MapAO", _text, "", {
Expand Down
26 changes: 13 additions & 13 deletions modules/headless_ai/cfgFunctions/FSM/AIBEHAVIORTEST.fsm
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ class FSM
name = "Release_from_Bun";
itemno = 41;
init = /*%FSM<STATEINIT""">*/"(group _unit) setBehaviour ""AWARE"";" \n
"_unit dowatch objnull;" \n
"_unit dowatch objNull;" \n
"_unit doFollow (leader _unit);" \n
"_unit enableAI ""PATH"";" \n
"_unit enableAI ""AIMINGERROR"";" \n
Expand Down Expand Up @@ -1326,11 +1326,11 @@ class FSM
{
name = "Reset_Vector_";
itemno = 47;
init = /*%FSM<STATEINIT""">*/"_group setvariable [""PZAI_CurrentTarget"",objnull];" \n
init = /*%FSM<STATEINIT""">*/"_group setvariable [""PZAI_CurrentTarget"",objNull];" \n
"_laserTarget setposASL _laserPos;" \n
"[_unit,_laserTarget,_laserTarget] call PZAI_fnc_WatchEnemy;" \n
"private _invisibleTarget = (_unit getvariable [""PZAI_InvisibleTarget"",objnull]);" \n
"if (_invisibleTarget isNotEqualTo objnull) then {" \n
"private _invisibleTarget = (_unit getvariable [""PZAI_InvisibleTarget"",objNull]);" \n
"if (_invisibleTarget isNotEqualTo objNull) then {" \n
" _invisibleTarget setPosASL [0,0,0];" \n
"};" \n
"" \n
Expand Down Expand Up @@ -1767,7 +1767,7 @@ class FSM
"" \n
"if ((leader _group) isEqualTo _unit) then {" \n
" _group setvariable [""PZAI_Mission"",""BUNKER""];" \n
" _group setvariable [""PZAI_CurrentTarget"",objnull];" \n
" _group setvariable [""PZAI_CurrentTarget"",objNull];" \n
" _group setvariable [""PZAI_InitialWPSet"",true];" \n
"};" \n
"" \n
Expand Down Expand Up @@ -1823,7 +1823,7 @@ class FSM
{
name = "Reset_Target";
itemno = 92;
init = /*%FSM<STATEINIT""">*/"_group setvariable [""PZAI_CurrentTarget"",objnull];" \n
init = /*%FSM<STATEINIT""">*/"_group setvariable [""PZAI_CurrentTarget"",objNull];" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
Expand Down Expand Up @@ -1898,7 +1898,7 @@ class FSM
"};" \n
"_currentmission = _group getvariable [""PZAI_Mission"",""NONE""];" \n
"_InitialWaypointSet = _group getvariable [""PZAI_InitialWPSet"",false];" \n
"_currenttarget = _group getvariable [""PZAI_CurrentTarget"",objnull];" \n
"_currenttarget = _group getvariable [""PZAI_CurrentTarget"",objNull];" \n
"if (PZAI_VerboseDebug) then {" \n
"diag_log format [""check %1 mission: %2 WPSet: %3 target: %4"",_group,_currentmission,_InitialWaypointSet,_currenttarget];" \n
"};"/*%FSM</STATEINIT""">*/;
Expand Down Expand Up @@ -2048,7 +2048,7 @@ class FSM
priority = 2.000000;
to="Radio_Check";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((_currentTarget isNotEqualTo objnull))"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((_currentTarget isNotEqualTo objNull))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"if (PZAI_VerboseDebug) then {" \n
" diag_log format [""_target set for: %1"",_group];" \n
"};"/*%FSM</ACTION""">*/;
Expand All @@ -2061,7 +2061,7 @@ class FSM
priority = 1.000000;
to="Execute_Count__1_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_currentTarget isEqualto objnull)"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_currentTarget isEqualto objNull)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"if (PZAI_VerboseDebug) then {" \n
" diag_log format [""_group: %1 leadercheck target not set"",_group];" \n
"};" \n
Expand Down Expand Up @@ -2226,7 +2226,7 @@ class FSM
priority = 3.000000;
to="Check_State_of_E";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_ClosestTarget isEqualto objnull) "/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(_ClosestTarget isEqualto objNull) "/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
Expand All @@ -2237,7 +2237,7 @@ class FSM
priority = 2.000000;
to="Set_Target_as_Cu";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((_group getvariable [""PZAI_CurrentTarget"",objnull]) isEqualto objnull)"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((_group getvariable [""PZAI_CurrentTarget"",objNull]) isEqualto objNull)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
Expand All @@ -2248,7 +2248,7 @@ class FSM
priority = 1.000000;
to="Check_State_of_E";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((!((_group getvariable [""PZAI_CurrentTarget"",objnull]) isEqualto objnull)) && {(_targetdistancediff < 100)}) || (_currentTarget isEqualto _ClosestTarget)"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((!((_group getvariable [""PZAI_CurrentTarget"",objNull]) isEqualto objNull)) && {(_targetdistancediff < 100)}) || (_currentTarget isEqualto _ClosestTarget)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
Expand Down Expand Up @@ -2794,7 +2794,7 @@ class FSM
priority = 1.000000;
to="____FAKE____";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(!((_group getvariable [""PZAI_CurrentTarget"",objnull]) isEqualto objnull))"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(!((_group getvariable [""PZAI_CurrentTarget"",objNull]) isEqualto objNull))"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
Expand Down
Loading

0 comments on commit 41d25cc

Please sign in to comment.