Weapon Cache in DayZ?

Jack Marslow

Well-Known Member
Is this possible? I'd like to put a weapon cache into my Skalitsy Island base which has been over run by AI bandits. Sort of a "mission" for my players to go on, as it stands now I have 4 barracks side by side but the risk for the reward isn't worth it.

Alternatively could I add an ammo crate from the mission editor and then add it to a custom loot table? Or do the loot drop points have to be defined somewhere?

Ran a few forum / google searches and havnt found anything relevant.
 
aha! open 2D editor in arma 2 SP. Place desired ammo crate (I used US special weapons crates).
add this to the int field

Code:
"clearMagazineCargo this; clearWeaponCargo this; {this addWeaponCargoGlobal [_x, 2];} forEach    ['M24','M4A1_AIM_SD_camo','M249','m16a4_acg','M9SD']; {this addmagazineCargoGlobal [_x, 12];} forEach ['5Rnd_762x51_M24','15Rnd_9x19_M9SD','30Rnd_556x45_Stanag','30Rnd_556x45_StanagSD','200Rnd_556x45_M249'];";

now save the mission, go to documents Arma 2 other profiles, missions, open mission sqm find the crate copy the code for the crates and paste it into your mission sqm for your servers mission pbo... DONE!

these crates will refill on server resets only. this shouldn't get picked up by scripts.txt cause the server runs it, but if it does myyyy bad, still, an easy solution to making a weapon cache

Also: For all you scripting bambi's you can change what you find in the crates by editing the int line I posted above. just make sure everything you put in has 'xxxxx', that format till you get to the last one 'xxxxx' (no comma)
 
yes there is a spot, it has to be in class vehicle section of your code. Make sure you update # of items! Check mine out...

Code:
    class Vehicles
    {
        items=15;
        class Item0
        {
            side="EMPTY";
            id=1;
            position[]={13225.278, -6.0489159, 3431.5159};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13225.278, 3431.5159, -3.1];";
        };
        class Item1
        {
            side="EMPTY";
            id=2;
            position[]={13247.008, -6.1535072, 3398.5906};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13247.008, 3398.5906, -3.1];";
        };
        class Item2
        {
            side="EMPTY";
            id=3;
            position[]={13203.401, -6.2994447, 3464.7751};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13203.401, 3464.7751, -3.1];";
        };
        class Item3
        {
            side="EMPTY";
            id=4;
            position[]={13181.671, -6.1785541, 3497.7451};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13181.671, 3497.7451, -3.1];";
        };
        class Item4
        {
            side="EMPTY";
            id=5;
            position[]={13159.978, -6.3031154, 3530.6299};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13159.978, 3530.6299, -3.1];";
        };
        class Item5
        {
            side="EMPTY";
            id=6;
            position[]={13138.261, -5.9914126, 3563.5496};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13138.261, 3563.5496, -3.1];";
        };
        class Item6
        {
            side="EMPTY";
            id=7;
            position[]={13116.587, -6.1611514, 3596.4583};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13116.587, 3596.4583, -3.1];";
        };
        class Item7
        {
            side="EMPTY";
            id=8;
            position[]={13094.851, -6.0637994, 3629.364};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13094.851, 3629.364, -3.1];";
        };
        class Item8
        {
            side="EMPTY";
            id=9;
            position[]={13073.158, -6.1899328, 3662.2742};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13073.158, 3662.2742, -3.1];";
        };
        class Item9
        {
            side="EMPTY";
            id=10;
            position[]={13051.535, -6.376471, 3695.0833};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13051.535, 3695.0833, -3.1];";
        };
        class Item10
        {
            side="EMPTY";
            id=11;
            position[]={13029.813, -6.1521502, 3728.052};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13029.813, 3728.052, -3.1];";
        };
        class Item11
        {
            side="EMPTY";
            id=12;
            position[]={13260.079, -3.0727394, 3378.8081};
            vehicle="land_nav_pier_m_2";
            azimut=56.571701;
            lock="LOCKED";
            init="this setPosASL [getposASL this select 0, getposASL this select 1, -2.5]; this setpos [13260.079, 3378.8081, -3.0727394];";
        };
        class Item12
        {
            position[]={13721.454,46.893833,2932.8447};
            id=102;
            side="EMPTY";
            vehicle="USSpecialWeapons_EP1";
            skill=0.60000002;
            init="clearMagazineCargo this; clearWeaponCargo this; {this addWeaponCargoGlobal [_x, 2];} forEach    ['M24','M4A1_AIM_SD_camo','M249','m16a4_acg','M9SD']; {this addmagazineCargoGlobal [_x, 12];} forEach ['5Rnd_762x51_M24','15Rnd_9x19_M9SD','30Rnd_556x45_Stanag','30Rnd_556x45_StanagSD','200Rnd_556x45_M249'];";
        };
        class Item13
        {
            position[]={13723.598,46.868961,2934.5986};
            id=103;
            side="EMPTY";
            vehicle="USSpecialWeapons_EP1";
            skill=0.60000002;
            init="clearMagazineCargo this; clearWeaponCargo this; {this addWeaponCargoGlobal [_x, 2];} forEach    ['M24','M4A1_AIM_SD_camo','M249','m16a4_acg','M9SD']; {this addmagazineCargoGlobal [_x, 12];} forEach ['5Rnd_762x51_M24','15Rnd_9x19_M9SD','30Rnd_556x45_Stanag','30Rnd_556x45_StanagSD','200Rnd_556x45_M249'];";
        };
        class Item14
        {
            position[]={13725.856,46.825798,2936.4185};
            id=104;
            side="EMPTY";
            vehicle="USSpecialWeapons_EP1";
            skill=0.60000002;
            init="clearMagazineCargo this; clearWeaponCargo this; {this addWeaponCargoGlobal [_x, 2];} forEach    ['M24','M4A1_AIM_SD_camo','M249','m16a4_acg','M9SD']; {this addmagazineCargoGlobal [_x, 12];} forEach ['5Rnd_762x51_M24','15Rnd_9x19_M9SD','30Rnd_556x45_Stanag','30Rnd_556x45_StanagSD','200Rnd_556x45_M249'];";
        };
    };

