DayZ 1.8.1 Vehicle Spawning, and Default Loadout?

Kevin-

Member
With this new DayZ Update and MySQL changes came some issue that I have no been able to resolve. Firstly I am trying to understand how to spawn vehicles on the server, and how would I be able to add more spawn points to the server. As right now I have not seen one vehicle that came from the database.

Secondly is the default loadout still done through the instance table? Or has it changed to somewhere else? As now everytime I spawn in I spawn with the very plain flare loadout.

If anyone is able to answer at least one of these questions, I will be forever grateful.
 
I have no real answer for you im sorry about that but i will say that alot of the popular DayZ 1.8.1 threads have been discussing this issue and i think someone has found out how to do it so i would keep a eye out and then pm them...
 
dayz_server.pbo >> server_üöayerLogin.sqf

Code:
//Variables
_inventory =    [["M9","Binocular","ItemGPS"],["15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","ItemBandage","ItemBandage"]];;
_backpack =     [];
_items =         [];
_magazines =     [];
_weapons =         [];
_medicalStats =    [];
_survival =        [0,0,0];
_tent =            [];
_state =         [];
_direction =    0;
_model =        "";
_newUnit =        objNull;
_botActive = false;
 
I'm tryin to figure out an easier method to spawn vehicles as well.
So far it looks like a overly complicated process, until someone creates some type of map tool.

so far i think this is the process:
Go into object_classes table, and increase the max limit number for each vehicle type.
Go into object_spawns table and manually add more spawns, use a random id. hardest part should be getting the worldspace.

Depending on your host, you should have a spawn script, i use vilayer and they have one. I know Dayz.St has one as well.
Once you run this script, all current vehicles will be in the object_data table.

vilayer has a input box to enter max over all server vehicles, dayz.st has this as well, but im not sure where this value is stores in the mysql, or server files.
 
Last edited:
I'm tryin to figure out an easier method to spawn vehicles as well.
So far it looks like a overly complicated process, until someone creates some type of map tool.

so far i think this is the process:
Go into object_classes table, and increase the max limit number for each vehicle type.
Go into object_spawns table and manually add more spawns, use a random id. hardest part should be getting the worldspace.

Depending on your host, you should have a spawn script, i use vilayer and they have one. I know Dayz.St has one as well.
Once you run this script, all current vehicles will be in the object_data table.

vilayer has a input box to enter max over all server vehicles, dayz.st has this as well, but im not sure where this value is stores in the mysql, or server files.
I'm running on a decdicated using DayZCC (though DayZCC does not really work at the moment as they have not updated to support (1.8.1). But yeah I do agree, finding the worldspace is probably the harder part of spawning in the vehicles.
 
If you have a few hours to spare, you can go into the 3d map editor, place a bunch of cars, and open up the file for that mission in text atext editor, and just copy and paste all the worldspaces. alot of manual work, but at least you'll have the worldspaces done.
 
What I did for vehicles was this. Go into the 3D editor and create a bunch of vehicles, use http://dayz.wofjwof.com/map.php to convert most of it to sql. Then alter it a little to be able to go into Object_SPAWNS, then alter it again to go into Object_DATA to force them all to spawn and bypass pMain from spawning them in.
beidi to sql conversion:
Code:
INSERT INTO `bliss_XXX`.`instance_building` (`building_id`, `instance_id`, `worldspace`) VALUES ('9999999901','XXX','[79.9,[6670.15,7534.06]]');

Then you would just replace a couple things to point it in the proper direction. Worst part is you have to renumber everything. Easiest way I've found to add in the extra things needed to go into the table is searching for something, using something like notepad++, and then replacing it ie: searching for "]]'" and replacing it with "]]','[]','hitpoints','mapid'"

object_spawns:
Code:
INSERT INTO `bliss_XXX`.`Object_SPAWNS` (`ObjectUID`, `Classname`, `worldspace`, `Inventory`, `Hitpoints`, `MapID`) VALUES
('9999999901','car_sedan','[79.9,[6670.15,7534.06,0]]','[]','[["palivo",1],["motor",1],["karoserie",1],["wheel_1_1_steering",1],["wheel_1_2_steering",1],["wheel_2_1_steering",1],["wheel_2_2_steering",1]]','');

