Spawing buildings via the Database

HEROTHOR

Member
Hello, I recently started experiencing a problem when spawning in buildings or "instance_buildings" via the database. It seems none of the buildings appear with the 1.7.7.1 patch. My buildings are still showing up in the database, and keep in mind that they did appear for a couple days before they stopped working.

HFB Servers is aware of this issue and is working on it with Reality. I just added a skalisty bridge via the mission.sqm file and it worked, so I was wondering two things.

Is anyone experiencing this problem? (Server crash when trying to spawn in buldings)

Or

Is there a method to add barracks via the mission.sqm if so what is the item code and where do I place it?


Any help would be greatly appreciated.

HEROES vs. BANDITS
HEROTHOR
 
Add this to your server_monitor.sqf file in your dayz_server.pbo right before the //Set the Time section.

Code:
//Send the key
    _key = format["CHILD:999:select b.class_name, ib.worldspace from instance_building ib join building b on ib.building_id = b.id where ib.instance_id = ?:[%1]:", dayZ_instance];
    _data = "HiveEXT" callExtension _key;
 
    diag_log("SERVER: Fetching buildings...");
 
    //Process result
    _result = call compile format ["%1", _data];
    _status = _result select 0;
 
    _bldList = [];
    _bldCount = 0;
    if (_status == "CustomStreamStart") then {
        _val = _result select 1;
        for "_i" from 1 to _val do {
            _data = "HiveEXT" callExtension _key;
            _result = call compile format ["%1",_data];
 
            _pos = call compile (_result select 1);
            _dir = _pos select 0;
            _pos = _pos select 1;
 
            _building = createVehicle [_result select 0, _pos, [], 0, "CAN_COLLIDE"];
            _building setDir _dir;
            _bldCount = _bldCount + 1;
    };
    diag_log ("SERVER: Spawned " + str(_bldCount) + " buildings!");
    };
 
Just tried this with no luck, this is what my dayz_server.pbo looks like.
waitUntil{!isnil "bis_fnc_init"};
execVM "\z\addons\dayz_server\system\server_monitor.sqf";
//Send the key
_key = format["CHILD:999:select b.class_name, ib.worldspace from instance_building ib join building b on ib.building_id = b.id where ib.instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key;

diag_log("SERVER: Fetching buildings...");

//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;

_bldList = [];
_bldCount = 0;
if (_status == "CustomStreamStart") then {
_val = _result select 1;
for "_i" from 1 to _val do {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];

_pos = call compile (_result select 1);
_dir = _pos select 0;
_pos = _pos select 1;

_building = createVehicle [_result select 0, _pos, [], 0, "CAN_COLLIDE"];
_building setDir _dir;
_bldCount = _bldCount + 1;
};
diag_log ("SERVER: Spawned " + str(_bldCount) + " buildings!");
};
 
Why would you want to use the DB? It requires massive amounts of effort. You can simply create a map folder in the mission pbo and find the mission.sqf from the map you just finished saving, open that up, rip out all the _vehicle related lines , paste into a new .sqf, then edit it to resemble
Code:
f (isServer) then {
 
_VEHICLE LINES GO HERE
};

and then call it at the bottom of your init.sqf like so :
Code:
[] ExecVM "map\ExtraKamenka.sqf";
 
[] ExecVM "map\Barracks.sqf";
 
[] ExecVM "map\Castle.sqf";
 
[] ExecVM "map\Starybase.sqf";
 
[] ExecVM "map\Bridge.sqf";
 
[] ExecVM "map\olsha.sqf";
 
[] ExecVM "map\kamenkav2.sqf";
 
[] ExecVM "map\Dragon.sqf";
 
[] ExecVM "map\Outpost.sqf";
 
[] ExecVM "map\Camp.sqf";

It's much easier and requires less effort. Also works 100%. Just putting it out there. No clue who first came up with this method, but it's quite amazing.
 