obviously you can cut out and put what ever weapons you want in. And you have to change the position to wherever u want it. I have the excelsior bridge on my server tho, so urs may look different. If you look at the top of my code it says

Class Vehicles
{
Items=15;

See how my last class item is #14? Thats cause it starts at item0 if you dont make that right your mission wont load!
 
Many thanks, yeah I have the same bridge also. Really I should have remembered that was added in the same way!

Thanks
 
I have noticed everytime I log in, the weapons and ammo are added again....anyone know how to prevent this?
 
Add the crates as a deployable in the database and fill the contents manually, Each restart they refill.
You can also change the contents via the database for quickness
 
Thanks, I did see a thread that mentioned how to do it that way, buggered if I can find it now but ill find it eventually
 
Hmmm, good info there Richie, could you be a little more descriptive. If we have a nice write up for this, we can get it added to the Addon's page. I know how to do a deployable, but u dont have to add the contents each restart right?

Rossy, your database is all that SQL fun times :)
 
I can't remember the exact way but hopefully this will explain the idea :)

1- In your deployable table (where tents and tank traps are) add one of the following types of ammo crate :
UNBasicAmmunitionBox_EP1 - USBasicAmmunitionBox_EP1 - USOrdnanceBox_EP1 - USVehicleBox_EP1
2- In the instance_deployable table add them, deployable ID is the ID specified in your deployable table (step 1)

They will also need world space coordinates for where you want them.
Finally add the inventories, I used rMod2 so my inventory won't work but you can alter the class names, ammo and number to add from my examples

5 weapons with 5 of each weapon plus ammo type and 50 mags of each ammo
Code:
[[["Sa58P_EP1","Sa58V_EP1","M60A4_EP1","Mk_48_DES_EP1","M110_TWS_EP1","M47Launcher_EP1"],[5,5,5,5,5,5,5]],[["30Rnd_762x39_SA58","100Rnd_762x51_M240","100Rnd_762x51_M240","20Rnd_762x51_B_SCAR","Stinger","Dragon_EP1"],[50,50,50,50,50,50]],[[],[]]]

4 types of clothing and 10 of each type
Code:
[[[],[]],[["Skin_Soldier1_DZ","Skin_Survivor2_DZ","Skin_Camo1_DZ","Skin_Sniper1_DZ"],[10,10,10,10]]]]

Hope that helps :)
Each restart they will be fully restocked and as far as i know they have no limit, any item can be added so you can have medical boxes, vehicle parts etc

Also there are many more types of crate you can have, don't limit yourself to the 4 i listed
 
Thanks for the help, at the moment I can't get it to spawn despite everything being correct, but i'll keep trying
 
Just for fun we would have multiple boxes but not all contained good gear :)
Inbetween restarts you can change the inventory to give it that random lotto feel, boxes everywhere but only some contain goodies.
 
We have added 3 boxes to our skalisty fortress, get past the NPC's to find the goodies. Great way of adding some incentive!
 
I can't remember the exact way but hopefully this will explain the idea :)

1- In your deployable table (where tents and tank traps are) add one of the following types of ammo crate :
UNBasicAmmunitionBox_EP1 - USBasicAmmunitionBox_EP1 - USOrdnanceBox_EP1 - USVehicleBox_EP1
2- In the instance_deployable table add them, deployable ID is the ID specified in your deployable table (step 1)

They will also need world space coordinates for where you want them.
Finally add the inventories, I used rMod2 so my inventory won't work but you can alter the class names, ammo and number to add from my examples

5 weapons with 5 of each weapon plus ammo type and 50 mags of each ammo
Code:
[[["Sa58P_EP1","Sa58V_EP1","M60A4_EP1","Mk_48_DES_EP1","M110_TWS_EP1","M47Launcher_EP1"],[5,5,5,5,5,5,5]],[["30Rnd_762x39_SA58","100Rnd_762x51_M240","100Rnd_762x51_M240","20Rnd_762x51_B_SCAR","Stinger","Dragon_EP1"],[50,50,50,50,50,50]],[[],[]]]

4 types of clothing and 10 of each type
Code:
[[[],[]],[["Skin_Soldier1_DZ","Skin_Survivor2_DZ","Skin_Camo1_DZ","Skin_Sniper1_DZ"],[10,10,10,10]]]]

Hope that helps :)
Each restart they will be fully restocked and as far as i know they have no limit, any item can be added so you can have medical boxes, vehicle parts etc

Also there are many more types of crate you can have, don't limit yourself to the 4 i listed

Does it matter what the unique_id is in instance_deployable? Must have missed something simple because I can't get any box to spawn.
 
Back
Top