Jump to content

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


Mikeeeyy

Recommended Posts

just added this to my dev server, copied all the items in object_data from one of my live servers.
everything looks perfect

 

using p4l, snap-pro (with a custom player_build.sqf... and extra build items)

 

loving your work.

thanks!

Link to comment
Share on other sites

just added this to my dev server, copied all the items in object_data from one of my live servers.

everything looks perfect

 

using p4l, snap-pro (with a custom player_build.sqf... and extra build items)

 

loving your work.

thanks!

 

Glad you like it bud ;)

Link to comment
Share on other sites

7c18af8f84.jpg

Version 1.0.4

  • Added support for vehicles, vehicles now save exactly where they were along with their direction.

86aab96380.jpg

  1. Open up 'server_updateObject.sqf' located in the compile folder. (dayz_server\compile\server_updateObject.sqf)
  2. Find: 
    _object_position = {
    	private["_position","_worldspace","_fuel","_key"];
    		_position = getPosATL _object;
    		_worldspace = [
    			round(direction _object),
    			_position
    		];
    		_fuel = 0;
    		if (_object isKindOf "AllVehicles") then {
    			_fuel = fuel _object;
    		};
    		_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    		//diag_log ("HIVE: WRITE: "+ str(_key));
    		_key call server_hiveWrite;
    };
  3. And replace it with: 
    _object_position = {
    	private["_position","_worldspace","_fuel","_key"];
    		_position = getPosATL _object;
    		_worldspace = [
    			(getDir _object) call KK_fnc_floatToString,
    			_position call KK_fnc_positionToString
    		];
    		_fuel = 0;
    		if (_object isKindOf "AllVehicles") then {
    			_fuel = fuel _object;
    		};
    		_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    		//diag_log ("HIVE: WRITE: "+ str(_key));
    		_key call server_hiveWrite;
    };
Link to comment
Share on other sites

 

7c18af8f84.jpg

Version 1.0.4

  • Added support for vehicles, vehicles now save exactly where they were along with their direction.

86aab96380.jpg

  1. Open up 'server_swapObject.sqf' located in the compile folder. (dayz_server\compile\server_swapObject.sqf)
  2. Find: 
    _object_position = {
    	private["_position","_worldspace","_fuel","_key"];
    		_position = getPosATL _object;
    		_worldspace = [
    			round(direction _object),
    			_position
    		];
    		_fuel = 0;
    		if (_object isKindOf "AllVehicles") then {
    			_fuel = fuel _object;
    		};
    		_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    		//diag_log ("HIVE: WRITE: "+ str(_key));
    		_key call server_hiveWrite;
    };
  3. And replace it with: 
    _object_position = {
    	private["_position","_worldspace","_fuel","_key"];
    		_position = getPosATL _object;
    		_worldspace = [
    			(getDir _object) call KK_fnc_floatToString,
    			_position call KK_fnc_positionToString
    		];
    		_fuel = 0;
    		if (_object isKindOf "AllVehicles") then {
    			_fuel = fuel _object;
    		};
    		_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
    		//diag_log ("HIVE: WRITE: "+ str(_key));
    		_key call server_hiveWrite;
    };

 

 

server_swapObject.sqf you sure its in there 0_o

Link to comment
Share on other sites

Just a side note, this will not give vehicles precise coordinates when they are spawned, but any time after that they will be precise. Imo it doesn't matter if they're not precise when they are spawned as they are only at the trader.

Link to comment
Share on other sites

Mikeeeyy Do you use privateHive tools ?

ive noticed after i installed precise base building privatehive tools stopped gettting worldspace locations for objects bases, will this happen for vehicles too, if i update ?

 

 

I'm not quite sure what tools you're talking about and this addon shouldn't affect the ability to fetch an object's position.

Link to comment
Share on other sites

Hi guys, I have to apologise as I'm new to DayZ server administration and am pretty well out of my depth.

 

It's a long and painful, not to mention embarrassing story, but I don't have a good backup of my db, so am hoping to be able to fix it manually.

 

I'm getting the _worldspace select error and am trying to remove the offending entries from the object_data table.

 

Mikeeey, you mentioned in an earlier post that I need to find an entry where the worldspace coordinates don't have quotes around them, but I have lots and lots of these. I noticed that cars and other vehicles don't have quotes around the coordinates, but the majority of player built items do.

 

Am I correct in thinking that all of the building components that were placed by a player, which don't have quotes around them, are what is preventing me from logging in, and that they all need to have the quotes added?

 

Or is there just specific type of entry that requires the quotes? 

 

Sorry for posting such a question, but as I say, I'm really out of my depth.

