-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] - Added ZEN module for creating loadout lockers mid-mission. #155
Changes from 2 commits
3b6996a
4cee961
80dc576
e7a6d7e
b9337f4
5876c06
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "../macros.hpp" | ||
|
||
CLIENT_ONLY; | ||
|
||
params ["_position", "_unit"]; | ||
|
||
if ((!isNull _unit) and {_unit isKindOf "CAManBase"}) exitWith | ||
{ | ||
["Cannot use this module on units. Try on ground, vehicles or containers."] call zen_common_fnc_showMessage; | ||
}; | ||
|
||
private _createLocker = | ||
{ | ||
params ["_dialogValues", "_args"]; | ||
_dialogValues params ["_chosenFaction"]; | ||
_args params ["_position", "_unit"]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Am I missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with cre here, the fact that the locker always seems to be spawned even though the exitWith statement would suggest the user its usable on vics and containers seems contradictory |
||
|
||
private _lockerModel = ["Metal_Locker_F", "Land_OfficeCabinet_02_F"] select (isNull (configFile >> "CfgVehicles" >> "Metal_Locker_F")); | ||
private _locker = _lockerModel createVehicle [0,0,0]; | ||
_locker setPosASL _position; | ||
|
||
[_locker, _chosenFaction] remoteExec ["f_fnc_createLoadoutLocker", 0, _locker]; | ||
}; | ||
|
||
private _potentialSides = | ||
[ | ||
["BLUFOR", "blu_f"], | ||
["OPFOR", "opf_f"], | ||
["INDFOR", "ind_f"], | ||
["Civilian", "civ_f"], | ||
["Guerrilla", "blu_g_f"] | ||
]; | ||
|
||
private _sidesInUse = _potentialSides select { CRATE_REGISTRY_DYNAMIC(toLower (_x # 0)) isNotEqualTo [] }; | ||
|
||
[ | ||
"Choose Gearscript Side", | ||
[ | ||
["LIST", "Choose gearscript side", [_sidesInUse apply {_x#1}, _sidesInUse apply {_x#0}, 0, (count _sidesInUse)]] | ||
], | ||
_createLocker, | ||
{}, | ||
_this | ||
|
||
] call zen_dialog_fnc_create; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
call | ||
{ | ||
private _category = "[CAFE3] Logistics"; | ||
|
||
[ | ||
"[CAFE3] Logistics", | ||
_category, | ||
"Create / refill supply crate", | ||
f_fnc_zen_createSupplyCrate | ||
|
||
] call zen_custom_modules_fnc_register; | ||
|
||
[ | ||
_category, | ||
"Create Loadout Locker", | ||
f_fnc_zen_createLoadoutLocker | ||
|
||
] call zen_custom_modules_fnc_register; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the function is called on, say, an object (e.g. by placing the Zeus module on a vehicle)? This condition won't catch that, so the function continues to run, causing the dialog to pop up. Not critical, but... odd? Is this intended?