-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add garrison and un-garrison modules * Remove unnecessary text from garrison header * Add french translations to new strings * Add changes requested by review * Change pushback to pushBack * Move garrison funcs to ai, finish headers * Remove diag log debug * Fix typos and header issues * Add missing newlines * Fix strings, Fix typos and headers * Enable debug and disable compile cache, Add trace and comments * Rebase before review * Fix default case running instead of case 3 * Fix edge case related to players being in garrison group The player would make the enableAttack checks in ungarrison and garrisonMove fail, this is now fixed. * Fix some arrays in garrsionMove and garrison * Relax distance checks in garrisonMove, change AI behaviour while pathing to aware * Add debug view * Remove unused var, fix unit pos using the wrong format * Make debug more visually pleasing * Change garrison debug target to a waypoint icon * Change disableAI event to AISection, comment out doFollow in doMove EH * Fix locality issue
- Loading branch information
1 parent
ed1e951
commit bb03f55
Showing
22 changed files
with
979 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preStart)); | ||
}; | ||
}; | ||
|
||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_preInit)); | ||
}; | ||
}; | ||
|
||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_FILE(XEH_postInit)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
PREP(garrison); | ||
PREP(unGarrison); | ||
PREP(garrisonMove); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#include "script_component.hpp" | ||
|
||
[QGVAR(AISection), { | ||
params [["_units", [], [[]]], ["_sections", [], [[]]], ["_bool", true, [true]]]; | ||
{ | ||
private _section = _x; | ||
{ | ||
if (_bool) then { | ||
_x enableAI _section; | ||
} else { | ||
_x disableAI _section; | ||
}; | ||
LOG(format [ARR_4("XEH_postInit: %1 disableAI %2 | ID %3", _x, _section, clientOwner)]); | ||
} foreach (_units select {local _x}); | ||
} foreach _sections | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
[QGVAR(unGarrison), FUNC(unGarrison)] call CBA_fnc_addEventHandler; | ||
[QGVAR(doMove), { | ||
params ["_unitsArray"]; | ||
{ | ||
_x params ["_unit", "_pos"]; | ||
//_unit doFollow leader _unit; | ||
_unit setDestination [_pos, "LEADER PLANNED", true]; | ||
_unit doMove _pos; | ||
LOG(format [ARR_4("XEH_postInit: %1 doMove %2 | ID %3", _unit, _pos, clientOwner)]); | ||
} foreach _unitsArray | ||
}] call CBA_fnc_addEventHandler; | ||
[QGVAR(setBehaviour), { | ||
params ["_groupsArray", "_behaviour"]; | ||
{ | ||
_x params ["_group"]; | ||
_group setBehaviour _behaviour; | ||
LOG(format [ARR_4("XEH_postInit: %1 setBehaviour %2 | ID %3", _group, _behaviour, clientOwner)]); | ||
} foreach _groupsArray | ||
}] call CBA_fnc_addEventHandler; | ||
[QGVAR(enableAttack), { | ||
params ["_unitsArray", "_mode"]; | ||
{ | ||
_x params ["_unit"]; | ||
_unit enableAttack _mode; | ||
LOG(format [ARR_4("XEH_postInit: %1 enableAttack %2 | ID %3", _unit, _mode, clientOwner)]); | ||
} foreach _unitsArray | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
#ifdef DEBUG_MODE_FULL | ||
addMissionEventHandler ["Draw3D", { | ||
private _unitMoveList = missionNameSpace getVariable [QGVAR(garrison_unitMoveList), []]; | ||
|
||
{ | ||
_x params ["_unit", "_pos"]; | ||
|
||
switch true do { | ||
case (surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { | ||
for "_i" from 0 to 3 do { | ||
drawLine3D [_unit modelToWorldVisualWorld [0,0,1], (AGLtoASL _pos), [1,0,0,1]]; | ||
}; | ||
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; | ||
}; | ||
|
||
case (!surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { | ||
for "_i" from 0 to 3 do { | ||
drawLine3D [_unit modelToWorldVisual [0,0,1], _pos, [1,0,0,1]]; | ||
}; | ||
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75]; | ||
}; | ||
|
||
case (!surfaceIsWater (getPos _unit) && {surfaceIsWater _pos}) : { | ||
for "_i" from 0 to 3 do { | ||
drawLine3D [_unit modelToWorldVisual [0,0,1], (AGLToASL _pos), [1,0,0,1]]; | ||
}; | ||
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], (AGLtoASL _pos), 0.75, 0.75, 0.75]; | ||
}; | ||
|
||
case (surfaceIsWater (getPos _unit) && {!surfaceIsWater _pos}) : { | ||
for "_i" from 0 to 3 do { | ||
drawLine3D [_unit modelToWorldVisualWorld [0,0,1], _pos, [1,0,0,1]]; | ||
}; | ||
drawIcon3D ["\a3\ui_f\data\map\groupicons\waypoint.paa", [1,0,0,1], _pos, 0.75, 0.75, 0.75]; | ||
}; | ||
}; | ||
} foreach _unitMoveList; | ||
}]; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "script_component.hpp" | ||
|
||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ class CfgPatches { | |
}; | ||
|
||
#include "CfgWeapons.hpp" | ||
#include "CfgEventHandlers.hpp" |
Oops, something went wrong.