For example, line 17 of refreshMainWindow.sqf (in modules_f.pbo\supports\procedures) is:
{ _total = 0; _type = _x; { _total = _total + (_x getVariable format ["BIS_SUPP_limit_%1", _type]) } forEach _requesterModules; player setVariable [format ["BIS_SUPP_limit_%1_total", _type], _total] } forEach [ "Artillery", "CAS_Heli", "CAS_Bombing", "UAV", "Drop", "Transport" ];
when one creates the "SupportRequester" module, they also have to define all of these variables, otherwise the function will throw an error.
We can use the alternative syntax of getVariable to fix this issue.
For example, the issues with the above case can be fixed using this regex:
find: (this regex can also account for most cases of getVariable format ... )
getVariable *([^[ ](.(?!getVariable))*BIS_SUPP_limit.*?(((?<!\[)["'](?!,))|(\])))
replace:
getVariable \[\1, 0\]
This fixes the above issue (must be used on all scripts in modules_f.pbo\supports)
The additional details provides a sample regex to find all getVariables not using the alternative syntax, if you want to fix them all. (although the default value for them can be different than 0)