Alive resupply adding Arsenal to boxes.

  1. 8 years ago
    Edited 8 years ago by DaVidoSS

    HI.
    We got the best war-like gameplay experience with ALIVE. For that we say THANK YOU guys.
    Anyway there are some stuff which we need to make beter.
    The greates thing is resupply our combatants. For example the two rhs boxes with Arsenal functionallity but in SP only.
    That is why i am trying to set VAS and Arsenal MP functionallity to the boxes which comes from resupply.
    Have already some ideas and its works but only once i dont knew how to repeat once exited while loops.
    Please help me.
    The greatest problem for me is define non existing boxes.

    ammoresupply=true;
    weaponresupply=true;
    
    [] spawn {while{ammoresupply} do 
    
                {
                    {
                        if (typeof _x == "rhsusf_ammo_crate") then 
                                
                            {
                                [_x,"ammoresupply_fnc_ARSENAL",nil,true] spawn BIS_fnc_MP;
                                [_x,"ammoresupply_fnc_VASAMMO",nil,true] spawn BIS_fnc_MP;
                                ammoresupply=false
                            }
                    } foreach (NearestObjects [player, [], 100]);
                    sleep 0.5;
                };
            };
    
            
    [] spawn {while{weaponresupply} do 
                                    
                {
                    {
                        if (typeof _x == "rhsusf_weapons_crate") then
                            
                            {
                                [_x,"ammoresupply_fnc_ARSENAL",nil,true] spawn BIS_fnc_MP;
                                [_x,"ammoresupply_fnc_VASAMMO",nil,true] spawn BIS_fnc_MP;
                                weaponresupply=false
                            }
                    } foreach (NearestObjects [player, [], 100]);
                    sleep 0.5;
                };
            };  

    I belive there must by any way to reach the target, knewed by scripters.
    Or maybe integrate some code with alive player resupply...
    Please help me.

  2. Just so I understand... you want to add Virtual Arsenal option on ammo boxes dropped via Supply logistics?

  3. Yes this is what i want to create in my mission

  4. Edited 8 years ago by DaVidoSS

    Any ideas? I have trying to use addEventHandler but still no luck.
    player addEventHandler ["Init", { _this spawn resupply_fnc_ARSENAL }];

    description.ext

    class CfgFunctions
    {
    	class resupply
    	{
    		class functions
    		{
    			class ARSENAL {file = "resupply\ARSENAL.sqf";};
    		};
    	};
    };

    resupply\ARSENAL.sqf

    if ((typeof _this == "rhsusf_ammo_crate") || (typeof _this == "rhsusf_weapons_crate")) then
    	{
    	_this addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal}];
    	};

    Anyone knew how to add Arsenal to ingame spawned boxes in MP?. Is that even possible?

  5. I should be possible but as you said we need to figure out the name of the spawned boxes (or assign them a name to be used). Let me see if I can get a dev to check this thread.

  6. Edited 8 years ago by DaVidoSS

    We cant edit the player resupply script to add VAS and Arsenal in MP game for that boxes which are deliver from ALiVE but maybe there could be some way to interact with from custom script/init.
    It would be enough adding it for only two boxes "rhsusf_ammo_crate" and "rhsusf_weapons_crate"
    Both are Virtual boxes (empty) with Arsenal action but only in SP game.
    For now these crates hasn't variable names at all.
    Please help.

  7. Edited 8 years ago by dixon13

    You could use CBA's Extended Eventhandlers through the description.ext.

    description.ext...

    class Extended_Init_EventHandlers {
         class rhsusf_ammo_crate {
    		init = " _this call (compile preprocessFileLineNumbers 'arsenalCrate.sqf')";
         };
    };

    arsenalCrate.sqf...

    _crate = _this;
    [-1, {
        _crate = _this; _crate addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] call BIS_fnc_arsenal}];
    }, _crate] call CBA_fnc_globalExecute;

    I think the above is JIP compatible from what I remember because the way CBA sends this information to the clients is using 'publicVariable', which is a command that makes the variable known to all clients and ones that join later.

  8. I think the above is JIP compatible from what I remember because the way CBA sends this information to the clients is using 'publicVariable', which is a command that makes the variable known to all clients and ones that join later.

    It is JIP compatible, I have used it many times in past missions.

  9. Forgot to mention that the "-1" in the parameters means that the code will only be executed on clients.

  10. Edited 8 years ago by DaVidoSS

    Thanks for reply. Nice try but not working. Got error:

    19:27:18 Error in expression < = _this;
    [-1, {
    _crate = _this; _crate addAction ["<t color='#ff1111'>BIS Arsen>
    19:27:18   Error position: <addAction ["<t color='#ff1111'>BIS Arsen>
    19:27:18   Error addaction: Type Array, expected Object
    19:27:18 File C:\Users\DaVidoSS\Documents\Arma 3\missions\insurgency.Takistan\scripts\arsenalCrate.sqf, line 3

    Hmm?

  11. Have changed to :

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

    and holly ... its WORKS !!!!
    THANK YOU VERY MUTCH!!

  12. Just keep in mind that using the class "Extended_Init_EventHandlers" requires CBA.

  13. 7 years ago

    hi all guys!
    sry to revive this, but thats more or less what i need!
    i wish to make some vehicles (that can be destroyed and in that case will respawn) with a virtual arsenal always enabled....on DEDICATED server (my biggest troubles were about make it work in MP/ dedicated)

    lets say i have my helicopter named "BLUhelo1" (with virtual arsenal already active).
    it gets destroyed, but being linked to a respawn module, it resurrect.
    to get it has its virtual arsenal again, i added this line in the respawn module expression field:

    ["AmmoboxInit",[BLUhelo1,true,{true}]] spawn BIS_fnc_arsenal;

    and seems working!

    hope this helps other people in my situation!

 

or Sign Up to reply!