HOW TO ADD MORE BUILDINGS TO BASE BUILDING 1.2

FallingSheep

OpenDayZ Lord!
HOW TO ADD MORE BUILDINGS TO BASE BUILDING 1.2
-------------------------------------------------------------------------
Assumes you have Base building already working(see link below)
http://opendayz.net/threads/base-building-dayz-1-2-released.8579/

STEP 1
-------------------------------------------------------------------------
open MPmissions\Dayz.Chernarus\dayz_code\external\dy_work\Build_List.sqf

find this line
Code:
[[0, 0, 1, 0, 0, 0], "Fence_Ind",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]] //Fence_Ind    --34 *** Remember that the last element in array does not get comma ***

copy this line and change "Fence_Ind" to the class name of the building/object you want EG: "Land_ladderEP1"

*** Remember that the last element in array does not get comma ***

IMPORTANT: EACH item must have a different recipe or they wont work!
set the required building materials by changing the numbers at the start
[TankTrap, SandBags, Wires, Logs, Scrap Metal, Grenades
[0, 0, 1, 0, 0, 0]

EG: 2 tanktraps and 2 logs [2, 0, 0, 2, 0, 0]

now set any other options using the true/false section
below is a example setup and what each option means
(not all options work as far as i can tell needs more work)

_toolBox, _eTool, _medWait, _longWait, _inBuilding, _roadAllowed, _inTown, _removable, _isStructure, _isSimulated, _isDestructable];
true, true, true, false, false, true, true, false, false, true, false

must have toolbox
must have entrenching tool
medium wait time
no long wait time (only use one wait time)
cant be built in buildings
cant be built on roads
cant be built in towns (this requires additional setup just)
cant be removed
is not a structure
is simulated (not sure what this does)
is not destructible

STEP 2
-------------------------------------------------------------------------

now open @day_server\dayz_server\init\server_functions.sqf

find this line
Code:
[[0, 0, 1, 0, 0, 0], "Fence_Ind",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]] //Fence_Ind    --34 *** Remember that the last element in array does not get comma ***

copy this line and change change "Fence_Ind" to the class name same name you used in step 1 EG: "Land_ladderEP1"

set the required building materials to same as you used in step 1

now set any other options usnig the true/false section to same as you used in step 1

STEP 3
-------------------------------------------------------------------------
now to add the new building/object image to the recipe list

open MPmissions\Dayz.Chernarus\dayz_code\buildRecipeBook\images\buildable
and paste in your image for you new building/object
IT MUST BE 256x256 AND JPG

STEP 4
-------------------------------------------------------------------------

now you have to add the building/object to the Data Base

open your Data Base using your DB editor (eg Navicat)
open the table Deployable and add a record using the class name of the building/object you used above in step 1 EG: "Land_ladderEP1"

STEP 5 ( IF BUILDINGS DISAPPEAR AFTER BEING BUILT )
-------------------------------------------------------------------------
open dayz_server\compile\server_publishObject.sqf
find this line

if (!(_object isKindOf "Building")) exitWith {
deleteVehicle _object;
};

and change it to this

//if (!(_object isKindOf "Building")) exitWith {
// deleteVehicle _object;
//};

If your items are disappearing after server restart, find your variables.sqf
There is an array 'SafeObjects = ["blah","blah"]; Add the names of your objects to this array, save and compile. Your items should now not disappear!

STEP 6
-------------------------------------------------------------------------
pack up your PBOs and enjoy your new buildings :p

CREDIT TO Bejasc3D FOR MISSING BUILDINGS FIX
THANKS TO daimyo21 FOR MAKING BASE BUILDING 1.2
 
HOW TO ADD NEW BUILDING MATERIALS

this code adds jerrycans as a type of material

please test it and let me know of any issues
MAKE SURE YOU MAKE BACKUP !!
-----------------------------------------------------------

