2015-01-11 16:42:31 +00:00
/*
* Author: CAA-Picard
*
2015-01-12 04:02:33 +00:00
* Reads a numeric value from a module, sets de ACE_Parameter. Logs if parameters are missing in the module.
2015-01-11 16:42:31 +00:00
*
* Arguments:
* 0: Module (Object)
2015-01-12 04:02:33 +00:00
* 1: ACE_Parameter name (string)
2015-01-11 16:42:31 +00:00
* 2: Module parameter name (string)
*
* Return Value:
* None
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-01-11 16:42:31 +00:00
2015-01-12 04:02:33 +00:00
private ["_logic", "_parameterName", "_moduleParameterName", "_value"];
2015-01-11 16:42:31 +00:00
_logic = _this select 0;
2015-01-12 04:02:33 +00:00
_parameterName = _this select 1;
2015-01-11 16:42:31 +00:00
_moduleParameterName = _this select 2;
// Check if the parameter is defined in the module
if (isNil {_logic getVariable _moduleParameterName}) exitWith {
2015-01-12 04:02:33 +00:00
diag_log text format["[ACE]: Warning in %1 module: %2 parameter is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleParameterName]
2015-01-11 16:42:31 +00:00
};
// Check if the value is defined as string for backward compatibility
_value = _logic getVariable _moduleParameterName;
if (typeName _value == "STRING") then {
_value = parseNumber _value;
};
// Set the parameter
2015-01-12 04:02:33 +00:00
[_parameterName, _value] call FUNC(setParameter);