Adding Custom Buildings

Hey everyone! I admin a Vilayer server and we've finally started getting down to work and spawning in some custom buildings. We're planning on forming several squads and wanted to set up bases for them. While poking around different objects on the DayzSuerHive we came across this group quite quickly: http://www.dayzsuperhive.co.uk/arma-ii-compositions.html
These seemed to be perfect for us! We started adding in buildings in the database and not one of the items on the page that we tried would work. We had more than a few buildings refuse to show up at all. We were able to get a cross with a helmet, a large hanger, and a vehicle repair station to spawn. Can someone explain where we went wrong? We have seperate IDs, Class names, the correct worldspace... I don't know a lot about scripting but I do know this.
Why is it I can spawn only a small number of buildings in when they are available in the game itself? We also have Rmod, but I know that doesn't have anything to do with this.
 
I found some instructions here: http://dayzmod.com/forum/index.php?/topic/121980-adding-buildings/
and after a TON of tweaking and changing things I got it to work. Last night I was at wit's end trying to understand this and did one more google search today and hit gold. I'll leave this here for anyone else having trouble with those compositions! If an error pops up that one item is "no longer available" or something along those lines then dig through the mission.sqm to find that specific item and delete it. Make SURE you then alter all the numbers afterwards. I brought in a "cityBase04" and one item (started with misc) was invalid. It prevented the rest of the items after it from spawning. As soon as I removed it and edited all the numbers everything spawned in perfectly. This has opened up an amazing new world for us!
 

Gramps

Member
Hi,

After many hours of reading threads and trying several things I found the easiest way is to join your server to login screen where your player name is and then hit esc to multiplayer option and then control E to get in editor mode and pick map you use. Go into 2D edit and establish Center, Group and one playable unit on map and go into 3d editing.

Put down your items and don't pick any vehicles and use familiar items for what you normally see in dayz. Save as mpmission and singleplayer and if its alot of items save often. When you have what you need and have saved exit the editor and go into you Arma2 folder or ArmaOA folder that has a folder "other profiles" and the find your player name folder and look for the saved file you saved.

Open in notepad ++ and copy everything below the top information that shows "Center" and next section "Group" and third section "player" You want to copy from first object you created to end of the file.


Paste this in a new page in notepad ++ and call it "yourbasename.sqf" Make sure it ends with two sets of }; };

at top of this page insert this

if (isServer) then {

then below this is your first object so here is example of top of your page:

if (isServer) then {

_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["Land_HBarrier_large", [2193.7917, 12840.767, -0.13677154], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setDir 13.004638;
_this setPos [2193.7917, 12840.767, -0.13677154];

blah blah blah (rest of objects then at bottom)

};

}:



then go into your mission.pbo main folder and create a folder called "buildings" make sure you save your new yourbasename.sqf into that building folder.

then open your init.sqf folder towards the top of that file you will see a player_monitor section right after that insert

should look like this

//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
//_playerMonitor = [] execFSM "admintools\player_monitor.fsm";
_nul = [] execVM "playerspawn.sqf";
[] execVM "custom\kh_actions.sqf";
"heliCrash" addPublicVariableEventHandler {
_list = nearestObjects [_this select 1, ["CraterLong"], 100];
{deleteVehicle _x;} foreach _list;
};

};

//here add your building folder sqf info like the following:

sleep 20;
//////////BUILDINGS//////////
[] execVM "buildings\yourbasename.sqf";


now save and exit. note: you don't have to use sleep 20; if its one or two of these sqf but if you are adding like 10 or more then use that to stagger your loading of the server for users.

repack your mission.pbo and upload your new base

If you have several bases its best to add each one on its own so just add another line like this

[] execVM "buildings\yourbasename.sqf";
[] execVM "buildings\yourbasename2.sqf";

and on and on also put your secondbase sqf in the building folder from up above in this message.

This works for me although its client side not server so it does cause your download file for users to get bigger.

You can put these server side and if you use AI they cannot see client side buildings but they do see server side ones.

I have found the client side is ok for me so far but will probably move to the server side option soon.

To put server side you would put this info in your dayz.server.pbo and change the path of buildings to where your server files are example:

[] execVM "\z\addons\dayz_server\buildings\base.sqf";

Also in that instance you would put your building folder in the dayz.server.pbo main folder.

Hope this isn't as confusing as most the threads I tried to follow lol

its my first one :)

Gramps

Grumpyworld Epoch
Grumpyworld Chernarus 1.7.7.1

both on Dayz Commander with lots of poop
 

Gramps

Member
Forgot to mention that if you put server side that you put your info in the init.sqf thats in the dayz.server.pbo folder


Must of been smoking crack what I should of said is in the server side init folder the
server_functions.sqf is where you call your custom additions.
 
Last edited:

ordmandell

New Member
I found some instructions here: http://dayzmod.com/forum/index.php?/topic/121980-adding-buildings/
and after a TON of tweaking and changing things I got it to work. Last night I was at wit's end trying to understand this and did one more google search today and hit gold. I'll leave this here for anyone else having trouble with those compositions! If an error pops up that one item is "no longer available" or something along those lines then dig through the mission.sqm to find that specific item and delete it. Make SURE you then alter all the numbers afterwards. I brought in a "cityBase04" and one item (started with misc) was invalid. It prevented the rest of the items after it from spawning. As soon as I removed it and edited all the numbers everything spawned in perfectly. This has opened up an amazing new world for us!
the link no longer works and I could seriously use that help :( no loot on my server now, only on zeds!
 
Top