STEP 1
-----------------------------------------------------------
open dayz_server\init\server_functions.sqf and find this line
Code:
buildlist = [
[[0, 1, 0, 0, 1, 1], "Grave",                        [[0,2.5,.1],[0,2,0],    0,    true, true, true, false, false, true, true, false, false, true, false]],//Booby Traps --1
we only need the front set of numbers

[0,1,0,0,1,1] now add a extra 0 (1 if you want your new item to be req for building) so your array looks like this [0,1,0,0,1,1,0]
now add the extra 0 to EVERY object

do this in MPMissions\dayz.chernarus\dayz_code\external\dy_work\build_list.sqf as well


STEP 2
-----------------------------------------------------------
open MPMissions\dayz.chernarus\dayz_code\compile\player_build.sqf
and find this section of code

(it appears twice you need to add new item to BOTH sections)

Code:
if ("HandGrenade_West" in _mags) then {
        _qtyG = {_x == "HandGrenade_West"} count magazines player;
        _buildables set [count _buildables, _qtyG];
        _itemG = "HandGrenade_West";
    } else { _qtyG = 0; _buildables set [count _buildables, _qtyG]; };

under it add this
Code:
if ("ItemJerrycan" in _mags) then {
        _qtyJ = {_x == "ItemJerrycan"} count magazines player;
        _buildables set [count _buildables, _qtyJ];
        _itemJ = "ItemJerrycan";
    } else { _qtyJ = 0; _buildables set [count _buildables, _qtyJ]; };

now find THE SAME section of code further down in the file and paste

Code:
if ("ItemJerrycan" in _mags) then {
        _qtyJ = {_x == "ItemJerrycan"} count magazines player;
        _buildables set [count _buildables, _qtyJ];
        _itemJ = "ItemJerrycan";
    } else { _qtyJ = 0; _buildables set [count _buildables, _qtyJ]; };
under
Code:
if ("HandGrenade_West" in _mags) then {
        _qtyG = {_x == "HandGrenade_West"} count magazines player;
        _buildables set [count _buildables, _qtyG];
        _itemG = "HandGrenade_West";
    } else { _qtyG = 0; _buildables set [count _buildables, _qtyG]; };

now find this section of code in the same file
Code:
 if (_qtyG > 0 && _classname == "Grave") then {
        for "_i" from 0 to _qtyG do
        {
            player removeMagazine _itemG;
        };
    };
and add this under it
Code:
    if (_qtyJ > 0 ) then {
 
        for "_i" from 0 to _qtyJ do
        {
            player removeMagazine _itemJ;
        };
    };

STEP 3
-----------------------------------------------------------
open MPMissions\dayz.chernarus\buildRecipeBook\refresh_recipe_dialog.sqf

find this line
Code:
_recipeQtyG= _requeriments select 5;
add this under it
Code:
_recipeQtyJ= _requeriments select 6;

now find this line
Code:
_qtyG=0;
add this under it
Code:
_qtyJ=0;

now find this section of code
Code:
if ("HandGrenade_West" in _mags) then {
    _qtyG = {_x == "HandGrenade_West"} count magazines player;
    _buildables set [count _buildables, _qtyG];
    _itemG = "HandGrenade_West";
} else { _qtyG = 0; _buildables set [count _buildables, _qtyG]; };
under it add this
Code:
if ("ItemJerrycan" in _mags) then {
    _qtyJ = {_x == "ItemJerrycan"} count magazines player;
    _buildables set [count _buildables, _qtyJ];
    _itemJ = "ItemJerrycan";
} else { _qtyJ = 0; _buildables set [count _buildables, _qtyJ]; };

now find this line
Code:
    (Build_Recipe_Dialog displayCtrl 1005) ctrlSetText format["x%1  (%2)",_recipeQtyG,_qtyG];

under it add this
Code:
  (Build_Recipe_Dialog displayCtrl 1007) ctrlSetText format["x%1  (%2)",_recipeQtyJ,_qtyJ];


STEP 4
-----------------------------------------------------------
open MPMissions\dayz.chernarus\buildRecipeBook\player_recipeBook.sqf
find this line
Code:
_letters=["T","S","W","L","M","G"];
change it to this
Code:
_letters=["T","S","W","L","M","G","J"];
 
Hey FallingSHeep ty for the tut, i was actually looking at doing something just like this, wondering if you could tell me where i went wrong haha. So I got basebuilding 2.0 script working just fine, things build, saved to db, survived restarts, panels worked, ect, so all that was fine. What I wanted to do was add to the recipe list a box that you could store shit in, like an ammo box, but that saves the contents to the database. so i already took care of linking "AmmoBoxBig" to save to the database, then i followed your tut here to add "AmmoBoxBig" to the recipe list and started it all up, shows on list and even show picture which is great. First problem is when i attempted to put it down i would get a create vehicle script kick, fixed that, but now i click build, it shows on the ground, but when i drag it it gradually goes further underground, or if i start building the box it will just dissapear ~5-8 seconds after showing up on the screen everytime, interesting to note that the script will continue to work and even give me the code for it even tho "nothing" was built. I thought at first that maybe dayz was detecting the ammobox and auto deleting it, as it always deleted within the same amount of time, so i checked the createvehicle log and it said

Code:
CreateVehicle Log: #0 *player name and guid* - #62 "AmmoBoxBig" 3:169 [8844,2152,2]
CreateVehicle Log: #0 *player name and guid* - #62 "WeaponHolder" 3:170 [8843,2152,2]
CreateVehicle Log: #0 *player name and guid* - #62 "WeaponHolder" 3:171 [8843,2152,2]

so is my dayz auto converting ammoboxbig to "weaponholder" or can you tell whats going on, im able to place regular objects still. I added to the two files
Code:
[[0, 0, 1, 2, 2, 0], "AmmoBoxBig",                    [[0,2.5,.3],[0,2,0],    0,    true, true, true, false, true, false, false, true, false, true, false]] //Storage Box --35
it has no comma because its the last item. And my "deployables" shows the Ammoboxbig
 
hmm haven't tried to add a storage container object yet i will get on to it now and let you know how i go.

i think you have to make the weapon box act as a tent (more on this when i know more :p )

as for the item sinking into ground does it place correctly after you build it/ stop moving?
the postion where the item shows up in game can be set with
Code:
[[0, 0, 1, 0, 0, 0], "Fence_Ind",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]] //Fence_Ind    --34 *** Remember that the last element in array does not get comma ***

