Jump to content
  • 0

Custom Map Buildings In Database


Skwizz

Question

So I've been wanting to make my own custom map, and like BetterDeadThanZed, I wanted to do it without making an obscenely large mission file. After days and days of playing in DayZ, I've finally stumbled upon a way to add buildings to the database. Allow me to explain how;
 

First, you'll need a building. Go into the ArmA 2 editor, for those that don't know, you'll have to go to the ArmA 2 main menu, the one you see when you start up the game, not the lobby of the server. Afterwards, press ALT + E and click on Chernarus, then follow Blur Gaming's guide to get started. Once you're ready to start placing buildings,pick any building you like. For my example, I'm going to use the supermarket, A_GeneralStore_01. Now once you've placed the building, save it and name it whatever you like, but remember what you've named the map.

 
Now exit out of DayZ completely and find your way to Wofjwof's map script tool. You'll need to upload your map file you just created, so when the dialogue box opens, find your way to your Documents folder and then open the ArmA 2 Other Profiles folder. Once there, you'll see all of the usernames you have in your ArmA 2/DayZ player profiles. Make sure to open the one that has the username that you were using while creating the map, so for me, I would go in to the folder named Skwizz, and go into your missions folder. Inside, you'll see all of the maps that you've created while using that profile. Find the one you just created and open that folder, and inside you should find two files, a .BEIDI file and a .SQF file. The .BEIDI file is the one that the map script tool wants, so select it and return to the webpage with the map script tool. Before the map script tool can decode and translate it, you need to enter a Bliss username. It genuinely doesn't matter to us because we won't be using it, and you'll see what I mean in a minute, so for now just put the number 1 and click the Run Script button. Now, on the right, you should see the decoded file of the map you created. DO NOT CLOSE OR LEAVE THIS PAGE YET.

 

Now you'll need to go in to your database and find the table called object_data. Insert a new row and give it an ObjectID that is completely unique, and make sure it is strictly numeric. Same goes for ObjectUID, enter a unique sequence of only numbers in that field. In the Instance field, look at all other entries in the database and enter the same number you find, mine happens to be 11. Almost every other field except Classname and Worldspace can be left blank if you wish, and if you for some reason don't want it to be blank, I won't be covering it in this tutorial, just look at the rest of the table and draw your own conclusions. For the Classname field, go back to your decoded map on the map script webpage and look at the panel on the right. The panel contains a raw SQL query, so find the part at the very top that says VALUES. After that, in the first set of parenthesis, you'll find your building's data. You'll need to copy what's in the second set of apostrophe (or apostrophi, if you prefer), as that is the class name of the building you want to place in your world. Using the supermarket as an example again, I would copy MAP_A_GeneralStore_01. Now go back to the object_data table in the database and in the Classname field, paste the building's class name. Go back to the map script web page once more, and this time look at the second section of the SQL query, the one that begins with INSERT INTO. Again, after the VALUES piece, you'll find another set of parenthesis, this one more complex than the first. You'll find three things inside, two numbers and brackets containing a bunch of numbers. What you want to copy is the brackets with the numbers, yes copy the brackets as well. This is the world space that the building will go in. And now, as one might have figured out, go back to the object_data table in the database and find the Worldspace field and paste that data into it. So for example, I put my store on the shore in that empty space West of Kamenka, so my Worldspace is [4.39,[1243.22,2379.81]]. We're almost done, just a few more tweaks left.

 

Take note of that bracketed number we just pasted into the Worldspace field. There should be four numbers, and it should look similar to this: [first number,[second number,third number,fourth number]]. Notice my example didn't have one. For some strange reason, the game will not render the building if it does not have a fourth number, or if the fourth number is zero. So, let's change that to 0.001. Okay, now the Worldspace column looks like this [4.39,[1243.22,2379.81,0,001]] and the game should now render the building, but there's one more problem; this building spawns loot and zombies in-game, but as of right now, it shouldn't spawn loot. This is because we've entered the Classname of an ArmA 2 building, and thanks to the tip from maca134, I learned that in order to change it into a DayZ building that spawns both loot and zombies. All we need to do is change the Classname from MAP_A_GeneralStore_01 to Land_A_GeneralStore_01. This can be applied to nearly every building that can be placed, so if you choose a building other than the supermarket, simply change the MAP_ prefix to Land_, and you'll have yourself a working DayZ building without touching the mission file, just restart the server and it should be spawned where you set it to be, whether it's on the shore like I put mine, or if it's somewhere else.

 

