Adding custom items to loot spawns

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding custom items to loot spawns

Outlaw2101
Hello

I am relatively new to modding Arma. I only started modifying it a few months ago installing mods from Armaholic, mainly weapons mods. I then stumbled upon this website after a random Google search of DayZ Singleplayer. I have successfully installed Chernarus and Panthera and have been playing on the maps for a while. However it occurred to me a few days ago that "The same items are getting boring. Hey, this is singleplayer, I could possibly edit it!"

What I would like to do is add a few weapons from my weapon mods to loot spawns around Panthera and Chernarus. However I have my doubts. I have done some research and at first attempted to move the mission.sqm out of the PBO for 'DaiZy Panthera NO AI' into editor in order to add an ammo box, however it failed.

I have also done some research on the PBO files. If I am right, all the spawning for weapons and ammunition is located in the dayz_code. The problem is, how do I access and add weapons that I would like spawned? Can someone please help me with this?

Thankyou. :)
Reply | Threaded
Open this post in threaded view
|

Re: Adding custom items to loot spawns

Haleks
Outlaw2101 wrote
I have also done some research on the PBO files. If I am right, all the spawning for weapons and ammunition is located in the dayz_code. The problem is, how do I access and add weapons that I would like spawned? Can someone please help me with this?
You're right.
I'll assume you know to decompress a pbo file - if not, a quick search should provide some tutorials, I only suggest that you use PBO manager.

Now, I think Panthera is based on an old version of dayz, so the loot tables should be in the config.cpp file.
Open it with a text editor and look for something looking like this :

        class Supermarket: Default {
                lootChance = 0.4;
                minRoaming = 2;
                maxRoaming = 6;
                zombieChance = 0.3;
                zombieClass[] = {"zZombie_Base","zZombie_Base","z_teacher","z_worker1","z_worker2"};
                itemType[] = {
                        {"ItemWatch","generic"},
                        {"ItemMap","weapon"},
                        {"Makarov","weapon"},
                        {"ItemFlashlight","generic"},
                        {"ItemFlint","generic"},
                        {"ItemKnife","generic"},
                        {"","generic"},
                        {"Tokarev","weapon"},
                        {"WeaponHolder_ItemTent","object"},
                        {"","food"},
                        {"","trash"},
                        {"Crossbow","weapon"},
                        {"Binocular","weapon"},
                        {"WeaponHolder_MeleeCrowbar","object"},
                        {"ice_apo_pack1","object"},
                        {"ice_apo_pack2","object"},
                        {"ice_apo_pack3","object"},
                        {"ice_apo_pack4","object"}
                };
                itemChance[] = {
                        0.01, // {"ItemWatch","generic"},
                        0.01, // {"ItemMap","weapon"},
                        0.01, // {"Makarov","weapon"},
                        0.01, // {"ItemFlashlight","generic"},
                        0.01, // {"ItemFlint","generic"},
                        0.01, // {"ItemKnife","generic"},
                        0.01, // {"","generic"},
                        0.01, // {"Tokarev","weapon"},
                        0.01, // {"WeaponHolder_ItemTent","object"},
                        0.01, // {"","food"},
                        0.42, // {"","trash"},
                        0.01, // {"Crossbow","weapon"},
                        0.01, // {"Binocular","weapon"},
                        0.02, // {"WeaponHolder_MeleeCrowbar","object"},
                        0.01, // {"ice_apo_pack1","object"},
                        0.01, // {"ice_apo_pack2","object"},
                        0.01, // {"ice_apo_pack3","object"},
                        0.01 // {"ice_apo_pack4","object"}
                };
        };

All you need to do, is add the classname of the weapon you want, and the corresponding spawn chance :
        class Supermarket: Default {
                lootChance = 0.4;
                minRoaming = 2;
                maxRoaming = 6;
                zombieChance = 0.3;
                zombieClass[] = {"zZombie_Base","zZombie_Base","z_teacher","z_worker1","z_worker2"};
                itemType[] = {
                        {"ItemWatch","generic"},
                        {"ItemMap","weapon"},
                        {"Makarov","weapon"},
                        {"ItemFlashlight","generic"},
                        {"ItemFlint","generic"},
                        {"ItemKnife","generic"},
                        {"","generic"},
                        {"Tokarev","weapon"},
                        {"WeaponHolder_ItemTent","object"},
                        {"","food"},
                        {"","trash"},
                        {"Crossbow","weapon"},
                        {"Binocular","weapon"},
                        {"WeaponHolder_MeleeCrowbar","object"},
                        {"ice_apo_pack1","object"},
                        {"ice_apo_pack2","object"},
                        {"ice_apo_pack3","object"},
                        {"ice_apo_pack4","object"},
                        {"your weapon classname","weapon"}

                };
                itemChance[] = {
                        0.01, // {"ItemWatch","generic"},
                        0.01, // {"ItemMap","weapon"},
                        0.01, // {"Makarov","weapon"},
                        0.01, // {"ItemFlashlight","generic"},
                        0.01, // {"ItemFlint","generic"},
                        0.01, // {"ItemKnife","generic"},
                        0.01, // {"","generic"},
                        0.01, // {"Tokarev","weapon"},
                        0.01, // {"WeaponHolder_ItemTent","object"},
                        0.01, // {"","food"},
                        0.42, // {"","trash"},
                        0.01, // {"Crossbow","weapon"},
                        0.01, // {"Binocular","weapon"},
                        0.02, // {"WeaponHolder_MeleeCrowbar","object"},
                        0.01, // {"ice_apo_pack1","object"},
                        0.01, // {"ice_apo_pack2","object"},
                        0.01, // {"ice_apo_pack3","object"},
                        0.01,        // {"ice_apo_pack4","object"}
                        0.3 //spawn cance
                };
        };