_attachCoords, _startPos
[0,4,.7], [0,2,0],

UPDATE: i add "LocalBasicAmmunitionBox" to the build list and it builds fine but noticed that it has weapons and ammo in it so im guessing your ammo box does the same thing so now we just need to empty the box before its built (not sure how to ... yet :) )

try and disable BATTLE EYE and see if it lets you build the box and if it stays

UPDATE2: its defiantly not building cause of BATTLE EYE detecting the weapons/ammo in the box
 
well the ammoboxbig already works as a tent as i set it up to save to the database using this tutorial http://opendayz.net/threads/storage-boxes.9431/ the one markk talks about, except i skip the part where he puts in a fake survivor to circumvent auto-deleting due to non-use. and yes when i click build it pops up on the ground like usual, and i can move it (with the constant lowering problem) or start placing it, but no matter what I do within like 5 seconds it disappears like its being auto deleted by the server or something..
 
If it is because for some reason that ammoboxbig is auto deleted what could i use instead? in the original tutorial he used an ammobox but i want something medium size like a large box or even as big as a pallet, any suggestions on containers to use?
 
to fix the sinking mess around with this section of objects code [0,4,.7], [0,2,0] (not sure what to set to but change 1 number and test may take some time to get your item to place/appear properly.

i can only find ammo boxes but im trying to make a script to empty the ammo box of its content when you build it

UPDATE 1:
as far as i know you would need a mod to add a new type of storage im trying to figure out how DayZ Redux set up there storage box system ( i dont want to copy paste as you learn nothing that way :p )
 
Yeah actually i changed exactly that same value, but not enough apparently haha, thanks :) so your saying your ammo box worked because it just had ammo that was already in the game or whatever so not bad but my box had weird ammo or something that was then being caught by battleeye (yet not giving me a kick or something). In this case I could possibly be ok with it spawning a little ammo, make a couple grenades as a material or something lol i dunno
 
Oh and i wanted to further note that although i set _inbuilding to true it still gave the error cannot make in building, any recommendations? and also i tried disabling battleeye and building, same results so its not BE... :( and also manually putting the ammoboxbig into the instance deployables successfully spawns one there with no problem :/
 
youd have to ask daimyo21 about the features/settings of base building i just added extra buildings in
as for the ammo box not working i can build it and loot it but it wont stay after reset :(

NOTE the ammo box still has all weapons in it i cant clear it out yet :(
 
hi
and how we can change what item are req for building something
i wanna add jerrycans for building a fuletank

would make the guide perfto )
 
this re
hi
and how we can change what item are req for building something
i wanna add jerrycans for building a fuletank

would make the guide perfto )

ill add a tut soon on how to use other items as a material

NOTE
use only a item that already exists in arma2/dayz
 
How do I remove something that was built but not meant to be there?
Now I have built the zevoraanim but it moves everytime on server restart and an option to delete it isn't there, any help appreciated.


Thanks for this one though :) am gonna add in burning barrels :) which need 2 jerrycans, scrap metal and a tanktrap.
 