object_data:
Code:
INSERT INTO `bliss_XXX`.`Object_DATA` (`ObjectID`, `ObjectUID`, `Instance`, `Classname`, `worldspace`, `Inventory`, `Hitpoints`) VALUES
('200','9999999901','XXX','car_sedan','[79.9,[6670.15,7534.06,0]]','[]','[["palivo",1],["motor",1],["karoserie",1],["wheel_1_1_steering",1],["wheel_1_2_steering",1],["wheel_2_1_steering",1],["wheel_2_2_steering",1]]');

Took maybe an hour to get 130 vehicles done. Knew I should have exported my old vehicle spawns.. woulda been so much nicer.
 
dayz_server.pbo >> server_üöayerLogin.sqf

Code:
//Variables
_inventory =    [["M9","Binocular","ItemGPS"],["15Rnd_9x19_M9","15Rnd_9x19_M9","15Rnd_9x19_M9","ItemBandage","ItemBandage"]];;
_backpack =     [];
_items =         [];
_magazines =     [];
_weapons =         [];
_medicalStats =    [];
_survival =        [0,0,0];
_tent =            [];
_state =         [];
_direction =    0;
_model =        "";
_newUnit =        objNull;
_botActive = false;

I tried this but no custom loadout...

Code:
_inventory =    [["ItemToolbox","ItemMap","Winchester1866"],["ItemBandage","ItemMorphine","ItemPainkiller","FoodCanBakedBeans","ItemWaterbottle","ItemAntibiotic","15Rnd_W1866_Slug","15Rnd_W1866_Slug","15Rnd_W1866_Slug"]];
_backpack =     ["DZ_Patrol_Pack_EP1"];

*edit* Nevermind, forgot to stop the server before uploading the PBO and it didn't upload. Now it's working.
 
Last edited:
Also the way I'm doing loadouts on 1.8.1 is this way if anyone was wondering:
Code:
_inventory =   [[],[]];
_backpack =    ["",[[],[]],[[],[]]];
_items =         [];
_magazines =     [];
_weapons =         [];
_medicalStats =    [];
_survival =        [0,0,0];
_tent =            [];
_state =         [];
_direction =    0;
_model =        "";
_newUnit =        objNull;
_botActive = false;
// loadout 1
if (_playerID in ["##","##","##"
                ]) then {
   
_inventory = [[],[]];
    _backpack = ["",[[],[]],[[],[]]];
};
 
With the steam update and new ids being dished out some of the old ids have been deleted but it seems the majority are still around. I changed my custom loadout portion to this:

*note* added _playerOLDID to private.
Code:
_playerID = _this select 0;
_playerObj = _this select 1;
_playerName = name _playerObj;
_playerOLDID = getPlayerUIDOld _playerObj;
_worldspace = [];

if (_playerName == '__SERVER__' || _playerID == '' || local player) exitWith {};

// Cancel any login until server_monitor terminates. 
// This is mandatory since all vehicles must be spawned before the first players spawn on the map.
// Otherwise, all vehicle event handlers won't be created on players' client side.
if (isNil "sm_done") exitWith { diag_log ("Login cancelled, server is not ready. " + str(_playerObj)); };

if (count _this > 2) then {
    dayz_players = dayz_players - [_this select 2];
};

//Variables
_inventory = [];
_backpack =    [];
_items =         [];
_magazines =     [];
_weapons =         [];
_medicalStats =    [];
_survival =        [0,0,0];
_tent =            [];
_state =         [];
_direction =    0;
_model =        "";
_newUnit =        objNull;
_botActive = false;
// allows use of old and new ids
// _playerOLDID can be used for old loadouts
// _playerID can be used for newer loadouts or for older loadouts whom have had their IDs wiped.
if ((_playerOLDID in [""]) || (_playerID in [""])) then {
    _inventory = [];
    _backpack = [];
};
 
Back
Top