Jump to content

Can't add custom buildings


AtricSky

Recommended Posts

Titel says it all.

But everytime i try to add a custom building to my server it won't show up.

So i checkt my arma2oaserver.RPT

And got this error:

 

   Error Undefined variable in expression: _vehicle

 File z\addons\dayz_server\init\server_functions.sqf, line 248

Error in expression <imit = _random select 1;

 

How do i fix this?

Help is apprenticed!

Link to comment
Share on other sites

The error you see in your log has nothing to do with adding buildings. That error means you have your max vehicle setting too high. There are no more vehicles to spawn so it's giving that error. Lower the limit and that will go away.

 

How are you trying to add the buildings to your server?

I have a folder in my MPMissons - DayZ_Epoch_11.Chernarus called Maps

So i put my custom buildings in that folder 

And then i got my my init.sqf and at the very bottom i type [] execVM "maps\what my sqf is called.sqf";

Link to comment
Share on other sites

First ... it sounds u didnt edit the file correctly to add to the server.
EXAMPLE 

Remove all of this 

 

 

activateAddons [ 
  "map_eu"
];
 
activateAddons ["map_eu"];
initAmbientLife;
 
_this = createCenter west;
_center_0 = _this;
 
_group_0 = createGroup _center_0;
 
_unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["BAF_Soldier_DDPM", [8122.9668, 9292.1338, 0], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_0 selectLeader _this;};
  if (true) then {selectPlayer _this;};
};
 
 
ADD THIS HERE 

if (isServer) then {
 
_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_A_Castle_Bastion", [8081.2798, 9261.9561, 9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir -79.236176;
  _this setPos [8081.2798, 9261.9561, 9.1552734e-005];
};
 
AT THE END OF THE MISSION.SQF FILE FROM EDITOR you will see something like 

vehicle_57 = objNull;
if (true) then
{
  _this = createVehicle ["Hhedgehog_concrete", [12322.168, 5650.9341, -0.00054931641], [], 0, "CAN_COLLIDE"];
  _vehicle_57 = _this;
  _this setDir -58.295269;
  _this setPos [12322.168, 5650.9341, -0.00054931641];
};
 
REMOVE THIS PART BELOW
 
processInitCommands;
runInitScript;
finishMissionInit;
 
ADD THIS 
 
};
 
 
so at the end of the file, you have 
 
 
  _vehicle_57 = _this;
  _this setDir -58.295269;
  _this setPos [12322.168, 5650.9341, -0.00054931641];
 
};
 
};

 

after you have that if you created your own file that is , if your using a custom you downloaded from here , or another forum. the above should be done already 

 

If its a file you downloaded 

then your not adding it to the server correctly

addingmaps1.jpg

 

You need to place the file in a folder inside your server folder to keep the all together make a folder such as buildings etc , place your file SQF for new area, building etc in that folder

 

addingmaps2.jpg

Once you have it placed in your new maps buildings or newcrap what ever you want to call the folder

 

then you have to go to your INIT folder to this file server_functions.sqf  open the file .. scroll all the way to the bottom and place this code
of course changing my example to match your folder name, you just created above

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

 

 

addingmaps3.jpg

 

Then save the file, if you have done this already go back to serv_functions.sqf .. make sure you didn't leave off the that your file has the same brackets etc as example 

If you go to where the error is telling you is     File z\addons\dayz_server\init\server_functions.sqf, line 248 I bet your doesn't look like above you have left something off or wrong brackets etc 

With out seeing your files this as good as can give, but most likely this will solve

Link to comment
Share on other sites

The Beginning should look like this:

 

 

if (isServer) then {

_vehicle_7 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_runway_beton", [5092.2373, 2247.552, -1.8114378], [], 0, "CAN_COLLIDE"];
  _vehicle_7 = _this;
  _this setDir 30.982521;
  _this setPos [5092.2373, 2247.552, -1.8114378];
};

 

Ending

 

 

_vehicle_59 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_runway_beton", [5105.3208, 2233.261, 1.7908735], [], 0, "CAN_COLLIDE"];
  _vehicle_59 = _this;
  _this setDir 31.040882;
  _this setPos [5105.3208, 2233.261, 1.7908735];
};

};

 

The objects are irrelevant obviously, I just used these.

 

Best regards,

Blite

Link to comment
Share on other sites

