-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for other entrenching tools
- Loading branch information
Showing
12 changed files
with
43 additions
and
7 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 |
---|---|---|
|
@@ -12,5 +12,7 @@ class CfgWeapons { | |
class ItemInfo: CBA_MiscItem_ItemInfo { | ||
mass = 10; | ||
}; | ||
|
||
GVAR(entrenchingTool) = 1; | ||
}; | ||
}; |
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,10 @@ | ||||||||||
#include "script_component.hpp" | ||||||||||
|
||||||||||
#include "XEH_PREP.hpp" | ||||||||||
|
||||||||||
private _entrenchingTools = []; | ||||||||||
|
||||||||||
uiNamespace setVariable [ | ||||||||||
QGVAR(entrenchingTools), | ||||||||||
compileFinal str (QUOTE(getNumber (_x >> QQGVAR(entrenchingTool)) > 0) configClasses (configFile >> "CfgWeapons") apply {configName _x}) | ||||||||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
veteran29
Author
Member
|
uiNamespace setVariable [QGVAR(vehicleClasses_classEH), compileFinal str _vehicleClasses_addClassEH]; | |
uiNamespace setVariable [QGVAR(objectClasses_classEH), compileFinal str _objectClasses_addClassEH]; | |
uiNamespace setVariable [QGVAR(initializedVehicleClasses), compileFinal str _vehicleClasses_addAction]; | |
uiNamespace setVariable [QGVAR(initializedItemClasses), compileFinal str _itemClasses_addAction]; |
The main rationale that comes to mind is that preStart is done once and preInit is done on every mission load.
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
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,24 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: veteran29 | ||
* Checks if unit has entrenching tool. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* Has entrenching tool <BOOL> | ||
* | ||
* Example: | ||
* [bob] call ace_trenches_fnc_hasEntrenchingTool | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [ | ||
["_unit", objNull, [objNull]] | ||
]; | ||
|
||
private _uniqueItems = _unit call EFUNC(common,uniqueItems); | ||
|
||
GVAR(entrenchingTools) findIf {_x in _uniqueItems} != -1 // return |
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
What's the advantage to deferring the config read from preStart to preInit? I guess this allows script modification of what's considered an entrenching tool. Is that why?
In any case, probably worth adding a comment with the rationale