How to add map edit to init.c - InclementDab/DayZ-Editor GitHub Wiki

We strongly recommend you use notepad ++ to edit any game files. If you don't have it .. get it here https://notepad-plus-plus.org/

Adding your map edit via init.c and have the buildings spawn loot, is really pretty easy to do.

See the step by step instructions below.

Open Dayz Editor, export your map edit to init.c give it a name.. then go to your (%localappdata%/DayZ/Editor) Open the file you just created .. then open your init.c in your (\mpmissions\dayzOffline.chernarusplus) folder.

This is what it looks like before any changes

Your init.c pre-changes

Now as pictured, add a space above the text void main()

Line above main void

Next copy and paste your the top portion of the init.c code that you exported from dayz editor, in that space you just created... (see image)

extra visual

add spawnobjects

Ok .. now for the objects you placed on the map ..below void main (see image)

adding objects

adding objects

Save the file and your done.. BUT, read on for loot in the buildings

One last thing to add .. this piece of code .. if you have buildings that you want to spawn loot after you add them to the init.c, you will need to add this and the remove the two // in front of it to this GetCEApi().ExportProxyData(Vector(7500, GetGame().SurfaceY(7500, 7500), 7500), 20000); Save the file, restart your server... (see image)

add to export loot

Only run this one time for every map edit you add .. then put the // back and save the file and restart the server. Now all the buildings you added will spawn loot.

BUT .. before you shut the server down , the server will create a new mapgroupspos.xml after the above command scours the init.c for new buildings and it will create it in mpmissions\dayzOffline.chernarusplus\storage_1\export or what ever map your running .. in the export1 folder you will see mapgroupspos.xml file, copy and paste that overwriting your old file in mpmissions

Commenting out loot export

Now if you have replaced the // GetCEApi().ExportProxyData(Vector(7500, GetGame().SurfaceY(7500, 7500), 7500), 20000); you can save your init.c and restart server.