Doc
Valued Member!
How to add buildings to chernarus without editing the mission file
Adding new buildings in DayZ without requiring your client to download your DayZ files or rMod is entirely possible. We can do this by utilizing the object_data table in the hivemind database.
Object_data is used for adding vehicles, tents, traps etc into the game world and saving their location. However, it doesn't matter what the class name of the object being added is - they are all the same whether they are Bicycles or Military Hangars.
STEP ONE: Location of your object
You first need to get a location of where you want to put your object, roughly. Do this by standing in the spot you want and opening your character_data table in Navicat or similar and grabbing the worldposition of your character. If your table was already open, you can just refresh the table to get your latest coordinates.
It will look something like this: [ppp,[xxxx,yyyy,zzz]]
The numbers are represented as follows:
p = compass direction you are facing
x = position on X axis from WESTERN side of map
y = position on Y axis from SOUTHERN side of map
z = height
The positions are in meters, so you can use that to fine-tune your building location later on.
STEP TWO: Add a new column to object_data
This is an optional, but highly recommended step. It basically adds a bypass filter so your objects are not counted as vehicles by fGetVehCount.
Add the column "Landmark" to `object_data` as a TINYINT(1) data type. DEFAULT 0
Now edit fGetVehCount and replace it with this:
STEP THREE: Finding the classname of your desired object
Simple, just find it here (click me!)
Some objects and vehicles are banned, obviously. DayZ buildings spawn zeds, so becareful if using one when building a base.
STEP FOUR: Adding object into object_data
Now you need to add a new entry to object_data for your building.
For each data column:
ObjectID = carry on from your last highest ObjectID if it did not autoincrement itself
ObjectUID = A unique numerical ID for your building. I just give mine a prefix, eg 123 and then start counting after. ie 123001,123002 etc.
Instance = Same as your server instance, this is probably 1.
Classname = Class name of building you found in step three
Damage = 0
CharacterID = 0
Worldspace = The position you gathered earlier
Inventory = []
Hitpoints = []
Fuel = 0
Datestamp = the current datestamp (in navicat, double click on box and press green arrow)
It is VERY important that the irrelevant boxes (ie fuel etc) have the values specified, otherwise it will cause your server to crash.
If you added an object which has carrying capacity, IE an ammo box, you can set it's inventory the same way as you do a vehicle etc. For example:
[[[],[]],[["ItemJerrycan"],[10]],[[],[]]]
FYI: [[[guns-and-tools],[quantity]],[[items-and-ammo],[quantity]],[[backpacks],[quantity]]]
STEP FIVE: Saving and restarting the server
Now you have added your data to the table, save the table and restart your server. Remember to move your character out of the way first so you are not crushed! (I learnt the hard way...). Restart your server (using #restart is sufficient)
TADA Buildings!
Imgur album: http://imgur.com/a/w0DuK
Snippet of my admin base

Adding new buildings in DayZ without requiring your client to download your DayZ files or rMod is entirely possible. We can do this by utilizing the object_data table in the hivemind database.
Object_data is used for adding vehicles, tents, traps etc into the game world and saving their location. However, it doesn't matter what the class name of the object being added is - they are all the same whether they are Bicycles or Military Hangars.
STEP ONE: Location of your object
You first need to get a location of where you want to put your object, roughly. Do this by standing in the spot you want and opening your character_data table in Navicat or similar and grabbing the worldposition of your character. If your table was already open, you can just refresh the table to get your latest coordinates.
It will look something like this: [ppp,[xxxx,yyyy,zzz]]
The numbers are represented as follows:
p = compass direction you are facing
x = position on X axis from WESTERN side of map
y = position on Y axis from SOUTHERN side of map
z = height
The positions are in meters, so you can use that to fine-tune your building location later on.
STEP TWO: Add a new column to object_data
This is an optional, but highly recommended step. It basically adds a bypass filter so your objects are not counted as vehicles by fGetVehCount.
Add the column "Landmark" to `object_data` as a TINYINT(1) data type. DEFAULT 0
Now edit fGetVehCount and replace it with this:
Code:
BEGIN
DECLARE iVehCount SMALLINT(3) DEFAULT 0;
SELECT COUNT(*)
INTO iVehCount
FROM object_data
WHERE
Landmark = '0'
AND Classname != 'dummy'
AND Classname != 'TentStorage'
AND Classname != 'Hedgehog_DZ'
AND Classname != 'Wire_cat1'
AND Classname != 'Sandbag1_DZ'
AND Classname != 'TrapBear';
RETURN iVehCount;
END
STEP THREE: Finding the classname of your desired object
Simple, just find it here (click me!)
Some objects and vehicles are banned, obviously. DayZ buildings spawn zeds, so becareful if using one when building a base.
STEP FOUR: Adding object into object_data
Now you need to add a new entry to object_data for your building.
For each data column:
ObjectID = carry on from your last highest ObjectID if it did not autoincrement itself
ObjectUID = A unique numerical ID for your building. I just give mine a prefix, eg 123 and then start counting after. ie 123001,123002 etc.
Instance = Same as your server instance, this is probably 1.
Classname = Class name of building you found in step three
Damage = 0
CharacterID = 0
Worldspace = The position you gathered earlier
Inventory = []
Hitpoints = []
Fuel = 0
Datestamp = the current datestamp (in navicat, double click on box and press green arrow)
It is VERY important that the irrelevant boxes (ie fuel etc) have the values specified, otherwise it will cause your server to crash.
If you added an object which has carrying capacity, IE an ammo box, you can set it's inventory the same way as you do a vehicle etc. For example:
[[[],[]],[["ItemJerrycan"],[10]],[[],[]]]
FYI: [[[guns-and-tools],[quantity]],[[items-and-ammo],[quantity]],[[backpacks],[quantity]]]
STEP FIVE: Saving and restarting the server
Now you have added your data to the table, save the table and restart your server. Remember to move your character out of the way first so you are not crushed! (I learnt the hard way...). Restart your server (using #restart is sufficient)
TADA Buildings!
Imgur album: http://imgur.com/a/w0DuK
Snippet of my admin base

Guys please don't spam this with SQF discussion. You obviously can add buildings via SQF and it is easier, but not everybody has access to the mission file when they buy hosting from certain companies. This page is for THEM using the DATABASE method.
In response to an earlier post: the lighting is me throwing flares
In response to an earlier post: the lighting is me throwing flares