Supply box init fields.

  1. 8 years ago

    Trying to add this to init of the supply drops:
    _supplybox = _this select 0;

    for "_x" from 1 to 10 do
    {
    _supplyLight = "Chemlight_green" createVehicle (position _supplybox);
    _supplyLight attachTo [_supplybox, [0,0,0]];
    _supplySmoke = "SmokeShellGreen" createVehicle (position _supplybox);
    _supplySmoke attachTo [_supplybox, [0,0,0]];
    sleep 30;
    };

    Just wondering where (I cannot find anywhere).

    Yes, yes I lost my supplies :(

  2. Edited 8 years ago by DaVidoSS

    There are only one possibility using CBA.

    description.ext

    class Extended_Init_EventHandlers {
    class Box_NATO_AmmoVeh_F {
    	init = "(_this select 0) call (compile preprocessFileLineNumbers 'supplysmoke.sqf')";
         };
    };

    supplysmoke.sqf

    private ["_crate", "_supplyLight", "_supplySmoke"];
    _crate = _this;
    [0, {
        _crate = _this;
    _supplyLight = "NVG_TargetW" createVehicle (position _crate);
    _supplyLight attachTo [_crate, [0,0,0]];
    while {(player distance _crate) > 150} do {
    _supplySmoke = "SmokeShellGreen" createVehicle (position _crate);
    _supplySmoke attachTo [_crate, [0,0,0]];
    sleep 30;
    };
    }, _crate] call CBA_fnc_globalExecute;

    All: -2
    ClientsOnly: -1
    ServerOnly: 0

  3. Edited 8 years ago by thefinn

    Sorry I am a bit confused on this.

    How does this give all the different crates a smoke and chemlight ?

    I'm trying to get a smoke and chemlight on the crates dropped by ALiVE. Nothing else.

    Just dealing with the first bit - does "Box_NATO_AmmoVeh_F" in description.ext refer to the square ALiVE crates somehow ?

    Also just for future reference, if I were to do a normal drop of an ammo box and also have something in the "init" field in the editor - which runs first?

    Thanks.

  4. Edited 8 years ago by DaVidoSS

    There are always 2 crates. If you call for any crate this will be inside NATO Vehicle Ammo Box (Box_NATO_AmmoVeh_F), always.
    You need to enable player logistic actions to unpack this.

  5. Got it working, thank you. ;)

  6. Is there any "easy" (haha) way to add a NEW supply box to the list - so I am not changing the stock standard ones already there ?

    It occurs to me that adding in a box with tires (for AGM) etc might be useful ?

  7. Edited 8 years ago by DaVidoSS

    Only if you use AGM addon and R3F Logistic. If not just delete those lines.

    Crates are part of configfile >> "CfgVehicles" you need to add any addon/scripts which adding custom crates.

 

or Sign Up to reply!