forge/arma/server/addons/task/functions/helpers/fnc_parseRewards.sqf
Jacob Schmidt 0cd6509337 Refactor phone and task systems around repositories
- Rename phone class to repository and update client event handlers
- Split task helpers/modules/prototypes and add mission generator flow
- Add reward parsing, mission manager startup, and attack logging
2026-05-02 01:29:25 -05:00

41 lines
917 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: OpenAI
* Parses an Eden module reward-array string into a SQF array.
*
* Arguments:
* 0: Raw value <STRING>
* 1: Task label <STRING>
* 2: Reward key <STRING>
*
* Return Value:
* Parsed reward array <ARRAY>
*
* Example:
* [_logic getVariable ["EquipmentRewards", "[]"], "attack_01", "equipment"] call forge_server_task_fnc_parseRewards;
*
* Public: No
*/
params [
["_rawValue", "[]", [""]],
["_taskLabel", "", [""]],
["_rewardKey", "", [""]]
];
private _trimmed = trim _rawValue;
if (_trimmed isEqualTo "") exitWith { [] };
private _parsed = parseSimpleArray _trimmed;
if (_parsed isEqualType []) exitWith { _parsed };
["WARNING", format [
"Task module '%1' reward input '%2' is invalid: %3. Expected SQF array syntax like [""ItemGPS"",""FirstAidKit""].",
_taskLabel,
_rewardKey,
_rawValue
]] call EFUNC(common,log);
[]