Jump to content

Recommended Posts

16 minutes ago, avibird 1 said:

there are some serious issues with the script.

Nope

17 minutes ago, avibird 1 said:

supply crate drops but it's not the red one

My script does not change the crate, just the contents.

17 minutes ago, avibird 1 said:

halfway down the parachute cord cuts the crate falls to the ground starts smoking up and then disappears into the ground

Again not my script. My script does nothing to the crate other than to call a BI function on it passing an array of equipment.

BI's function fills it or adds virtual equipment to it and arsenal. It is the exact same method used by BI when you edit a containers contents in Eden.

 

TEST_MISSION

  • Thanks 2

Share this post


Link to post
Share on other sites

@Larrow Thank you for the test mission so I can see what is going on. 

 

 I am using MCC4 with GAIA, Zeus enhanced Eden enhanced Achilles and JEBUS spawning script. Those are the only mods and scripts I am using in the mission? 

Share this post


Link to post
Share on other sites

@Larrow Just DL and looked at the codes in the crate and module. It's appears to be exactly what I have in my setup.  But I could be wrong lol would not be the first time when it comes to Arma scripting.

 

Your demo works perfect thank you very much.  I don't have to edit ammo for 18 different unit setups for this mission.  I need the test in the real mission to see if  there is something with the few mod/scripts I have incorporated into the mission that might be causing the issue or is it just user error 🤪.

 

Share this post


Link to post
Share on other sites
On 5/19/2016 at 2:02 PM, Larrow said:

Place a crate down in 3Den and edit its contents to your liking, be it default or virtual.

Give the crate a name for instance 'myCrate'.

Set it as hidden by unticking showModel option in Object: Special States.

Place this in its init.


fnc_get3DENLoadout = {
    params[ "_veh" ];

    _virtualCargo = [
        [ _veh call BIS_fnc_getVirtualWeaponCargo, [] ],
        [ _veh call BIS_fnc_getVirtualMagazineCargo, [] ],
        [ _veh call BIS_fnc_getVirtualItemCargo, [] ],
        [ _veh call BIS_fnc_getVirtualBackpackCargo, [] ]
    ];

    if ( _virtualCargo findIf{ count ( _x select 0 ) > 0 } > -1 ) then {
        _veh setVariable [ "loadout", [ _virtualCargo, true ] ];
    }else{
        _veh setVariable[ "loadout",
            [
                [
                    getWeaponCargo _veh,
                    getMagazineCargo _veh,
                    getItemCargo _veh,
                    getBackpackCargo _veh
                ],
                false
            ]
        ];
    };
};

this call fnc_get3DENLoadout;

Then in the SupplyDrop modules crate init line place..


[ _this, myCrate getvariable "loadout" ] call BIS_fnc_initAmmobox;

The first bit of code works out what was given to the hidden crate in the editor, then when the supplyDrop creates its crate the loadout is copied to it.

Its some code i wrote in another post for Fiddi last week when he asked a similar question on how to determine an editor loadout of a vehicle/container.


Could the second part of this be modified so that the custom crate could be spawned at a laptop object for example?

Share this post


Link to post
Share on other sites
7 minutes ago, CY4 said:


Could the second part of this be modified so that the custom crate could be spawned at a laptop object for example?


I'm sure you could make the laptop an arsenal.
Check this out.

Not tested.

Share this post


Link to post
Share on other sites
On 9/19/2022 at 10:46 PM, CY4 said:

Could the second part of this be modified so that the custom crate could be spawned at a laptop object for example?

Of course, just change _this for the crate you spawn.

_spawnedCrate = createVehicle[ "CargoNet_01_box_F", getPosATL _laptop, [], 0, "CAN_COLLIDE" ];

[ _spawnedCrate, myCrate getvariable "loadout" ] call BIS_fnc_initAmmobox;

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×