Jump to content

[Release v1.0.5] Precise Base Building - Persistent bases after restart! (Updated 22/09/15)


Mikeeeyy

Recommended Posts

It should look like this:

  • _allowed = [_object, "Server"] call check_publishobject;
    if (!_allowed || !_proceed) exitWith {
        if(!isNull(_object)) then {
            deleteVehicle _object;
        };
        diag_log ("Invalid object swap by playerUID:"+ str(_activatingplayerUID));
    };
    
    //get UID
    _uid = _worldspace call dayz_objectUID2;
    
    _worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
    _worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];
    
    // Publish variables
    _object setVariable ["CharacterID",_charID,true];
    
 

 

Is it going to make a difference that my "Publish variables" and "_object setVariable" are by default located above this section vs. below it? Or should I move them down?

 

// Publish variables
_object setVariable ["CharacterID",_charID,true];
 
//_object setVariable ["ObjectUID",_objectUID,true];
_object setVariable ["OEMPos", call compile (_worldspace select 1), true];
 
//diag_log ("PUBLISH: Attempt " + str(_object));
 
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed || !_proceed) exitWith { 
if(!isNull(_object)) then {
deleteVehicle _object; 
};
diag_log ("Invalid object swap by playerUID:"+ str(_activatingplayerUID));
};
 
//get UID
_uid = _worldspace call dayz_objectUID2;
 
_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];

 

Thanks in advance for your help   :)

Link to comment
Share on other sites

 

 

Is it going to make a difference that my "Publish variables" and "_object setVariable" are by default located above this section vs. below it? Or should I move them down?

 

 

// Publish variables
_object setVariable ["CharacterID",_charID,true];
 
//_object setVariable ["ObjectUID",_objectUID,true];
_object setVariable ["OEMPos", call compile (_worldspace select 1), true];
 
//diag_log ("PUBLISH: Attempt " + str(_object));
 
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed || !_proceed) exitWith { 
if(!isNull(_object)) then {
deleteVehicle _object; 
};
diag_log ("Invalid object swap by playerUID:"+ str(_activatingplayerUID));
};
 
//get UID
_uid = _worldspace call dayz_objectUID2;
 
_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];

 

Thanks in advance for your help   :)

 

 

It must be in the order I have it in ;)

Link to comment
Share on other sites

Nice job with this, Mikeeeyy. This is incredibly useful. Will be implementing this along with raymix's SBP, will let you know how it worked.

 

 

Seems to be working perfectly so far. Raymix recently updated his script aswell so it does't leave gaps between objects so it's perfect now. 

Link to comment
Share on other sites

Ok before I pull out my limited hair any ideas?

Before adding this my objects where saving right like this..[124.029,[8637.74,6958.04,0.24],[[0.816,-0.551,-0.174],[0.144,-0.097,0.985]]] the only reason for adding this was on restart the nice ramps I build where now always horizontal...this change sorted this fine...BUT now any NEW objects are saving thus:

[any,any,[[-0.56,-0.829,0],[-0.829,0.56,-4.371e-08]]] and I can only presume are spawning somewhere out in the ether lol..but for sure not where they are placed.. can start from scratch but having spent hours on a new demo base for a new server.. bit loathed to start from scratch... any ideas?

Link to comment
Share on other sites

Ok before I pull out my limited hair any ideas?

Before adding this my objects where saving right like this..[124.029,[8637.74,6958.04,0.24],[[0.816,-0.551,-0.174],[0.144,-0.097,0.985]]] the only reason for adding this was on restart the nice ramps I build where now always horizontal...this change sorted this fine...BUT now any NEW objects are saving thus:

[any,any,[[-0.56,-0.829,0],[-0.829,0.56,-4.371e-08]]] and I can only presume are spawning somewhere out in the ether lol..but for sure not where they are placed.. can start from scratch but having spent hours on a new demo base for a new server.. bit loathed to start from scratch... any ideas?

 

Hey, can you post your server_publishObject.sqf file for me please?

Link to comment
Share on other sites

Hey, can you post your server_publishObject.sqf file for me please?

Hopefully I've done this spoiler thing right:)

 

[ spoiler] private ["_class","_uid","_charID","_object","_worldspace","_key","_allowed"];

//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
 
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed) exitWith { deleteVehicle _object; };
 
//diag_log ("PUBLISH: Attempt " + str(_object));
 
//get UID
_uid = _worldspace call dayz_objectUID2;
_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];
 
//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
 
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectUID", _uid,true];
// _object setVariable ["CharacterID",_charID,true];
 