I know it looks like a lot, but once you get used to doing it, it gets easier and easier, it's just a bit time-consuming, but it should keep your mission file size down relatively low.

 

FAQ

 

What are the numbers in the Worldspace brackets?

Those are the coordinates and degree of rotation of the building.

 

I don't like how my building is, can I change it without repeating the whole process?

Yes, the Worldspace coordinates entered in the database control everything about the building's placement.

 

Okay, would you mind telling me how to change them?

First we should observe the 4-number explanation above. The first number inside the first bracket, [X[x,x,x]], is the degree of rotation of the building.

Needless to say, this number should be anywhere from 0 to 359. The second number, which is the first number in the second bracket, [x[X,x,x]],

is the coordinate along the x-axis, from the West side of the map to the East. The third number, the second number in the second bracket, [x[x,X,x]],

is the coordinate along the y-axis, from the South of the map to the North. The fourth number, the final number in the second bracket, [x[x,x,X]],

is the elevation if the building's center point form the point on the map that is underneath the center of the building. I would call it the z-axis,

but it seems inappropriate to call it that since the plane isn't a "plane", in technical terms. Edit these as you see fit.

 

I see vehicles in that table as well, will the new buildings affect them?

The building shouldn't effect them directly. However, it might increase the total vehicle count of the server, and if the server's vehicle limit

is met, it may stop new vehicles from spawning. However, this is untested as of yet, and I could be completely wrong.

 

REMEMBER TO RESTART THE SERVER EVERY TIME TO SEE THE CHANGES

IT IS RECOMMENDED TO TEMPORARILY LOCK THE SERVER TO PREVENT PLAYERS FROM LOSING VEHICLES AND GEAR

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Im sorry but this is a bad idea. Problem is there is an upper limit to how many objects you can pull from the database (this includes, vehicles, player builds, etc). Adding this way also adds each object to the server monitor, adding more load to the server.

 

Stick sqf's best way, i promise.

Link to comment
Share on other sites

  • 0

Although I think it might make an excellent tutorial for adding new vendors. One of the issues I've found is trying to get ingame coordinates. Using the above steps should in theory allow me to create a vendor, get the coordinates and add them to the mission files. Isn't this how Epoch adds in trader camps?

Link to comment
Share on other sites

  • 0

The coordinates for traders, and the trader city items such as tables etc I found in the mission pbo, in mission.sqf I believe. 

 

_unit_13 = objNull;
if (true) then
{
  _this = _group_1 createUnit ["Profiteer4", [11449.484, 11341.03, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _unit_13 = _this;
  _this setDir 34.525925;
  _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
  _this setUnitAbility 0.60000002;
  _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;
};

 

 

For example the above guy is a trader at Klen. 

 

I'm still learning how it all works but I am presuming your method adds the building server side to the same table where spawned in vehicle data counts and would therefore count as a world "vehicle" whereas the system Epoch uses is another method of client side spawning to place buildings, and the traders. Using your first step has allowed me a way to easily find ingame coords which was something I was struggling with having to use a in-game map coordinate converter to get the world space numbers. 
 
For low vehicle counts servers, the odd building won't affect much in terms of server performance. One issue I think that does is the purchased cars since they keep adding to the db, and I am not sure if they are controlled by the vehicle cap. 
Link to comment
Share on other sites

  • 0

Take a look here, for large edits I would suggest installing them server side to decrease mission file size for your playerbase. All options are provided with instruction on this thread -> http://dayzepoch.com/forum/index.php?/topic/2328-for-all-aspiring-dayz-architects-how-to-make-custom-map-content/

Link to comment
Share on other sites

  • 0

Take a look here, for large edits I would suggest installing them server side to decrease mission file size for your playerbase. All options are provided with instruction on this thread -> http://dayzepoch.com/forum/index.php?/topic/2328-for-all-aspiring-dayz-architects-how-to-make-custom-map-content/

 

That's how I do mine. I put the map edits server side. Small mission file, AI can't see you through it... awesomeness.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...