Jump to content

[HOW TO] Adding Custom Buldings Server Side


Indiculous

Recommended Posts

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

You maybe asking your self Server Side? Whats the difference?

 

Well adding your buildings server side not only makes your mission file smaller but prevents players from stealing your custom buildings you made!

 

1)To do so all you must do is open your dayz_server.pbo

 

2)Make a folder called Buildings

 

3) inside your Buildings folder add your buildings into there.

 

4) Open your init folder inside the the dayz_server and inside server_fucntions 

 

5) Next Go to the VERY Bottom 

 

and add this

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

Each time just add another under it for each file you add just change the name.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

UPDATE

 

make a file called customSounds.hpp and inside it paste

class CfgSounds 
{
sounds[] = {drink_water,playerSnoring,hero,danceMusic}; 
class drink_water 
{
name="drink_water";
sound[]={\z\addons\dayz_server\sounds\drink_water.ogg,0.9,1};
titles[] = {};
};

and then in the description.ext add this at the bottom

//customsounds
#include "customSounds.hpp"
Link to comment
Share on other sites

 

UPDATE

 

make a file called customSounds.hpp and inside it paste

class CfgSounds 
{
sounds[] = {drink_water,playerSnoring,hero,danceMusic}; 
class drink_water 
{
name="drink_water";
sound[]={\z\addons\dayz_server\sounds\drink_water.ogg,0.9,1};
titles[] = {};
};

and then in the description.ext add this at the bottom

//customsounds
#include "customSounds.hpp"
Link to comment
Share on other sites

Gotta have the sound files in the mission, as the clients need 'em too.

The clients will not get any access to the dayz_server files.

The way the buildings load in through the dayz_server files are that they are stored in their own variable and spawned on each client through the server.

With sound files, you have to have the sound file local (on the player's computer) in order to play it.

If the file size bothers you, you may have luck compressing it down.

Although, you may also have luck looking into https://community.bistudio.com/wiki/Multiplayer_Custom_Sounds_Tutorial

If clients can have sound files (50KB or less) shared between server and other clients, you might be able to set up a sound folder in your instance folder and see if it loads from there. Might work if you have a headless client, bonus for AI, too.

Link to comment
Share on other sites

moving sounds or textures server side wont work because clients can only use them if they have those files on their machine (thaty why it works in the mission file because everyone is downloading them) buildings work because its basically scripts and commands :)

Link to comment
Share on other sites

Hey guys a little help if you can.

 

I have followed the instructions as above. however my buildings do not appear on the map.

 

My question is, does it follow the same rules as per client side download. eg. 1st line of the client side building .sqf file would start off with ' 

 
 
if (isServer) then {
 
_vehicle_3 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_asf2_0_2000", [1139.8907, 2393.6802, 9.5367432e-007], [], 0, "CAN_COLLIDE"];
  _vehicle_3 = _this;
  _this setDir -26.330427;
  _this setPos [1139.8907, 2393.6802, 9.5367432e-007];
 

 

 

 
whereas the new file starts off like this.
 
activateAddons [ 
  "map_eu",
  "aif_arma1buildings",
  "pook_h13",
  "mbg_killhouses",
  "mbg_buildings_3",
  "mbg_african_buildings"
];
 
activateAddons ["map_eu", "aif_arma1buildings", "pook_h13", "mbg_killhouses", "mbg_buildings_3", "mbg_african_buildings"];
initAmbientLife;
 
_this = createCenter west;
_center_0 = _this;
 
_group_0 = createGroup _center_0;
 
_unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["BAF_Soldier_AR_MTP", [5179.8975, 2337.6011, -9.8732548], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setDir -582.72571;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_0 selectLeader _this;};
  if (true) then {selectPlayer _this;};
  if (true) then {setPlayable _this;};
};
 
_vehicle_8 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_runway_main", [5030.1729, 2319.3989, 4.4675632], [], 0, "CAN_COLLIDE"];
  _vehicle_8 = _this;
  _this setDir -59.957626;
  _this setPos [5030.1729, 2319.3989, 4.4675632];
};

 

 

Do I change the blue text in  2nd.sqf to resemble the first? or change it to something else or add to it ?

 

any help would be appreciated.

 

EDit: Ok sorted this out changes to first .sqf and silly me forgot to remove the last 3 lines as well. duh'''

Edited by MIckeyMouse
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...