Gamers logo

DayZ Console Modding Part 3

Custom spawning chests, vehicles, buildings and more

By L.RPublished 3 years ago 4 min read
Like
(image source: https://store.steampowered.com/agecheck/app/221100/)

Welcome to the third installment of my DayZ Modding guide for console server owners. The previous article focused on default events that are already coded into the XML files, which handle the spawning of animals, helis, cars and more. This time I shall introduce you to creating your own custom events, so you can place game objects almost anywhere on the map.

First a recap on how each line effects the in-game workings of the Events.xml file:

<nominal> - The total amount of locations that can have a spawn of the event.

<min> - the lower bound, when theres this many spawns left on the map, the server will spawn more.

<max> - The upper bound, when theres this many the server will stop spawning more.

<lifetime> - Assuming no player interaction this is the amount of time each spawn of an event will stay on map before despawning.

<restock> - The amount of time inbetween individual spawns of an event up until nominal or max value is reached again.

<saferadius> - this is how close/far away from a player an instance of an event can spawn. 0 meaning it can spawn on top of a player.

<distanceradius> - The minimum distance that instances of an event can spawn from each other.

<cleanupradius> - How far away a player must get before the events despawn timer (lifetime) kicks in.

<flags deletable="0" init_random="0" remove_damaged="1" /> all three flags accept two values: 1=on and 0=off.

  • deletable - decides if spawns of event can be despawned when event lifetime reaches zero.
  • init_random - unknown, is set to 0 on all events.
  • remove_damaged - decides if ruined (car) or killed (animal/zombie) spawns are removed. (effects not well understood)

<position> - determines if spawn is relative to a "fixed" position or to "player" proximity.

<limit> - If set as "child" will spawn one of the objects from the "<child" lines at each usable location up until nominal value is on the map. If this is set to "mixed" then a combination of the child min/max values and the parent min/max values are used to detrmine the spawn ratios. "custom" is another valid value but its efects are not known.

<active> - Determines if the event is activly spawning on the map. 1=on 0=off.

<children> </children> - The opening and close tags for the "child" lines that go between them.

<child lootmax="0" lootmin="0" max="50" min="30" type="PileOfWoodenPlanks"/>

  • Each "<child" line tells the server what game object and how many of it the event handles.
  • lootmax and lootmin (when applicable) determine the minimum and maximum amount of loot that can spawn around an event.
  • min and max determine the amount of the game object the event can spawn.
  • type is the file name for the game object you wish to spawn.

<event name="ItemCustomExample> </event> - open and then close the code for each event within events.xml as well as declares the event name for use in cfgeventspawns.xml.

When naming your custom events you must prefix the name with one of three words:

  • Vehicle - for all cars and trucks.
  • Static - for any buildings and other map objects like water pumps and heli crash sites.
  • Item - for all "loot" objects including chests, guns, clothing and more.

(Example entry in events.xml to spawn a single water pump)

(Example entry in cfgeventspawns.xml telling the server where to spawn the waterpump)

The above events.xml code example tells your server to spawn 1 instance of the event including 1 instance of the "Land_Misc_Well_Pump_Blue" object with a lifetime of "500" seconds in a "fixed" position. This means that the pump will always be at the coordinates designated in cfgeventspawns.xml instead of only spawning when a player is in the same area and will respawn every 500 seconds provided no other objects or players are blocking the spawn point.

To get coordinates to use for custom events, you can either use position data from server logs by taking damage on the spot you want to spawn a game object, or you can use the Izurvive online map to copy/paste coordinates. Just be aware that positions pulled from izurvive only give the X and Y positions in this format 1234.12 / 1234.12 you will need to seperate these to use them in your files. The "a" value is rotation facing north/south and can be any whole number from 0-360; 0/360 = North facing, 180 = south facing as examples.

Finally, when creating custom events you must ensure you use the correct prefix in naming them, so as to ensure they function as expected.

"Animal" - must be used when the event spawns animal objects. "AnimalWolfCustom" as an example.

"Item" - must be used when the event spawns items. "ItemSeachest" as an example.

"Vehicle" - must be used when the event spawns trucks or cars. "VehicleSarkaCustom" as an example.

"Static" - must be used for events that spawn buildings and/or other game objects like heli crashes and police wrecks. "StaticCustomHeli" for example.

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

If you would like to support me in my efforts to make coding Dayz XML easier for all, 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
Like

About the Creator

L.R

I mostly find myself here to release creative flair, but also like to pass on what knowledge I can, so the odd tutorial and/or guide worms it's way to the forefront of my mind along the way =)

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

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

    © 2024 Creatd, Inc. All Rights Reserved.