-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #104 and also probably last big refactor - split "legacy" module …
…into "lifecycle" and "activities" (#106) * add vanilla military buildings to exclusion lists, put lists into GVARs * addNestedStateMachine to nest another machine within a compound state * split legacy -> activities,lifecycle * move % rename lots of settings * move civClasses setting, localCivs array & getter, civ_added|removed events into lifecycle module * unify & fix dismount conditions, add (!not driver)
- Loading branch information
1 parent
b9552b8
commit 00b5bd8
Showing
160 changed files
with
381 additions
and
276 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
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 @@ | ||
z\grad_civs\addons\activities |
File renamed without changes.
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
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,11 @@ | ||
#include "script_component.hpp" | ||
|
||
if (!(EGVAR(main,enabled))) exitWith {}; | ||
|
||
[] call FUNC(initCommonEventhandlers); | ||
|
||
if (isServer || CBA_isHeadlessClient) then { | ||
["lifecycle", ["lfc_life"], FUNC(sm_emotions)] call EFUNC(common,augmentStateMachine); | ||
["lifecycle", ["lfc_life"], FUNC(sm_activities)] call EFUNC(common,augmentStateMachine); | ||
[QEGVAR(lifecycle,civ_added), FUNC(onCivAdded)] call CBA_fnc_addEventHandler; | ||
}; |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
#include "..\script_component.hpp" | ||
|
||
INFO("initConfig running..."); | ||
|
||
private _settingsGroup = ["GRAD Civs", "4) basic activities - panicking"]; | ||
|
||
[ | ||
QGVAR(panicCooldown), | ||
"EDITBOX", | ||
"Time for panic to wear off [low, med, high]", | ||
_settingsGroup, | ||
QUOTE([ARR_3(15,120,240)]), | ||
false, | ||
{}, | ||
false | ||
] call CBA_fnc_addSetting; |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
params [ | ||
["_civ", objNull, [objNull]] | ||
]; | ||
if (!local _civ) exitWith {}; | ||
|
||
private _panicCooldown = [GVAR(panicCooldown)] call EFUNC(common,parseCsv); | ||
_civ setVariable["GRAD_CIVS_PANICCOOLDOWN" , random _panicCooldown, true]; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
#define COMPONENT activities | ||
#include "\z\grad_civs\addons\main\script_mod.hpp" | ||
|
||
// #define DEBUG_MODE_FULL | ||
// #define DISABLE_COMPILE_CACHE | ||
|
||
#ifdef DEBUG_ENABLED_MAIN | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
#ifdef DEBUG_SETTINGS_MAIN | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN | ||
#endif | ||
|
||
#include "\z\grad_civs\addons\main\script_macros.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PREP(dismountCondition); | ||
PREP(getGlobalVehicles); | ||
PREP(getGroupVehicle); | ||
PREP(initConfig); | ||
|
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
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
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" | ||
|
||
if (leader _this != _this) exitWith {true}; | ||
|
||
if (driver vehicle _this != _this) exitWith {true}; | ||
|
||
if (!(canMove vehicle _this)) exitWith {true}; | ||
|
||
(([_this, "emotions"] call EFUNC(common,civGetState)) == "emo_panic") || (_this call EFUNC(interact,sm_activities_helper_surrenderCondition)) |
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
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
4 changes: 1 addition & 3 deletions
4
addons/cars/functions/fnc_sm_business_trans_mountUp_dismount_condition.sqf
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#include "..\script_component.hpp" | ||
|
||
if (leader _this != _this) exitWith {true}; | ||
|
||
(([_this, "emotions"] call EFUNC(common,civGetState)) == "emo_panic") || (_this call EFUNC(interact,sm_activities_helper_surrenderCondition)) | ||
_this call FUNC(dismountCondition); |
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
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
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
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
16 changes: 16 additions & 0 deletions
16
addons/cba_statemachine/functions/fnc_addNestedStateMachine.sqf
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,16 @@ | ||
#include "..\script_component.hpp" | ||
|
||
params [ | ||
["_outerStateMachine", locationNull, [locationNull]], | ||
["_outerState", "", [""]], | ||
["_nestedStateMachine", locationNull, [locationNull]] | ||
]; | ||
|
||
if (!(_nestedStateMachine isEqualType locationNull)) exitWith {ERROR_1("when trying to adding state machine %1: is not CBA state machine!", _nestedStateMachine);}; | ||
|
||
private _nestedStateMachines = _outerStateMachine getVariable [NESTED(_outerState), false]; | ||
if (!(_nestedStateMachines isEqualType [])) exitWith {ERROR_2("state %1 of %2 is not a compound state!", _outerState, _outerStateMachine)}; | ||
|
||
_nestedStateMachines pushBackUnique _nestedStateMachine; | ||
|
||
_outerStateMachine setVariable [NESTED(_outerState), _nestedStateMachines]; |
Oops, something went wrong.