anyone get any ammo or storage boxes working with this?

Code:
[[1, 0, 0, 3, 0, 0], "USOrdnanceBox_EP1",                      [[0,5,.8],    [0,4,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],  //    --34 *** Remember that the last element in array does not get comma ***
[[2, 1, 0, 3, 0, 0], "Land_Barrack2_EP1",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[6, 0, 1, 0, 0, 0], "Land_radar_EP1",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 0, 0, 2, 1, 0], "Land_Ind_SawMillPen",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 0, 1, 3, 0, 0], "Land_Ind_Garage01",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 0, 1, 2, 0, 0], "Land_kulna",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 1, 2, 2, 0, 0], "GUE_WarfareBVehicleServicePoint",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[0, 0, 1, 2, 0, 0], "HeliHCivil",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[0, 1, 0, 2, 0, 1], "Land_Campfire_burning",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 0, 0, 1, 0, 6], "Land_Ind_TankSmall",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[4, 4, 1, 0, 1, 0], "Land_A_Castle_Bergfrit",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[2, 1, 0, 2, 0, 0], "Land_A_Castle_Stairs_A",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[4, 4, 0, 0, 0, 0], "Land_A_Castle_Gate",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[4, 4, 1, 0, 0, 0], "Land_A_Castle_Wall1_20",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[0, 0, 4, 4, 0, 0], "Land_Market_shelter_EP1",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[0, 0, 3, 3, 0, 0], "Land_covering_hut_big_EP1",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 0, 0, 0, 3, 0], "Land_ladder_half_EP1",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[2, 0, 0, 0, 3, 0], "Land_ladderEP1",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[1, 2, 0, 0, 2, 0], "MASH_EP1",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[4, 1, 0, 0, 1, 0], "Land_wagon_flat",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[3, 3, 1, 0, 1, 0], "Land_Misc_Scaffolding",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[4, 1, 0, 2, 1, 0], "Land_wagon_box",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[2, 0, 0, 0, 2, 0], "Land_RedWhiteBarrier",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[0, 0, 2, 0, 2, 0], "Park_bench2",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[5, 5, 0, 0, 0, 0], "WarfareBAirport",                      [[0,18,2],    [0,15,0],    0,    true, false, false, false, false, false, true, true, false, true, true]],
[[6, 0, 0, 0, 1, 1], "DSHkM_Mini_TriPod - 50Rnd_127x107_DSHKM",                      [[0,4,.7],    [0,2,0],    0,    true, false, false, false, false, false, true, true, false, true, true]]
 
Everything on here can be placed except for the ammo box, it just turns invisiblewhen you try to place it. Somethings like helipad, kulna and the sawmill roof thing dont stay after restart for some reason.

*Edit*
The turret does not work at all. I really want to create my own version of Lingor with many more cool features.
 
Wanted to ask about this: '1 if you want your new item to be req for building' if we put in like a burning barrel to be built with 2 jerrycans we have to put 1 instead of 0 ?
 
Allright, ive added the jerrycans to the basebuilding, now when making a burning barrel the 2 jerrycan required A. Do not show up in the build menu and B. The Jerrycans do not dissapear after making a burning barrel.

What do I have to do to make um dissappear after making them in your inventory and how do i let the jerrycans show inside the build menu ingame ?
 
Allright, ive added the jerrycans to the basebuilding, now when making a burning barrel the 2 jerrycan required A. Do not show up in the build menu and B. The Jerrycans do not dissapear after making a burning barrel.

What do I have to do to make um dissappear after making them in your inventory and how do i let the jerrycans show inside the build menu ingame ?

This is because you used the handgrenade code like he suggested. The way grenades work, they are not removed when you use them. Follow his tut but switch the hangrenade part out with a different item to copy.
 
Back
Top