Weapon Cache in DayZ?

One would think that... as did I... but not so much.

Anyway, I went into the 3D editor and placed a building where I wanted the barracks (since the spawning barracks are not found in the editor), saved the biedi file as something I could search for, opened the file in Notepad++, selected all the contents of the file, copy and pasted into the converter on www.zvivor.com, opened my server database, copied the SQL commands provided by the converter that inserts data into the building and instance_building tables, opened the building table to rename the building I substituted for the barracks to "Land_Mil_Barracks_i" and restarted my server.

Had to tweak the azmuth after seeing the barracks in-game.

Weapons cache... which is really what this thread is for... worked great. Again, went into the 3D editor to create a base (that I placed bandit AI's into and set them to foritfy so they don't patrol) placed an ammo crate where I wanted the weapons cache, did the converter thing again, but grabbed the world space placement of the "ammo crate" that was in the db and before deleting it from the db. Then using the code at the beginning of this thread, I added it to my mission.sqm file with the necessary info. Didn't work at first, because I did NOT add one to the top of the total item count. Added one to the total and BAM! Weapons cache! :)

Hope this helps
 
Now I'm having a problem.

I have two servers, not much of anything different (expect one is 24hr and other is always day). The 24hr server has no problems with the mission.sqm crates spawning, but the 8hr always day server is not working.

I went into the deploy table in the database stacking tent, sm_stash, med_stash and every crate name I could find, but only the tent and stashes appeared. It's almost as though there is something blocking them from deploying.

Any ideas?
 
There is one thing different... I have the silent warrior anti hacker tool on the 8hr server. Could that be causing the denial? Anyone else using TSW without issues?
 
Assuming I get this fixed... what would the "inventory" command look like for medical supplies or goods?

Code:
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'];";
        };

I'm focusing on the "clearWeaponCargo" and "addWeaponCargoGlobal" as compared to non-weapons?


Will it still work if I coded it this way? (Example food and medical)


Code:
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    ['ItemSodaCoke','ItemMRE','ItemMorphine'];"
};
 
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

I tried this, it works great but the items do not refill on a server restart. Is that normal, is there a change I must make?
 
Hello all, i am having an issue with getting the ammo box to spawn, i have followed the tutorial from the you tube video and created the deployable. I am running dayz 1.7.7.1 on dayz.st, when i try to spawn the ammo box i get nothing, however if i try to spawn a tent it works. Does the info from the you tube video work for my version of dayz? I am using the usbasicammo_ep1 object. I have edited my data base with this and have tried an empty ammo box as well as a full ammo box.
 
Hello all, i am having an issue with getting the ammo box to spawn, i have followed the tutorial from the you tube video and created the deployable. I am running dayz 1.7.7.1 on dayz.st, when i try to spawn the ammo box i get nothing, however if i try to spawn a tent it works. Does the info from the you tube video work for my version of dayz? I am using the usbasicammo_ep1 object. I have edited my data base with this and have tried an empty ammo box as well as a full ammo box.

They removed it onm the 1.7.7.1 patch.
Here is how you get it working again http://www.dayzpatriots.com/adding-weapon-ammo-crates-1-7-7-1-t97.html
 
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'];";

instead of addWeaponCargoGlobal and addmagazineCargoGlobal, cant i just use addWeaponCargo andaddmagazineCargo and give it a specific number?


the database version, dosnt seem to work for me :(
 
hi, great thread but I was wondering if you could add weapon/ammo crates (ideally custom ones) to the loot table? I already use a custmised loot table but would love to have a low probablity of a crate spawning in some areas. Any ideas if this is possible?

Was just reading through and noticed this. Well I know you can spawn objects (crates and such) into buildings, I just don't know if you can add loot to them. For example in cfgBuildingLoot.hpp
Code:
    class Hospital: Default {
        zombieChance = 0.4;
        minRoaming = 2;
        maxRoaming = 6;
        zombieClass[] = {"z_doctor","z_doctor","z_doctor"};
        lootChance = 0.9; //0.2
        lootPos[] = {};
        lootType[] = {
            {"","trash",0.1}, //0.5
            {"","hospital",0.7}, //0.5
            {"MedBox0","object",0.5} //0.01
        };
    };

so just take whatever crate you want to spawn add it to wherever like so
Code:
    class Farm: Default {
        zombieChance = 0.3;
        maxRoaming = 3;
        zombieClass[] = {"zZombie_Base","z_hunter","z_hunter","z_hunter","z_villager1","z_villager2","z_villager3"};
        lootChance = 0.8;
        lootPos[] = {};
        lootType[] =    {
            {"WeaponHolder_ItemJerrycan","object",0.03},
            {"huntingrifle","weapon",0.02},
            {"LeeEnfield","weapon",0.03},
            {"Winchester1866","weapon",0.03},
            {"Crossbow_DZ","weapon",0.03},
            {"PartWoodPile","magazine",0.08},
            {"WeaponHolder_ItemHatchet","object",0.05},
            {"MR43","weapon",0.01},
            {"MeleeMachete","weapon",0.04},
            //{"","craft",0.10},
            {"","military",0.10},
            {"","generic",0.60},
            {"","trash",0.20}, //0.40
            {"cratenamehere","Object",0.20}
        };
    };
I believe the medcrate "MedBox0" already comes packed with loot, so if you wanted to add a small chance of finding a medical stash in a farm you could have that spawn there.
 
Back
Top