Are you referring to the ctrl+e method, saving updating my mission.pbo with the added lines in the newly created one? I'm sorry I'm just having a little trouble understanding. I just really want my buildings back. ;(

I think thats what you mean, if so I have never tried this method.
 
Make your custom map using ctrl + e map editor, find where it saved your files, find the mission.sqf of the file you saved....follow my above post....repack pbo and upload
 
Sorry, I'm slow! Its 4 in the morning. :) I'm going to do this now! I'll let you know how it turns out. Thanks for the help man!
 
Sorry, I'm slow! Its 4 in the morning. :) I'm going to do this now! I'll let you know how it turns out. Thanks for the help man!

I know the feels man. 4AM for me too. Couldn't sleep so came' a browsing. If you still can't get it to work add me on skype mattlampley96 and ill provide a more detailed walkthrough or something tomorrow. Or should I say later today?
 
Excelsior also posted the .sqf version of his bridge somewhere on opendayz.net if you want to remove that from your mission.sqm
 
The code I get out of that is
activateAddons [
];

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", [13662.989, 3225.3901, 0], [], 0, "CAN_COLLIDE"];
_unit_1 = _this;
_this setUnitAbility 0.60000002;
if (true) then {_group_0 selectLeader _this;};
if (true) then {selectPlayer _this;};
if (true) then {setPlayable _this;};
};

_objectComposition_2 = [[13693.243, 2888.116, 1.1444092e-005], 0, "SmallBase"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectmapper.sqf"));

_objectComposition_3 = [[13742.406, 2879.4487, 4.196167e-005], 180.4754, "AntiAir1_US"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectmapper.sqf"));

_vehicle_7 = objNull;
if (true) then
{
_this = createVehicle ["US_WarfareBFieldhHospital_Base_EP1", [13700.53, 2884.7563, 3.8146973e-006], [], 0, "CAN_COLLIDE"];
_vehicle_7 = _this;
_this setPos [13700.53, 2884.7563, 3.8146973e-006];
};

_vehicle_12 = objNull;
if (true) then
{
_this = createVehicle ["M1130_HQ_unfolded_EP1", [13683.987, 2882.6726, 3.8146973e-006], [], 0, "CAN_COLLIDE"];
_vehicle_12 = _this;
_this setPos [13683.987, 2882.6726, 3.8146973e-006];
};

processInitCommands;
runInitScript;
finishMissionInit;

and the code in my mission.sqm on my server is.

class Vehicles
{
items=12;
class Item0
{
side="EMPTY";
id=1;
position[]={13225.278, -6.0489159, 3431.5159};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13225.278, 3431.5159, -3.1];";
};
class Item1
{
side="EMPTY";
id=2;
position[]={13247.008, -6.1535072, 3398.5906};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13247.008, 3398.5906, -3.1];";
};
class Item2
{
side="EMPTY";
id=3;
position[]={13203.401, -6.2994447, 3464.7751};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13203.401, 3464.7751, -3.1];";
};
class Item3
{
side="EMPTY";
id=4;
position[]={13181.671, -6.1785541, 3497.7451};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13181.671, 3497.7451, -3.1];";
};
class Item4
{
side="EMPTY";
id=5;
position[]={13159.978, -6.3031154, 3530.6299};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13159.978, 3530.6299, -3.1];";
};
class Item5
{
side="EMPTY";
id=6;
position[]={13138.261, -5.9914126, 3563.5496};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13138.261, 3563.5496, -3.1];";
};
class Item6
{
side="EMPTY";
id=7;
position[]={13116.587, -6.1611514, 3596.4583};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13116.587, 3596.4583, -3.1];";
};
class Item7
{
side="EMPTY";
id=8;
position[]={13094.851, -6.0637994, 3629.364};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13094.851, 3629.364, -3.1];";
};
class Item8
{
side="EMPTY";
id=9;
position[]={13073.158, -6.1899328, 3662.2742};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13073.158, 3662.2742, -3.1];";
};
class Item9
{
side="EMPTY";
id=10;
position[]={13051.535, -6.376471, 3695.0833};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13051.535, 3695.0833, -3.1];";
};
class Item10
{
side="EMPTY";
id=11;
position[]={13029.813, -6.1521502, 3728.052};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, 0]; this setpos [13029.813, 3728.052, -3.1];";
};
class Item11
{
side="EMPTY";
id=12;
position[]={13260.079, -3.0727394, 3378.8081};
vehicle="land_nav_pier_m_2";
azimut=56.571701;
lock="LOCKED";
init="this setPosASL [getposASL this select 0, getposASL this select 1, -2.5]; this setpos [13260.079, 3378.8081, -3.0727394];";
};

};
};

They dont look similar. Any ideas?
 
The code I get out of that is


and the code in my mission.sqm on my server is.



They dont look similar. Any ideas?

Just add me on skype man, I am beyond stretched to my limits and have to get some sleep. I'll explain further in the morning. again: mattlampley96
 
Back
Top