Don't forget the coma!
Reply | Threaded
Open this post in threaded view
|

Re: Adding custom items to loot spawns

Outlaw2101
Hello

Thankyou very much for your reply. I have got it set like this.

class Military: Default {
                zombieChance = 0.3;
                maxRoaming = 6;
                zombieClass[] = {"z_soldier","z_soldier_heavy","z_policeman"};
                lootChance = 0.4;
                lootPos[] = {};
                itemType[] = {
                        {"UZI_SD_EP1","weapon"},
                        {"M9","weapon"},
                        {"M16A2","weapon"},
                        {"M16A2GL","weapon"},
                        {"M9SD","weapon"},
                        {"AK_74","weapon"},
                        {"M4A1_Aim","weapon"},
                        {"AKS_74_kobra","weapon"},
                        {"AKS_74_U","weapon"},
                        {"AK_47_M","weapon"},
                        {"M24","weapon"},
                        {"M1014","weapon"},
                        {"DMR","weapon"},
                        {"M4A1","weapon"},
                        {"M14_EP1","weapon"},
                        {"UZI_EP1","weapon"},
                        {"Remington870_lamp","weapon"},
                        {"glock17_EP1","weapon"},
                        {"MP5A5","weapon"},
                        {"MP5SD","weapon"},
                        {"M4A3_CCO_EP1","weapon"},
                        {"Binocular","weapon"},
                        {"ItemFlashlightRed","military"},
                        {"ItemKnife","military"},
                        {"ItemGPS","weapon"},
                        {"ItemMap","military"},
                        {"RH_rpk47 RH_75Rnd_762x39_mag","weapon"},
                        {"RH_akms 30Rnd_762x39_AK47","weapon"},
                        {"RH_ak47 30Rnd_762x39_AK47","weapon},
                        {"RH_an94 RH_30Rnd_545x39_an94_mag","weapon"},
                        {"RH_aks74mk 30Rnd_545x39_AK","weapon"},

                       
                        {"DZ_ALICE_Pack_EP1","object"}, // 16
                        {"DZ_TK_Assault_Pack_EP1","object"}, // 16
                        {"DZ_British_ACU","object"}, // 18
                        {"DZ_CivilBackpack_EP1","object"}, // 24
                        {"DZ_Backpack_EP1","object"}, // 24
                       
                        //Normal
                        {"","medical"},
                        {"","generic"},
                        {"","military"},
                        //{"Body","object"},
                        {"ItemEtool","weapon"},
                        {"ItemSandbag","magazine"},
                        {"Sa58P_EP1","weapon"},
                        {"Sa58V_EP1","weapon"}
                };
                itemChance[] = {
                        0.03,
                        0.05,
                        0.05,
                        0.01,
                        0.02,
                        0.15,
                        0.01,
                        0.08,
                        0.05,
                        0.05,
                        0.01,
                        0.10,
                        0.01,
                        0.02,
                        0.01,
                        0.05,
                        0.08,
                        0.10,
                        0.04,
                        0.02,
                        0.01,
                        0.06,
                        0.10,
                        0.10,
                        0.01,
                        0.05,
                        0.05,
                        0.10,
                        0.05,
                        0.03,
                        0.05,

                        //Bags
                        0.08, //16
                        0.08, //16
                        0.06, //18
                        0.01, //24
                        0.01, //DZ_Backpack_EP1 24
                        0.10,
                        1.00,
                        2.50,
                        //0.20,
                        0.05,
                        0.02,
                        0.03,
                        0.03
                };

The bold entries with RH_ in front of them are the weapons I have added. I have also added a spawn chance. Should this work correctly?

Thankyou.
Reply | Threaded
Open this post in threaded view
|

Re: Adding custom items to loot spawns

Haleks
{"RH_rpk47 RH_75Rnd_762x39_mag","weapon"},

Those seem to be magazines, not weapons.
Except for that, it should work.
Reply | Threaded
Open this post in threaded view
|

Re: Adding custom items to loot spawns

Outlaw2101
Hello

Yes, ArmA threw an exception so I shortened the entry down to just {"RH_rpk47","weapon"}, and it appears to work. I have yet to find the weapon though.

By the way, off topic in this thread, something is shooting at me on the NO AI Panthera. Its apparently called a Gamekeeper by the name on the map. Is this normal?

Thankyou
Reply | Threaded
Open this post in threaded view
|

Re: Adding custom items to loot spawns

Haleks
No idea. I guess Above will be able to tell you more, as he is the author of this release.