if (DZE_GodModeBase) then {
_object addEventHandler ["HandleDamage", {false}];
}else{
_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
};

// Test disabling simulation server side on buildables only. [ /spoiler]

Link to comment
Share on other sites

Hopefully I've done this spoiler thing right:)

 

 private ["_class","_uid","_charID","_object","_worldspace","_key","_allowed"];

//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
 
_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed) exitWith { deleteVehicle _object; };
 
//diag_log ("PUBLISH: Attempt " + str(_object));
 
//get UID
_uid = _worldspace call dayz_objectUID2;
_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];
 
//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
 
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectUID", _uid,true];
// _object setVariable ["CharacterID",_charID,true];
 
if (DZE_GodModeBase) then {
_object addEventHandler ["HandleDamage", {false}];
}else{
_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
};

// Test disabling simulation server side on buildables only. 

 

Hmm, everything looks fine there, where have you put the 'KK_fnc_floatToString' and 'KK_fnc_positionToString' functions?

Also get rid of the space in [ spoiler] and [ /spoiler] ;)

Link to comment
Share on other sites

Many apologies neighbor at the door just as I was posting!

 

I followed the instructions but went for the thicko's way instead of in compiles put it in server_functions.sqf at the end.. have posted the last few lines hope this is right:)

 

 

[ spoiler] 

server_logUnlockLockEvent = {

private["_player", "_obj", "_objectID", "_objectUID", "_statusText", "_status"];
_player = _this select 0;
_obj = _this select 1;
_status = _this select 2;
if (!isNull(_obj)) then {
_objectID = _obj getVariable["ObjectID", "0"];
_objectUID = _obj getVariable["ObjectUID", "0"];
_statusText = "UNLOCKED";
if (_status) then {
[_obj, "gear"] call server_updateObject;
_statusText = "LOCKED";
};
diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player), _statusText];
};
KK_fnc_floatToString = {
private "_arr";
if (abs (_this - _this % 1) == 0) exitWith { str _this };
_arr = toArray str abs (_this % 1);
_arr set [0, 32];
toString (toArray str (
abs (_this - _this % 1) * _this / abs _this
) + _arr - [32])
};
 
KK_fnc_positionToString = {
format [
"[%1,%2,%3]",
_this select 0 call KK_fnc_floatToString,
_this select 1 call KK_fnc_floatToString,
_this select 2 call KK_fnc_floatToString
]
};
};
 [ /spoiler]
Link to comment
Share on other sites

Many apologies neighbor at the door just as I was posting!

 

I followed the instructions but went for the thicko's way instead of in compiles put it in server_functions.sqf at the end.. have posted the last few lines hope this is right:)

 

 

[ spoiler] server_logUnlockLockEvent = {

private["_player", "_obj", "_objectID", "_objectUID", "_statusText", "_status"];
_player = _this select 0;
_obj = _this select 1;
_status = _this select 2;
if (!isNull(_obj)) then {
_objectID = _obj getVariable["ObjectID", "0"];
_objectUID = _obj getVariable["ObjectUID", "0"];
_statusText = "UNLOCKED";
if (_status) then {
[_obj, "gear"] call server_updateObject;
_statusText = "LOCKED";
};
diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player), _statusText];
};
KK_fnc_floatToString = {
private "_arr";
if (abs (_this - _this % 1) == 0) exitWith { str _this };
_arr = toArray str abs (_this % 1);
_arr set [0, 32];
toString (toArray str (
abs (_this - _this % 1) * _this / abs _this
) + _arr - [32])
};
 
KK_fnc_positionToString = {
format [
"[%1,%2,%3]",
_this select 0 call KK_fnc_floatToString,
_this select 1 call KK_fnc_floatToString,
_this select 2 call KK_fnc_floatToString
]
};
};
 

 [ /spoiler]

 

There's your problem, you have put those functions inside of another function, you need to put the at the very bottom so they are not inside any other {}.

Link to comment
Share on other sites

There's your problem, you have put those functions inside of another function, you need to put the at the very bottom so they are not inside any other {}.

I blame the fact I'm in pain from gal bladder removal this week:)

 

that and I'm an old duffer:)

 

I''ll get right to it thanks

Link to comment
Share on other sites

  • 1 month later...

Well just for you all to know, dont know what went wrong the last days, but i wiped my complete test server, and build it from scratch. 

 

followed the instructions, and bang 

13:56:27 Error in expression <;


_object setVariable ["OEMPos", call compile (_worldspace select 1), true];

>
13:56:27   Error position: <compile (_worldspace select 1), true];

