Jump to content

Custom buildings


Nerostix

Recommended Posts

If possible can the init call a 2nd mission.sqf to add custom content?

 

// Add trader citys
_nil = [] execVM "mission.sqf";
// Add Custom Buildings
_nil = [] execVM "mission2.sqf";
 
Then just add your content into this sqf?
 
_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["Building ID", [Grid Location], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setDir Direction;
  _this setPos [Grid Location];
};

 

 

And so on... this would save players with a highly customized map to insert the buildings without having to increment the numbers to the first mission.sqf.

 

Cheers,

 

Bungle

Link to comment
Share on other sites

Well i tested it with a 2nd mission2.sqf in the same manner and it seemed to break everything with the mission not completing its load.

Was setup exactly as the above post. Since I am no coder may I ask the team if there to do this effectively?

 

I am guessing since there are duplicate vehicle ID's in the sqf files the mission doesn't know what to do with them. 

My 2nd mission2.sqf was about 280kb in size so it added a lot to the mission file.

 

 

Any help would be greatly appreciated as there must be a more effective way to do this than number manipulation and pushing it into the one .sqf

Link to comment
Share on other sites

Poke?!?  :lol:

I found a post that explained adding buildings/objects via a SQF in the mission file but there is no information it seems on the _vehicle_numbers to identify a clash/conflict

 

I am hoping to find a simpler way to add/change multiple buildings at once and avoid having to update the default mission.sqf when future updates change the file.

 

Message Directly to the Devs or Talented Coders: Would it be possible to add just at the end of the Init.sqf

// Add Custom Buildings
[] execVM "custom\buildings.sqf";

Then inside the buildings.sqf simply remove the _units _groups and _markers from your custom mission.sqf and add your _vehicles in this manner.

if (isServer) then {

_vehicle_21 = objNull;
if (true) then
{
  _this = createVehicle ["Base_WarfareBBarrier10xTall", [7578.8711, 3369.1152, -0.11031201], [], 0, "CAN_COLLIDE"];
  _vehicle_21 = _this;
  _this setDir -11.777323;
  _this setPos [7578.8711, 3369.1152, -0.11031201];
};

// Add more buildings/objects here

};
Link to comment
Share on other sites

If i am reading this right i take the epoch mission.sqf and start at the last used number adding my custom builds in from there following on the number from the last one.

 

If i do have this right (which i hope i havent) my community base has 1328 vehicle items, please dont tell me i need to rename all of that ?

 

 

 

cople of examples below

 

 

activateAddons [];
initAmbientLife;
 
_this = createCenter west;
_center_0 = _this;
 
_group_0 = createGroup _center_0;
 
_unit_1 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["DZ_Pastor", [1002.3361, 9984.6465, -343.79929], [], 0, "CAN_COLLIDE"];
  _unit_1 = _this;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_0 selectLeader _this;};
  if (true) then {selectPlayer _this;};
};
 
