#include "..\script_component.hpp" /* * Function: forge_server_db_fnc_loadFromMission * Author: J. Schmidt * * Description: * Loads data from mission profile namespace * * Arguments: * 0: _name - Store name * 1: _key - Key to retrieve * 2: _keyField - Field of the key to retrieve * * Return Value: * Retrieved data */ params [["_name", "", [""]], ["_key", "", [""]], ["_keyField", "", [""]]]; if (_name isEqualTo "") exitWith { ERROR_MSG("Store name cannot be empty"); nil }; private _store = missionProfileNamespace getVariable _name; if (isNil "_store") exitWith { ERROR_MSG_1("Store %1 not found",_name); nil }; if (_key isEqualTo "") then { _store } else { _store get _key }; if (_keyField isNotEqualTo "") then { private _keyData = _store get _key; if (isNil "_keyData") exitWith { ERROR_MSG_3("KeyField %1 not found in key %2 of store %3",_keyField,_key,_name); nil }; _keyData get _keyField };