I put my map additions in the server pbo. I have a folder inside of dayz_server.pbo called "mapedits" where I put all of the sqf files. Then I open server_functions.sqf and I add the execvm lines to the bottom:

[] execVM "\z\addons\dayz_server\mapedits\balotarunway.sqf";
[] execVM "\z\addons\dayz_server\mapedits\bfbandits.sqf";
[] execVM "\z\addons\dayz_server\mapedits\camp_rocket.sqf";
[] execVM "\z\addons\dayz_server\mapedits\kozlovka_bandits.sqf";
[] execVM "\z\addons\dayz_server\mapedits\prison.sqf";
[] execVM "\z\addons\dayz_server\mapedits\zubmanor.sqf";
[] execVM "\z\addons\dayz_server\mapedits\neafrunway.sqf";
[] execVM "\z\addons\dayz_server\mapedits\neaf.sqf";
[] execVM "\z\addons\dayz_server\mapedits\GOC_TE_bash.sqf";
[] execVM "\z\addons\dayz_server\mapedits\GOC_TE_btcc.sqf";
[] execVM "\z\addons\dayz_server\mapedits\GOC_LM_wlcr.sqf";
[] execVM "\z\addons\dayz_server\mapedits\basebor.sqf";

This was taken from my Chenarus server. Placing the new buildings server side makes for a smaller mission file to be downloaded by the players and supposedly protects against AI and zedz from seeing into the buildings. If they are client side, the buildings are not "seen" by AI and zedz.

Link to comment
Share on other sites

First ... it sounds u didnt edit the file correctly to add to the server.

EXAMPLE 

Remove all of this 

 

 

activateAddons [ 
  "map_eu"
];
 
activateAddons ["map_eu"];
initAmbientLife;
 
_this = createCenter west;
_center_0 = _this;
 
_group_0 = createGroup _center_0;
 
_unit_0 = objNull;
if (true) then
{
  _this = _group_0 createUnit ["BAF_Soldier_DDPM", [8122.9668, 9292.1338, 0], [], 0, "CAN_COLLIDE"];
  _unit_0 = _this;
  _this setUnitAbility 0.60000002;
  if (true) then {_group_0 selectLeader _this;};
  if (true) then {selectPlayer _this;};
};
 
 
ADD THIS HERE 

if (isServer) then {

 
_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["MAP_A_Castle_Bastion", [8081.2798, 9261.9561, 9.1552734e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir -79.236176;
  _this setPos [8081.2798, 9261.9561, 9.1552734e-005];
};
 
AT THE END OF THE MISSION.SQF FILE FROM EDITOR you will see something like 

vehicle_57 = objNull;
if (true) then
{
  _this = createVehicle ["Hhedgehog_concrete", [12322.168, 5650.9341, -0.00054931641], [], 0, "CAN_COLLIDE"];
  _vehicle_57 = _this;
  _this setDir -58.295269;
  _this setPos [12322.168, 5650.9341, -0.00054931641];
};
 
REMOVE THIS PART BELOW
 
processInitCommands;
runInitScript;
finishMissionInit;
 
ADD THIS 
 
};
 
 
so at the end of the file, you have 
 
 
  _vehicle_57 = _this;
  _this setDir -58.295269;
  _this setPos [12322.168, 5650.9341, -0.00054931641];
 
};
 
};

 

after you have that if you created your own file that is , if your using a custom you downloaded from here , or another forum. the above should be done already 

 

If its a file you downloaded 

then your not adding it to the server correctly

addingmaps1.jpg

 

You need to place the file in a folder inside your server folder to keep the all together make a folder such as buildings etc , place your file SQF for new area, building etc in that folder

 

addingmaps2.jpg

Once you have it placed in your new maps buildings or newcrap what ever you want to call the folder

 

then you have to go to your INIT folder to this file server_functions.sqf  open the file .. scroll all the way to the bottom and place this code

of course changing my example to match your folder name, you just created above

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

 

 

addingmaps3.jpg

 

Then save the file, if you have done this already go back to serv_functions.sqf .. make sure you didn't leave off the that your file has the same brackets etc as example 

If you go to where the error is telling you is     File z\addons\dayz_server\init\server_functions.sqf, line 248 I bet your doesn't look like above you have left something off or wrong brackets etc 

With out seeing your files this as good as can give, but most likely this will solve

Thanks,for the tutorial but when i join my server i got waiting for server to start achutenction

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...