AtricSky Posted October 27, 2014 Report Share Posted October 27, 2014 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 More sharing options...
BetterDeadThanZed Posted October 27, 2014 Report Share Posted October 27, 2014 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? Link to comment Share on other sites More sharing options...
AtricSky Posted October 27, 2014 Author Report Share Posted October 27, 2014 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 More sharing options...
CodeBis Posted October 27, 2014 Report Share Posted October 27, 2014 Please post the first 10 lines of your "map.sqf" and the last 10. Best regards, Blite Link to comment Share on other sites More sharing options...
AtricSky Posted October 27, 2014 Author Report Share Posted October 27, 2014 Link to comment Share on other sites More sharing options...
CodeBis Posted October 27, 2014 Report Share Posted October 27, 2014 _vehicle_844 = objNull;if (true) then{ Are you sure that is the last one? Because if it is you have your issue. Link to comment Share on other sites More sharing options...
Chainsaw Squirrel Posted October 27, 2014 Report Share Posted October 27, 2014 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 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 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"; 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 More sharing options...
CodeBis Posted October 27, 2014 Report Share Posted October 27, 2014 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 More sharing options...
CodeBis Posted October 27, 2014 Report Share Posted October 27, 2014 When I posted, your post updated, disregard it then as you have posted a more complex version.. :) Link to comment Share on other sites More sharing options...
Chainsaw Squirrel Posted October 27, 2014 Report Share Posted October 27, 2014 Or What BetterDeadThanZed said before I could get all this posted LOL one of the two or both :D Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted October 27, 2014 Report Share Posted October 27, 2014 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 More sharing options...
AtricSky Posted October 27, 2014 Author Report Share Posted October 27, 2014 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 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 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"; 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now