_vehicle_18 = objNull;
if (true) then
{
  _this = createVehicle ["Land_HBarrier5", [1005.822, 9970.418, -9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_18 = _this;
  _this setPos [1005.822, 9970.418, -9.1552734e-005];
};
 
_vehicle_20 = objNull;
if (true) then
{
  _this = createVehicle ["Land_HBarrier5", [1000.155, 9970.2227, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_20 = _this;
  _this setPos [1000.155, 9970.2227, -3.0517578e-005];

 

Link to comment
Share on other sites

Ok Guys,

With a bit of guidance from Nox I managed to find a way to "easily" add your own custom buildings and objects to your servers.

Skip 1 and 2 if you have your mission ready.

1. Create your mission in the 2D/3D Editor.
Easy Ways: Just add -mod=@dayz_epoch to a custom shortcut to Arma2 OA or in your Parameters in Dayz Commander and hit Launch now,
"Extra maps just also include that @map with a ; between to make avail in the editor."

2. Add your Center, Group and Unit (Make sure its playable so you can save) Then add buildings via Vehicles area and "MAP: Objects"
Save once happy.

3. Goto your mission folder "Usually mydocs/arma II/missions

4. Edit the mission.sqf and delete all _Center _Group _Unit Sections and copy all whats left. Should be just. - ** Be sure not to save this file.

_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["Base_WarfareBBarrier10xTall", [7578.8711, 3369.1152, -0.11031201], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setDir -11.777323;
  _this setPos [7578.8711, 3369.1152, -0.11031201];
};


_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["Base_WarfareBBarrier10xTall", [7563.8057, 3365.0383, -1.7166138e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setDir -19.041046;
  _this setPos [7563.8057, 3365.0383, -1.7166138e-005];
};

etc etc..

Add those objects left between this simple code in a new text doc editor

if (isServer) then {

// Add Stuff here and remove me

};

Save that new file as whatever.sqf

Add whatever.sqf to the root directory of your mp mission folder

i.e
DayZ_Epoch_11.Chernarus or dayz_mission.bpo or others? depending on host.

Then last but not least edit your init.sqf to include this at the bottom.

[] ExecVM "whatever.sqf";

Repack or upload/update and your done.

Your custom buildings should now be available.

Most of the Map objects seem to work, however some with animations seem to report errors.

I will collaborate a list here of things I find that report errors.


Thanks to those that helped.

Please note that you may need to check or modify these when the moderators release updates so your buildings/objects do not conflict.

Cheers,

Mr B

Edited by Bungle
Code change.
Link to comment
Share on other sites

Excellent tutorial.  I had added quite a few custom objects when I was running Chernarus, but when I switch to Taviana I decided not to do it because it was usually a bit of a pain to move them over after an upgrade (OK, just copying/pasting lines, but still).  With this, I'll probably start doing it again.  Thanks Bungle and Nox!

Link to comment
Share on other sites

I does get quite big however when you start adding more and more. You can either add to the previous file or create a new whatever2.sqf if you have started with a blank mission again adding another call like the last.

[] ExecVM "whatever2.sqf";

Testing it with a copyof my old "Dayz Madhouse" server currently with around 1500+ objects including new towns, upgrades to previous and my WIP Villages.

 

The single .sqf is at 300kb and growing. 

 

With 2/3 the custom villages alone it is 150kb.

 

I suggest to only update when you are happy as each modification changes the mission file and then needs to be re-downloaded.

 

I will be releasing my custom villages soon for players to add in this way then come updates adding in functions to the villages and more.

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  We used to have buildings that could be partially submerged on Lingor and they were level, not contouring with the ground.  Lately we cant get them to do that, they slope with the ground so placing a partially submerged hanger to make boat parking isn't working.  The hangar sits angled with the shore instead of level.

 

  Are all of your buildings doing the same?

 

Thanks

Link to comment
Share on other sites

I tend to find "flat" land that would support the size of the building/objects. I hate sloping and land peaking through enter-able buildings.. I will check all of my objects and let you know.

 

So far I have only tested the Village Sites as they were on flat surface they all seem fine.

 

I have read somewhere there is a variable you can add to the building to set it always stay vertical no matter the land shape below.

 

Once again tho will test it extensively with what I have added so far and let you all know the results.

Link to comment
Share on other sites

I tend to find "flat" land that would support the size of the building/objects. I hate sloping and land peaking through enter-able buildings.. I will check all of my objects and let you know.

 

So far I have only tested the Village Sites as they were on flat surface they all seem fine.

 

I have read somewhere there is a variable you can add to the building to set it always stay vertical no matter the land shape below.

 

Once again tho will test it extensively with what I have added so far and let you all know the results.

 

  Yeah historically the issue has been that buildings always stay level and ground pops through the floor.  Now it seems the opposite. 

 

  Good looking villages by the way.

Link to comment
Share on other sites

Ok Guys,

With a bit of guidance from Nox I managed to find a way to "easily" add your own custom buildings and objects to your servers.

Skip 1 and 2 if you have your mission ready.

1. Create you mission in the 2D/3D Editor

Easy Ways: Just add -mod=@dayz_epoch to a custom shortcut to Arma2 OA or in your Parameters in Dayz Commander and hit Launch now,

"Extra maps just also include that @map with a ; between to make avail in the editor."

2. Add your Center, Group and Unit (Make sure its playable so you can save) Then add buildings via Vehicles area and "MAP: Objects"

Save once happy.

3. Goto your mission folder "Usually mydocs/arma II/missions

4. Edit the mission.sqf and delete all _Center _Group _Unit Sections and copy all whats left. Should be just. - ** Be sure not to save this file.

_vehicle_1 = objNull;

if (true) then

{

  _this = createVehicle ["Base_WarfareBBarrier10xTall", [7578.8711, 3369.1152, -0.11031201], [], 0, "CAN_COLLIDE"];

  _vehicle_1 = _this;

  _this setDir -11.777323;

  _this setPos [7578.8711, 3369.1152, -0.11031201];

};

_vehicle_2 = objNull;

if (true) then

{

  _this = createVehicle ["Base_WarfareBBarrier10xTall", [7563.8057, 3365.0383, -1.7166138e-005], [], 0, "CAN_COLLIDE"];

  _vehicle_2 = _this;

  _this setDir -19.041046;

  _this setPos [7563.8057, 3365.0383, -1.7166138e-005];

};

etc etc..

Add those objects left between this simple code in a new text doc editor

if (isServer) then {

// Add Stuff here and remove me

};

Save that new file as whatever.sqf

Add whatever.sqf to the root directory of your mp mission folder

i.e

DayZ_Epoch_11.Chernarus or dayz_mission.bpo or others? depending on host.

Then last but not least edit your init.sqf to include this at the bottom.

[] ExecVM "whatever.sqf";

Repack or upload/update and your done.

Your custom buildings should now be available.

Most of the Map objects seem to work, however some with animations seem to report errors.

I will collaborate a list here of things I find that report errors.

Thanks to those that helped.

Please note that you may need to check or modify these when the moderators release updates so your buildings/objects do not conflict.

Cheers,

Mr B

 

 

 

 

Okay, seems to half work for me, not sure what is wrong. Only some of the buildings around the map seem to be appearing. Half of a custom base... ect. What am I doing wrong followed the steps perfectly.

 

Thanks for any help!

 

Falcon

Link to comment
Share on other sites

Hmm not sure.. all of the build classes spawn for me that I have tried so far but I am yet to test them all and yet to fully test the extent of @MAP 

 

I do know some of the buildings have animations that are not available when added via the mission files like this and will give you an error when joining the server, but still load in.

 

If you have an trouble there are two other mods/addons you can employ that also have the base DayZ buildings which should all work and which I used to use in the past.

 

https://www.dropbox.com/s/6w6gvfi74j6guc1/Building%20Mods.zip

 

Simply extract these to your OA Directory like other mods and then add to your custom launch parameters like before.

 

-mod=@dayz_epoch;@ASG;@Jon_EditorUpdate

 

The other thing to check is to make sure there are no extra }; in the bulk of your buildings closing your if statements early.

 

Sorry I cant be that much more help.

 

Cheers,

 

Bungle

Link to comment
Share on other sites

yeah, i've found this really good.

After i put All my mod Mission.sqf, in DayZ\Mission.SQF

 

Really long and leazy .....

Now it's more Fast and furious

 

Do you get loot spawning at your custom spawned buildings etc?? see my above post it been bugging me for days, is there anything i must do in the mission editor or anything??? Ive heard you have to create a custome array or something to find you buildings and put loot in????

 

 

Thanks

Link to comment
Share on other sites

We've added a few buildings at "Suicide Bridge" at Kamenka, barriers at trader cities, a abandoned airfield in the north, barracks in various places.

 

1015789_10152337384936494_1321691052_o.j

 

980192_10152322367636494_30200522_o.jpg

 

Just use Arma 2 OA editor (Alt+E in menu)

Create a center, group and playable unit, then build away. Save the mission file, open it in Notepad++, grab all the buildings and paste into mission.sqf in your Epoch mission file, not forgetting to change the item numbers to continue from the Epoch ones.

Link to comment
Share on other sites

Do you get loot spawning at your custom spawned buildings etc?? see my above post it been bugging me for days, is there anything i must do in the mission editor or anything??? Ive heard you have to create a custome array or something to find you buildings and put loot in????

 

 

Thanks

 

 

If you're having problems with loot spawning, make sure your buildings are named correctly in the mission.sqf file. I've found that although the buildings will appear with a few different variations in the naming, they only spawn loot with the correct "DayZ acceptable" naming. Use http://picacid.com/arma2/loot_en.html and/or http://dayzsuperhive.co.uk/dayz-buildings.html to verify correct naming and see if loot spawns after correcting anything.

Link to comment
Share on other sites

 

 

If you're having problems with loot spawning, make sure your buildings are named correctly in the mission.sqf file. I've found that although the buildings will appear with a few different variations in the naming, they only spawn loot with the correct "DayZ acceptable" naming. Use http://picacid.com/arma2/loot_en.html and/or http://dayzsuperhive.co.uk/dayz-buildings.html to verify correct naming and see if loot spawns after correcting anything.

 

Thank you for this was a total oversight and facepalm moment for me, I use a map editor prog and before all the item IDs it places MAP_ the building spawns but loot dont fixed now thank you..

Link to comment
Share on other sites

The @Map objects seem to be for beatification...

 

I have noticed that the "MAP_zavora_2" object which is an animated stop barricade needs to be replaced with "ZavoraAnim" in the .sqf files you are using for them to not error message to client.

 

The "MAP_Toilet" also seems to report errors when joining to clients..need to find another place to number 2..  :(

Link to comment
Share on other sites

If anyone is after some packs for these they are releasing over in the Server Mods Area.

 

http://dayzepoch.com/forum/index.php?/forum/28-server-mods-corner/

 

So far we have some Points of Interest by Vox, Extra Buildings Packs, Race Tracks and Trader Villages by myself and I am sure lots more to be added soon.

 

The installation is simple and so far no noticeable lag/frame drops and if your working on your own soon or currently you can add/adapt around some of these packs you like.

Link to comment
Share on other sites

I've followed these instructions and have managed to get custom buildings to spawn on my server, unfortunately they seem to spawn 2 or 3 times in the same place meaning I have to open 2 or 3 sets of doors to get into a fire station or barracks, is there any reason it is doing this? 

 

Thanks for any help you can offer!

Link to comment
Share on other sites

Commonly this will happen if you actually have 2/3 buildings in the same place.

 

I once doubled up my buildings in the old Bliss DB structure.. was fun seeing double loot in barracks, but annoying opening two sets of doors.

 

I would look to your sqf file to make sure you aren't making duplicates of buildings in the same place. Only thing I can think of.

Link to comment
Share on other sites

  • 3 weeks later...

Hi everybody. The same problem as in the Spectr. If I put 3 barrels, then in the game, if I shoot them or shifted, they will be 10 (for example). Put the building, and I must open two doors. I put one flag appears 3-4. In the editor i hanen't such problem. Each item is separate and is not duplicated. Sorry if something is not clear.
This is code in mission2.sqf file:

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Barrel_water", [6244.1846, 2325.064, 0], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setPos [6244.1846, 2325.064, 0];
};

_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Barrel_water", [6247.7021, 2326.3164, 0], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setPos [6247.7021, 2326.3164, 0];
};

_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Barrel_water", [6245.1401, 2328.7124, 0], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setPos [6245.1401, 2328.7124, 0];
};

processInitCommands;

d5z7RR3f.png

my init.sqf
 

/*	
	INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];

//REALLY IMPORTANT VALUES
dayZ_instance =	11;					//The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;

//disable greeting menu 
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
enableRadio false;

// DayZ Epoch config
spawnShoremode = 0; // Default = 1 (on shore)
spawnArea= 1500; // Default = 1500
MaxHeliCrashes= 10; // Default = 5
MaxVehicleLimit = 300; // Default = 50
MaxDynamicDebris = 500; // Default = 100
dayz_MapArea = 14000; // Default = 10000
dayz_maxLocalZombies = 60; // Default = 40 

_logistic = execVM "=BTC=_Logistic\=BTC=_Logistic_Init.sqf";

//Load in compiled functions
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";				//Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "debug\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";				//Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";	//Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";				//Compile regular functions
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "addons\UPSMON\scripts\Init_UPSMON.sqf";
call compile preprocessfileLineNumbers "addons\SHK_pos\shk_pos_init.sqf";
call compile preprocessFileLineNumbers "server_traders.sqf";				//Compile trader configs
progressLoadingScreen 1.0;
call compile preprocessFileLineNumbers "custom\compiles.sqf";

"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";

player_spawn_2 = compile preprocessFileLineNumbers "debug\player_spawn_2.sqf";


if ((!isServer) && (isNull player) ) then
{
waitUntil {!isNull player};
waitUntil {time > 3};
};

if ((!isServer) && (player != player)) then
{
  waitUntil {player == player}; 
  waitUntil {time > 3};
};

if (isServer) then {
	call compile preprocessFileLineNumbers "dynamic_vehicle.sqf";				//Compile vehicle configs
	
	// Add trader citys
	_nil = [] execVM "mission.sqf";
	_serverMonitor = 	[] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
};

if (!isDedicated) then {
	//Conduct map operations
	0 fadeSound 0;
	waitUntil {!isNil "dayz_loadScreenMsg"};
	dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
	
	//Run the player monitor
	_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
	_playerMonitor = 	[] execVM "\z\addons\dayz_code\system\player_monitor.sqf";	
	_void = [] execVM "R3F_Realism\R3F_Realism_Init.sqf";
	"heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
};

[] execVM "mission2.sqf";

sleep 1; _fast_rope =   [] execVM "addons\BTC_fast_roping_init.sqf";

[] execVM "addons\SARGE\SAR_AI_init.sqf";

Any ideas how to fix this?

 

Update/

Problem was fixed, when put .sqf file under basic "mission.sqf"

if (isServer) then {
	call compile preprocessFileLineNumbers "dynamic_vehicle.sqf";				//Compile vehicle configs
	
	// Add trader citys
	_nil = [] execVM "mission.sqf";
	_nil = [] execVM "mission2.sqf";
	_serverMonitor = 	[] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
Link to comment
Share on other sites

I use Jon3C ArmA 2  editor, it adds lots of extra content to the 3d editor that DO spawn loot. Then you jsut take the "vehicle" data from the map file and create a new .sqf and execute it fom the init.sqf file in you missions.pbo

Link to comment
Share on other sites

  • 2 weeks later...

I'm used to adding buildings via database by using a tool I found that imports .sqf files into the database, but apparently Epoch doesn't use the instance_building table? Any way to import the buildings to the database? I would prefer that method rather having these extra buildings in my mission file.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...