Modify ammo/supply crates

  1. ‹ Older
  2. 8 years ago

    Sure. You need to use Extended init eventhandler

  3. There is currently no way to do this through any extended functionality of ALiVE. The above answer is your best bet.

  4. DavidoSS,

    I looked at one of your old posts on adding Arsenal to some RHS crates but I don't know enough to make any sense of most of it.

    Does anyone have an example that will work with persistencey?

    Thanks
    Eric

  5. Well i can show you how.

    First you need to define extened init eventhandler inside description.ext.

    class Extended_Init_EventHandlers	{
    	 
    class B_CargoNet_01_ammo_F	// classname of the box
     { 
    		
         init = "(_this select 0) call (compile preprocessFileLineNumbers 'scripts\arsenalCrate.sqf')";
         
     };
    };

    scripts\arsenalCrate.sqf

    private "_crate";
    
    _crate = _this;
    
    [-2, {
    _crate = _this;
    _crate allowDamage false;
    ["AmmoboxInit",[_crate,true]] spawn BIS_fnc_arsenal;
    }, _crate] call CBA_fnc_globalExecute;
    
    [0,
    {
        _crate = _this;
    	clearWeaponCargoGlobal _crate;
    	clearMagazineCargoGlobal _crate;
    	clearItemCargoGlobal _crate;
    	clearBackpackCargoGlobal _crate;
    	_crate addItemCargoGlobal ["ACE_CableTie", 10];
    	_crate addItemCargoGlobal ["ACE_NVG_Gen4", 10];
    	_crate addItemCargoGlobal ["ACE_personalAidKit", 10];
    	_crate addItemCargoGlobal ["ACE_bloodIV", 10];
    	_crate addItemCargoGlobal ["ACE_EarPlugs", 10];
    	_crate addItemCargoGlobal ["ACE_fieldDressing", 50];
    	_crate addItemCargoGlobal ["ACE_epinephrine", 50];
    	_crate addItemCargoGlobal ["ACE_morphine", 50];
    	_crate addItemCargoGlobal ["ACE_Clacker", 10];	
    	_crate addItemCargoGlobal ["ACE_DefusalKit", 10];
    	_crate addItemCargoGlobal ["ACE_IR_Strobe_Item", 10];
    	_crate addItemCargoGlobal ["B_UavTerminal", 10];
    	_crate addItemCargoGlobal ["G_Combat", 10];
    	_crate addItemCargoGlobal ["tf_anprc152", 20];
    	_crate addItemCargoGlobal ["Laserbatteries", 20];
    	_crate addItemCargoGlobal ["Laserdesignator", 10];
    	_crate addItemCargoGlobal ["Rangefinder", 10];
    	_crate addItemCargoGlobal ["ToolKit", 10];
    	_crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag", 20];
    	_crate addMagazineCargoGlobal ["200Rnd_65x39_cased_Box", 20];
    	_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 20];
    	_crate addMagazineCargoGlobal ["10Rnd_127x54_Mag", 20];
    	_crate addMagazineCargoGlobal ["5Rnd_127x108_APDS_Mag", 20];
    	_crate addMagazineCargoGlobal ["5Rnd_127x108_Mag", 20];
    	_crate addMagazineCargoGlobal ["7Rnd_408_Mag", 20];
    	_crate addMagazineCargoGlobal ["10Rnd_762x51_Mag", 20];
    	_crate addMagazineCargoGlobal ["150Rnd_762x51_Box", 20];
    	_crate addMagazineCargoGlobal ["20Rnd_762x51_Mag", 20];
    	_crate addMagazineCargoGlobal ["10Rnd_762x54_Mag", 20];
    	_crate addMagazineCargoGlobal ["150Rnd_762x54_Box", 20];
    	_crate addMagazineCargoGlobal ["10Rnd_93x64_DMR_05_Mag", 20];
    	_crate addMagazineCargoGlobal ["11Rnd_45ACP_Mag", 20];
    	_crate addMagazineCargoGlobal ["30Rnd_45ACP_Mag_SMG_01", 20];
    	_crate addMagazineCargoGlobal ["6Rnd_45ACP_Cylinder", 20];
    	_crate addMagazineCargoGlobal ["9Rnd_45ACP_Mag", 20];
    	_crate addMagazineCargoGlobal ["130Rnd_338_Mag", 20];
    	_crate addMagazineCargoGlobal ["10Rnd_338_Mag", 20];
    	_crate addMagazineCargoGlobal ["150Rnd_93x64_Mag", 20];
    	_crate addMagazineCargoGlobal ["16Rnd_9x21_Mag", 20];
    	_crate addMagazineCargoGlobal ["30Rnd_9x21_Mag", 20];
    	_crate addMagazineCargoGlobal ["SmokeShell", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellBlue", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellGreen", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellOrange", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellPurple", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellRed", 20];
    	_crate addMagazineCargoGlobal ["SmokeShellYellow", 20];
    	_crate addMagazineCargoGlobal ["20Rnd_556x45_UW_mag", 20];
    	_crate addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 20];
    	_crate addMagazineCargoGlobal ["30Rnd_556x45_Stanag_red", 20];
    	_crate addMagazineCargoGlobal ["FlareGreen_F", 20];
    	_crate addMagazineCargoGlobal ["FlareRed_F", 20];
    	_crate addMagazineCargoGlobal ["FlareWhite_F", 20];
    	_crate addMagazineCargoGlobal ["FlareYellow_F", 20];
    	_crate addMagazineCargoGlobal ["Chemlight_blue", 20];
    	_crate addMagazineCargoGlobal ["Chemlight_green", 20];
    	_crate addMagazineCargoGlobal ["Chemlight_red", 20];
    	_crate addMagazineCargoGlobal ["Chemlight_yellow", 20];
    	_crate addMagazineCargoGlobal ["HandGrenade", 20];
    	_crate addMagazineCargoGlobal ["MiniGrenade", 20];
    	_crate addMagazineCargoGlobal ["B_IR_Grenade", 20];
    	_crate addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag", 20];
    	_crate addMagazineCargoGlobal ["APERSMine_Range_Mag", 20];
    	_crate addMagazineCargoGlobal ["APERSTripMine_Wire_Mag", 20];
    	_crate addMagazineCargoGlobal ["ATMine_Range_Mag", 20];
    	_crate addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag", 20];
    	_crate addMagazineCargoGlobal ["ClaymoreDirectionalMine_Remote_Mag", 20];
    	_crate addMagazineCargoGlobal ["DemoCharge_Remote_Mag", 20];
    	_crate addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", 20];
    	_crate addMagazineCargoGlobal ["SLAMDirectionalMine_Wire_Mag", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_HE_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokeBlue_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokeGreen_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokeOrange_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokePurple_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokeRed_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_SmokeYellow_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["1Rnd_Smoke_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokeBlue_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokeGreen_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokeOrange_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokePurple_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokeRed_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_SmokeYellow_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_Smoke_Grenade_shell", 20];
    	_crate addMagazineCargoGlobal ["UGL_FlareCIR_F", 20];
    	_crate addMagazineCargoGlobal ["UGL_FlareGreen_F", 20];
    	_crate addMagazineCargoGlobal ["UGL_FlareRed_F", 20];
    	_crate addMagazineCargoGlobal ["UGL_FlareWhite_F", 20];
    	_crate addMagazineCargoGlobal ["UGL_FlareYellow_F", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_UGL_FlareCIR_F", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_UGL_FlareGreen_F", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_UGL_FlareRed_F", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_UGL_FlareWhite_F", 20];
    	_crate addMagazineCargoGlobal ["3Rnd_UGL_FlareYellow_F", 20];
    }, _crate] call CBA_fnc_globalExecute;

    You need to adjust stuff because above example is written for usage of ACE mod.

  6. You have just made my day!!!!!!!!!!!!!!!!!!!!!! Thanks for the help again!!!!

  7. 7 years ago

    OK have not used the above code in a few months but something has changed.

    description.ext

    class Extended_Init_EventHandlers	{
    	 
    class Box_NATO_Ammo_F	// classname of the box
     { 
    		
         init = "(_this select 0) call (compile preprocessFileLineNumbers 'scripts\ammo.sqf')";
         
     };
    };

    scripts\ammo.sqf

    //test
    private "_crate";
    
    _crate = _this;
    
    [-2, {
    _crate = _this;
    _crate allowDamage false;
    }, _crate] call CBA_fnc_globalExecute;
    
    [0,
    {
        _crate = _this;
    	clearWeaponCargoGlobal _crate;
    	clearMagazineCargoGlobal _crate;
    	clearItemCargoGlobal _crate;
    	clearBackpackCargoGlobal _crate;
    	_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 20];
    }, _crate] call CBA_fnc_globalExecute;

    When running the mission on the DEDICATED SERVER....

    One Box_NATO_Ammo_F begins the mission at my base (was placed in the editor) and then I requested another one via Combat Logistics (Helo, Airdrop or Convoy). The Box_NATO_Ammo_F that was placed on the map in the editor has the custom item in it but the Box_NATO_Ammo_F that came in by Combat Logistics has the default items (Same thing happens if I use Zues to drop one into the mission also, it has all the default items).

    When testing thru the Editor/Single player everything works, both boxes contain just the custom item.

    Does anyone have any idea how to fix this to work on the dedicated server?

    Thanks
    Eric

  8. So to confirm the editor-placed box works fine on dedi just not the one spawned in by ALiVE? And this worked OK in the past?

    Can you provide your dedi RPT file from your test?

  9. Sorry for the delay, been really busy and just now getting back into ALive..

    Correct, the editor placed box has the custom content but the Box_NATO_Ammo_F that you unload from the supply drop has the default contents in it.

    Here is the rpt file

  10. This version of ALiVE is build for A3 version: 168.140908. The server is running version: 168.141112.

    Can you check and make sure both the server and your client have the most recent version of ALiVE (note there was a new build released today)?

    Your RPT cuts out before it gets to where you are requesting the ammo crate - any way you can provide a repro mission for us to test?

  11. alternative reply

    Yo ass betta check n' make shizzle both tha server n' yo' client have da most thugged-out recent version of ALiVE (note there was a freshly smoked up build busted out todizzle)?

    Yo crazy-ass RPT cuts up before it gets ta where yo ass is requestin tha ammo crate - any way you can provide a repro mission fo' our asses ta test?

  12. @SpyderBlack723 alternative reply

    Feature request: I'd like for whoever wrote this to author the next changelog. :)

  13. Edited 7 years ago by SpyderBlack723

    Feature request: I'd like fo' whoever freestyled dis ta lyricist tha next chizzlelog.

  14. Yes, will update and verify both client and sever versions and retest. If it's still not working I'll upload the small test pbo along with the new rpt file as soon as I get off work.

    Thanks
    Eric

  15. @SavageCDN This version of ALiVE is build for A3 version: 168.140908. The server is running version: 168.141112.

    There was a ARMA3 hotfix update yesterday, that's where the above warning is coming from. Both server and client have Alive Version 1.3.0.1703191.

    Here is the basic mission ammocrate.pbo with just Alive and CBA.

    It works fine thru the editor in single player but when the mission is ran on a dedicated server or hosted multiplayer by the client the dropped ammo box will have the default items in it.

    In all three setting the ammo box that starts the mission on the map has the modified contents.

  16. Edited 7 years ago by SavageCDN

    Hehe...oops I knew that I was just testin' ya!

    Thanks Eric ticket opened:
    https://github.com/ALiVEOS/ALiVE.OS/issues/318

    Question - does spawning the box in Zeus work in dedicated and SP?

  17. Edited 7 years ago by HeroesandvillainsOS

    How can you guys possibly be concerned about ALiVE related stuff right now? Doesn't anyone like money?

  18. SUPER UNDETECTED COUNTERFEIT MONEY

  19. When you attempt to place the ammo box down it automatically opens the window showing the default items.

    If you hit ok it places the box down with the default items. If you hit cancel it places the box down withe the modified items from the script.

  20. Edited 7 years ago by Whigital

    @eric963 Was looking through old tickets and had a look at this. Did some testing and i think this is a general issue of Arma being Arma. Did some tweaks to the XEH and script and was able to produce expected results.

    Have a look if this works for you: https://github.com/ALiVEOS/ALiVE.OS/issues/318#issuecomment-343335822

  21. @Whigital Thanks for taking a look into this!!!! I’ll check it out as soon as I get home tonight.

 

or Sign Up to reply!