Door Problems with newly created buildings.

Keegan666

New Member
Hi, Im rather new to the whole editing Dayz thing, started getting into this for a hobbie after being an admin on my buddy's server

This is one of the many problems we are coming across in are misadventures...
(sorry ahead of time if this is the wrong thread for it)
My%20door%20problem.png


We are using Dayz.st and iv bin trying to figure out what could just be causing it for a few days,
Added buildings to Table, Spawns in to take a look and it appears as one building..., but i cant tell if its one just doubling the doors or two buildings perfectly inside each other.


Im stumped...any ideas?
 
This is due a fuqed up dayz_server.pbo that is been served as "default" on dayz.st. I even told them once on IRC that whoever put it in the CP is a complete moron. Guess we have to mail them...

Back to you're problem.
You're spawning the buildings twice
In dayz_server.pbo\server_monitor.sqf find

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!");

Now that's the code responsible for spawning buildings at server start. Now look a little lower and you'll find the same code again. Delete it and you're done.
 
Will hurp around the code for a little while, Thank you very much!

First attempt, Coffees consumed two: Broke it stuck at waiting for host (ops)

Second attempt, Same issue stuck at waiting for host after editing, can at least see the MOTD and messages the server gives.

Code:
[]execVM "\z\addons\dayz_server\system\s_fps.sqf";
dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
diag_log("SERVER VERSION: Bliss v4.2");
 
if ((count playableUnits == 0) and !isDedicated) then {
    isSinglePlayer = true;
};
 
waitUntil{initialized};
 
//Send the key
_key = format["CHILD:302:%1:", dayZ_instance];
_data = "HiveEXT" callExtension _key;
 
diag_log("SERVER: Fetching objects...");
 
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
 
_objList = [];
_objCount = 0;
if (_status == "ObjectStreamStart") then {
    _val = _result select 1;
    for "_i" from 1 to _val do {
        _data = "HiveEXT" callExtension _key;
        _result = call compile format ["%1",_data];
 
        _status = _result select 0;
        _objList set [count _objList, _result];
        _objCount = _objCount + 1;
    };
    diag_log ("SERVER: Fetched " + str(_objCount) + " objects!");
};
 
//Spawn objects
_countr = 0;
{
    //Parse individual vehicle row
    _countr = _countr + 1;
 
    _idKey =    _x select 1;
    _type =        _x select 2;
    _ownerID =    _x select 3;
 
    _worldspace = _x select 4;
    _dir = 0;
    _pos = [0,0,0];
    _wsDone = false;
    if (count _worldspace >= 2) then
    {
        _dir = _worldspace select 0;
        if (count (_worldspace select 1) == 3) then {
            _pos = _worldspace select 1;
            _wsDone = true;
        }
    };       
    if (!_wsDone) then {
        if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
        _pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
        if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
        diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
    };
 
    _intentory=    _x select 5;
    _hitPoints=    _x select 6;
    _fuel =        _x select 7;
    _damage =    _x select 8;
 
    if (_damage < 1) then {
        diag_log("Spawned: " + str(_idKey) + " " + _type);
   
        _object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
        _object setVariable ["lastUpdate",time];
 
        // Don't set objects for deployables to ensure proper inventory updates
        if (_ownerID == "0") then {
            _object setVariable ["ObjectID", str(_idKey), true];
        } else {
            _object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
        };
 
        _object setVariable ["CharacterID", _ownerID, true];
   
        clearWeaponCargoGlobal  _object;
        clearMagazineCargoGlobal  _object;
   
        if (_object isKindOf "TentStorage") then {
            _pos set [2,0];
            _object setpos _pos;
        };
        _object setdir _dir;
        _object setDamage _damage;
   
        if (count _intentory > 0) then {
            //Add weapons
            _objWpnTypes = (_intentory select 0) select 0;
            _objWpnQty = (_intentory select 0) select 1;
            _countr = 0;               
            {
                _isOK =    isClass(configFile >> "CfgWeapons" >> _x);
                if (_isOK) then {
                    _block =    getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
                    if (!_block) then {
                        _object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
                    };
                };
                _countr = _countr + 1;
            } forEach _objWpnTypes;
       
            //Add Magazines
            _objWpnTypes = (_intentory select 1) select 0;
            _objWpnQty = (_intentory select 1) select 1;
            _countr = 0;
            {
                _isOK =    isClass(configFile >> "CfgMagazines" >> _x);
                if (_isOK) then {
                    _block =    getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
                    if (!_block) then {
                        _object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
                    };
                };
                _countr = _countr + 1;
            } forEach _objWpnTypes;
 
            //Add Backpacks
            _objWpnTypes = (_intentory select 2) select 0;
            _objWpnQty = (_intentory select 2) select 1;
            _countr = 0;
            {
                _isOK =    isClass(configFile >> "CfgVehicles" >> _x);
                if (_isOK) then {
                    _block =    getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
                    if (!_block) then {
                        _object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
                    };
                };
                _countr = _countr + 1;
            } forEach _objWpnTypes;
        };
   
        if (_object isKindOf "AllVehicles") then {
            {
                _selection = _x select 0;
                _dam = _x select 1;
                if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
                [_object,_selection,_dam] call object_setFixServer;
            } forEach _hitpoints;
            _object setvelocity [0,0,1];
            _object setFuel _fuel;
            if (getDammage _object == 1) then {
                _position = ([(getPosATL _object),0,100,10,0,500,0] call BIS_fnc_findSafePos);
                if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
                _object setPosATL _position;
            };
                    _object call fnc_vehicleEventHandler;       
        };
 
        //Monitor the object
        //_object enableSimulation false;
        dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
    };
 
//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!");
};
 
//Set the Time
_key = "CHILD:307:";
_result = [_key] call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome == "PASS") then {
    _date = _result select 1;
    if (isDedicated) then {
        setDate _date;
        dayzSetDate = _date;
        publicVariable "dayzSetDate";
    };
 
    diag_log("HIVE: Local Time set to " + str(_date));
};
 
createCenter civilian;
if (isDedicated) then {
    endLoadingScreen;
};
hiveInUse = false;
 
if (isDedicated) then {
    _id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
};
 
allowConnection = true;
for "_x" from 1 to 6 do {
    _id = [] spawn spawn_carePackages;
}; //Spawn care packages
for "_x" from 1 to 20 do {
    _id = [] spawn spawn_wrecks;
}; //Spawn wrecks
 
for "_x" from 1 to 5 do {
    _id = [] spawn spawn_heliCrash;
}; //Spawn heli crash

This is the .sqf by Default, and i seem to be breaking it unintentionally ^_^"
Where am i going wrong?, cause i don't see the repeating line.
 
Before:

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;

Add:

Code:
} forEach _objList;
 
Attempting to break server, Stand by

Edit: Broke it again waiting for host
Still trying.

I apologizes for the poor coding inability btw :eek:

Edit: i almost spit out my coffee, im not stuck at waiting for host...(hopes still low until i see a building)
 
Code:
        //Monitor the object
        //_object enableSimulation false;
        dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
    }; } forEach _objList;

I%20love%20you%20door%20fixer.png


It works, and i extend my utmost thanks upon you good sir.
Ps: I love you...
 
Back
Top