Gamers logo

DayZ Console Modding Part 5

by Liam rychlik 7 months ago in how to

How to make guns and vehicles spawn with all their parts.

(image source: https://store.steampowered.com/agecheck/app/221100/)

In this part of the series I shall cover one of the more straightforward changes that can be made to your DayZ xmls to improve quality of life on your server. Making vehicles and guns spawn with all their parts ready to go. For the most part the only file we'll be making changes to is cfgspawnabletypes.xml but first we should despawn all the cars spawned on the map by default. To do this open Events.xml and scroll down to the events that spawn vehicles, you should see four for cars and one for trucks. On these events set <active> to 0, then save, upload and do a server restart.

(example of vehicle event with <active> set to 0)

With that step out of the way, now open cfgspawnabletypes.xml and again scroll down to the entries for vehicles. You should see fifteen of these, three for trucks and twelve for cars. Each entry lists the parts for each colour and model of vehicle as well as the chance values for those parts to spawn on them. All we do here to make the vehicles spawn fully built is raise every chance value for each part on all fifteen entries to "1.00".

(example of a vehicle entry in cfgspawnabletypes.xml)

Once you save and upload these changes, go back to Events.xml, set <active> to 1 on all five vehicle entries and finally save, upload again and follow with a server restart. This will then reactivate the vehicle events, spawning vehicles across the map fully built, ready to go. Just be aware that fully built vehicles spawn with no water in the tank.

With the vehicles now set to spawn with all their parts, its time to get to work on the guns. Here just like we did with the vehicles we raise the chance values on the parts for the gun entries in cfgspawnabletypes.xml to "1.00" to make them have 100% chance of spawning on the guns. The only slight exception is with the optics on some of the gun entries. For those only raise the chance value to "1.00" on the "attachments" line above the list of "item" lines as shown in the example below:

The reason we don't set the individual item chance values for optics to 1.00 as well is because, the "attachments chance" handles how likely one of the optics will be selected, then each optics chance value decides how likely they will be the one selected to attach to the gun. With the chance values now set to make guns spawn fully built, save upload and retsart your server. After that any and all new spawns of guns will have all their parts attached. Just be aware that any guns already on the map will not be effected by these changes.

One last thing you can do, especially if you want the guns to spawn full of ammo as well, is go into types.xml and set the <quantmin> and <quantmax> on all entries for gun mags to "100". Again this won't effect instances already on the map, but after the changes go live all new gun spawns will have full ammunition as well as any new spawns of clips & mags across the map.

(example types.xml entry for a gun mag)

For more help, support and guidance please join my Discord: https://discord.gg/pp5JJDu

Just in case you missed them, here are the previous parts to the series:

https://vocal.media/stories/day-z-console-modding-part-1

https://vocal.media/stories/day-z-console-modding-part-2

https://vocal.media/stories/day-z-console-modding-part-3

https://vocal.media/gamers/dayz-console-modding-part-4

Now although simply reading this article does help support me in my efforts to make coding Dayz XML easier for all, it doesnt help keep the lights on! ;) So if you found that this or any of my other articles have helped you please donate to the cause via one of the methods below:

https://server.nitrado.net/donations/donate/3858410

http://paypal.me/mrflyingbiscuits

https://cash.app/%C2%A3Rventris

how to

Liam rychlik

Receive stories by Liam rychlik in your feed
Liam rychlik
Read next: Late in the Game Review: 'Resident Evil: Operation Raccoon City'

Find us on social media

Miscellaneous links

  • Explore
  • Contact
  • Privacy Policy
  • Terms of Use
  • Support

© 2021 Creatd, Inc. All Rights Reserved.