Link to comment
Share on other sites

I think I can save one of you good folk from going through the pain of helping me. I think I've worked out what's happened. I started off by making a backup of the object_data table and confirmed I could import it back into the db. Then I deleted everything in the table and started importing in big chunks. When I got to a block that caused the worldspace error to occur, I split it up into smaller blocks until I new I had a chunk that contained both good and broken entries, and then started hunting for the difference.

 

Now I don't even know if my issue is related to the mod after all.

 

I found some wooden stairs that I knew for sure was causing the error, and found that there are a couple of quotes which don't seem to need to be there. I've bolded and underlined them below.

 

"2014-11-09 00:00:00","154","[""140.945129"",""[6518.806641,9386.414063,44.0231018]""]","[]","[]","0.00000","0.00000"

 

I deleted those 2 quotes, imported it back into the db and my server starts fine. No worldspace error.

 

I think it should be within my capability to do a find-and-replace on my backup now.

 

Hopefully, all is not lost after all...

Link to comment
Share on other sites

I think I can save one of you good folk from going through the pain of helping me. I think I've worked out what's happened. I started off by making a backup of the object_data table and confirmed I could import it back into the db. Then I deleted everything in the table and started importing in back in big chunks. When I got to a block that caused the worldspace error to occur, I split it up into smaller blocks until I new I had a chunk that contained both good and broken entries. But now I don't even know if my issue is related to this mod at all.

 

I found some wooden stairs that I knew for sure was causing the error and found that there are a couple of quotes which don't seem to need to be there. I bolded and underlined them below.

 

"2014-11-09 00:00:00","154","[""140.945129"",""[6518.806641,9386.414063,44.0231018]""]","[]","[]","0.00000","0.00000"

 

I deleted those 2 quotes, imported it back into the db and my server starts fine. No worldspace error.

 

I think it should be within my capability to do a find-and-replace on my backup now.

 

Hopefully, all is not lost after all...

 

That is very strange, haven't seen that before.

Link to comment
Share on other sites

So this is going to replace the worldspace coords to this right ? : [267.546,"[6043.805176,1438.859619,0.498425]"]   (with quotes i mean)

And there is no way to remove them from the db cell ? Because call compiling that string will also remove the extra decimal points.

Link to comment
Share on other sites

So this is going to replace the worldspace coords to this right ? : [267.546,"[6043.805176,1438.859619,0.498425]"]   (with quotes i mean)

And there is no way to remove them from the db cell ? Because call compiling that string will also remove the extra decimal points.

 

I don't think there's a way.

Link to comment
Share on other sites

I installed this script, now i get "Not Setup Yet" error when i update garage doors and block doors to combo lock them.

 

Also cant revert this script :( i guess, it has something to do with the db

 

Did you change everything correctly in the swapObject sqf?

Link to comment
Share on other sites

So this is going to replace the worldspace coords to this right ? : [267.546,"[6043.805176,1438.859619,0.498425]"]   (with quotes i mean)

And there is no way to remove them from the db cell ? Because call compiling that string will also remove the extra decimal points.

 

Did you try using a SQL trigger that string replaces any double quotes in the worldspace field?

E.g.

 

DELIMITER $$
CREATE TRIGGER clean_worldspace AFTER INSERT ON object_data
  FOR EACH ROW
    BEGIN
      UPDATE object_data
      SET worldspace = REPLACE(worldspace,'"','')
      WHERE worldspace LIKE '%"%'
    END;
$$
DELIMITER ;
Link to comment
Share on other sites

 

Did you try using a SQL trigger that string replaces any double quotes in the worldspace field?

E.g.

DELIMITER $$
CREATE TRIGGER clean_worldspace AFTER INSERT ON object_data
  FOR EACH ROW
    BEGIN
      UPDATE object_data
      SET worldspace = REPLACE(worldspace,'"','')
      WHERE worldspace LIKE '%"%'
    END;
$$
DELIMITER ;

 

I thought about doing this in end....but i am also using the Vehicle Color mod....and that uses quotes as well...so it will break that mod doing so.

Sure i can disable the trigger if its a vehicle and fire up only on objects.....but juggling 10 different things at the same time...i am bound to forget something somewhere with all these 'hacks' and all hell will break lose at some point....

Thats why i want a clean fix. Every coordinates inserted to be without quotes.

Link to comment
Share on other sites

  • 3 weeks later...

I had vectoring installed but it wasn't saving the angles to the database so I tried to follow all these steps and now my server gets stuck on "Hive: Starting" where did  I go wrong??

 

Also is server_Publicobject and server_publishfullobject both need to be edited? Thanks!

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...