>
13:56:27   Error compile: Type Array, expected String
13:56:27 File z\addons\dayz_server\compile\server_swapObject.sqf, line 52

will have a look if it will work without the precise building ...

 

but somehthing got really broken here:

 

init file: http://nopaste.info/43736639a1.html

server_swapObject.sqf: http://nopaste.info/aeca069679.html

 

i dont get this whole stroy ...

 

i typed in some bulshit _worldspace12334fu but it keeps comming back with the error message from above

Link to comment
Share on other sites

Well just for you all to know, dont know what went wrong the last days, but i wiped my complete test server, and build it from scratch. 

 

followed the instructions, and bang 

13:56:27 Error in expression <;


_object setVariable ["OEMPos", call compile (_worldspace select 1), true];

>
13:56:27   Error position: <compile (_worldspace select 1), true];

>
13:56:27   Error compile: Type Array, expected String
13:56:27 File z\addons\dayz_server\compile\server_swapObject.sqf, line 52

will have a look if it will work without the precise building ...

 

but somehthing got really broken here:

 

init file: http://nopaste.info/43736639a1.html

server_swapObject.sqf: http://nopaste.info/aeca069679.html

 

i dont get this whole stroy ...

 

i typed in some bulshit _worldspace12334fu but it keeps comming back with the error message from above

 

Are you using the latest version?

Link to comment
Share on other sites

Jep, still the same, 

19:36:10 "DELETE: B 1-1-B:1 ([TIW] Apraxas) REMOTE Deleted by UID: 254211264220236"
19:36:10 Error in expression <;


_object setVariable ["OEMPos", call compile (_worldspace select 1), true];

>
19:36:10   Error position: <compile (_worldspace select 1), true];

>
19:36:10   Error compile: Type Array, expected String
19:36:10 File z\addons\dayz_server\compile\server_swapObject.sqf, line 52

just to cause you to scratch your head aswell 

// Publish variables
_object setVariable ["CharacterID",_charID,true];
		
//_object setVariable ["ObjectUID",_objectUID,true];
_object setVariable ["OEMPos", call compile (_worldspace12 select 1), true];

//diag_log ("PUBLISH: Attempt " + str(_object));

_allowed = [_object, "Server"] call check_publishobject;
if (!_allowed || !_proceed) exitWith {
    if(!isNull(_object)) then {
        deleteVehicle _object;

just added a few letters into the variablename (_worldspace12 ), now this should cause a epic smack in the face 

 

Packed the " Error " back into the dayz_server.pbo uploaded it to the gameserver * restart * wait wait wait join

 

Build a Wall with the result of 

00	254141264758216	24	CinderWallHalf_DZ	2014-10-25 19:45:56	2014-10-25 19:45:56	1	["10.546135","[2541.404541,12647.474609,-0.0784054]",[[0.183,0.983,0],[0,0,1]],"76561197962545003"]	[]	[]	0.00000	0.00000

in the Database ( sorry for the linebreaks ) 

 

Upgrading the wall is causing: 

19:49:18 Error in expression <ct setVariable ["OEMPos", call compile (_worldspace12 select 1), true];
_allo>
19:49:18   Error position: <_worldspace12 select 1), true];
_allo>
19:49:18   Error Undefined variable in expression: _worldspace12
19:49:18 File z\addons\dayz_server\compile\server_swapObject.sqf, line 52

Baam there is the smack, so it is the correct file, if i look into the player_upgrade.sqf 

 

i can find a line ( No: 192 and 193 ) telling me 

PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location, _vector, _ownerID],_classname,_obj,player];
			publicVariableServer "PVDZE_obj_Swap";

which i read as: Fill the Variable called " PVDZE_obj_Swap " with the following informations:

 

class 0 = _objectCharacterID ( 254141264758216 )

class 1 = _object ( CinderWallHalf_DZ )

 

But the following Classes ( if you can call them like this ) are strange for me 

 

 

class 2.1 = _dir ( 10.546135 )

class 2.2 = _location ( 2541.404541,12647.474609,-0.0784054 )

class 2.3 = _vector ( [0.183,0.983,0],[0,0,1] )

class 2.3 = _ownerId ( 76561197962545003 )

 

class 3 = _classname (NULL)

class 4 = _obj ( NULL )

class 5 = player (00000000)

 

 

So either i am totally wrong, or the " Creation " of the object in the Database is somehow fishy, but the fact that it spawns, and it keeps all the angles and stuff brings me to the point that i am just simply to stupid for it ;)

 

Dont know where to look next to be honest.

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
×
×
  • Create New...