ArmaAchilles / Achilles

Achilles is a gameplay modification for Arma 3. It expands the Zeus real-time editor with many new additions as well as provides bug fixes.
Other
77 stars 54 forks source link

Ares_fnc_RegisterCustomModule not working as documented. #520

Open VileAce opened 4 years ago

VileAce commented 4 years ago

Arma 3 Version: 1.98 stable CBA Version: 3.15.1 stable Achilles Version: v1.3.1

Mods:

Description:

Steps to reproduce: In the debug console or the Execute Code module enter code from example:

if (!isNull (getAssignedCuratorLogic player) && {isClass (configFile >> "CfgPatches" >> "achilles_modules_f_achilles")}) then
{
waitUntil {missionnamespace getvariable ["BIS_moduleMPTypeGameMaster_init", false] and {not isNil "ares_category_list"}};
    ["Module Category", "Module Name", 
    {
        params [["_position", [0,0,0], [[]], 3], ["_objectUnderCursor", objNull, [objNull]]];

        systemChat str _position;
        systemChat str _objectUnderCursor;
    }] call Ares_fnc_RegisterCustomModule;
}

or

["My Category", "My Module",
{
    params [["_position", [0,0,0], [[]], 3], ["_objectUnderCursor", objNull, [objNull]]];

    private _selectedObjects = if (isNull _objectUnderCursor) then
    {
        ["Objects"] call Achilles_fnc_SelectUnits;
    }
    else
    {
        [_objectUnderCursor];
    };

    if (isNil "_selectedObjects") exitWith {};

    if (_selectedObjects isEqualTo []) exitWith 
    {

        ["No object was selected!"] call Achilles_fnc_showZeusErrorMessage;
    };

    systemChat format ["Position: %1 and Selected objects: %2", _position, _selectedObjects];
}] call Ares_fnc_RegisterCustomModule;

Close Zeus interface Open Zeus interface Look for Category and module Only Category is created.