astruyk / Ares

An arma3 mod that adds some extra functionality to Zeus
51 stars 11 forks source link

Spawn - Add support for spawning map-specific assets #84

Closed astruyk closed 10 years ago

astruyk commented 10 years ago

Would be nice to have a way for Zeus to spawn map-specific assets and/or groups. For example, the assembly point signs, custom-skinned mowhawks, or groups from CAF-Agressors (which isn't legit supported by Zeus ATM).

I think it could work something like this:

[
  "Name Of Custom Object",
  { /* code to run to do the magic. return array of created objects to add to Zeus. */},
  ["Setting A", <valueToPassToScriptForSettingA>, "Setting B", <valueToPassToScriptForSettingB>, ....]
] spawnVM "Ares_AddMissionSpecificObject.sqf";

where the Ares_AddMissionSpecificObject.sqf function would simply store the provided parameters in a global array. Ares would have a new module in the 'Spawn' category called 'Spawn Map Specific Objects'. That would go through the global var and create a dynamic choose box for each of the entries and another for the settings (if any are specified). Then, on approval, it would call the selected code, passing in the location where the user wanted it and the option they selected (if any).

astruyk commented 10 years ago

Done (without custom parameter functionality). You can now do the following in a mission (with the appropriate script of course):

[
    [
        "CH-146 Griffon Helicopter (Empty)",
        {
            _vehicle = "I_Heli_light_03_F" createVehicle (_this select 0);
            [_vehicle] call PO3_fnc_setAsLiftChopper;
            _vehicle setObjectTextureGlobal [0, "customSkins\CH146_0.paa"];
            _vehicle;
        }
    ],
    [
        "CH-148 Cyclone Helicopter (Empty)",
        {
            _vehicle = "I_Heli_Transport_02_F" createVehicle (_this select 0);
            [_vehicle] call PO3_fnc_setAsLiftChopper;
            _vehicle setObjectTextureGlobal [0, "customSkins\CH148_0.paa"];
            _vehicle setObjectTextureGlobal [1, "customSkins\CH148_1.paa"];
            _vehicle setObjectTextureGlobal [2, "customSkins\CH148_2.paa"];
            _vehicle;
        }
    ]
] execVM "Ares_CreateCustomMissionObject.sqf";