Mikeeeyy Posted August 20, 2014 Report Share Posted August 20, 2014 (edited) Precise Base BuildingWhat is it?Ever made a super neat base and then after a server restart it moves slightly creating gaps in your walls? This fixes that problem and keeps all buildables exactly where you placed them after a server restart. It also saves vehicle positions precisely which may or may not reduce the 'buginess' of vehicles on player placed floors.What's new in version 1.0.5?This version removes the quotation marks wrapping the direction and position values in the worldspace field. Installation is now also a lot easier.Upgrading from v1.0.4 to 1.0.5Tutorial to uninstall v1.0.4 is here: https://docs.google.com/document/d/1eQe0gf8VkKji_NRjLB_o1STTo1BnKlWkkEA6N29rvU4 (I refuse to use the text editor on this website... abysmal...)Then simply follow the installation tutorial below.You MUST execute this query on your database: http://pastebin.com/QZgLH6twCompatibility:Works with Snap Building Pro.Works with Plot for Life.Works with Build Vectors.Works with Private Hive Tools.Objects already in the database won't be affected.Credit:KillzoneKid for the 'KK_fnc_floatToString' and 'KK_fnc_positionToString' functions which makes this possible.Installation:Un-PBO your dayz_server.pbo.Open up 'server_publishObject.sqf' located in the compile folder (dayz_server\compile\server_publishObject.sqf).Find this line:_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];and replace it with:_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace call AN_fnc_formatWorldspace, [], [], 0,_uid];Open up 'server_functions.sqf' located in the init folder (dayz_server\init\server_functions.sqf).All these functions to the very bottom: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 ] }; AN_fnc_formatWorldspace = { private "_ws"; _ws = toArray str _this; format ["[%1,%2%3]", _this select 0 call KK_fnc_floatToString, _this select 1 call KK_fnc_positionToString, toString ([_ws, (_ws find 93) + 1, count _ws - 2] call BIS_fnc_subSelect)] };Open up 'server_swapObject.sqf' located in the compile folder (dayz_server\compile\server_swapObject.sqf).Find this line:_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];and replace it with:_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace call AN_fnc_formatWorldspace, [], [], 0,_uid];Open up 'server_updateObject.sqf' located in the compile folder (dayz_server\compile\server_updateObject.sqf).Find this: _worldspace = [ round (getDir _object), _position ];and replace it with: _worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace; Save all the files you've edited, repack your 'dayz_server' folder into a PBO and you're done! Edited October 10, 2015 by Mikeeeyy Fixed AN_fnc_formatWorldspace f3cuk, Friendly, sGfU_tv and 11 others 14 Link to comment Share on other sites More sharing options...
inigomontoyayoukilledmydad Posted August 20, 2014 Report Share Posted August 20, 2014 interesting Link to comment Share on other sites More sharing options...
RimBlock Posted August 21, 2014 Report Share Posted August 21, 2014 Looks great. Them gaps are a real pain :) . When you say it is compatible with P4L, I take it you mean version 2+ ?. Looks like it is but just want to confirm as that is the version also using the worldspace field ;) . Thanks for the work and taking the time to share. Tricks 1 Link to comment Share on other sites More sharing options...
raymix Posted August 21, 2014 Report Share Posted August 21, 2014 Thanks for this and well done. You should consider releasing this as part of 1052 because both Snap Pro and P4L will be part of modular player_build. Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 21, 2014 Author Report Share Posted August 21, 2014 Looks great. Them gaps are a real pain :) . When you say it is compatible with P4L, I take it you mean version 2+ ?. Looks like it is but just want to confirm as that is the version also using the worldspace field ;) . Thanks for the work and taking the time to share. Yep, should work perfectly fine as it only modifies the existing entries in the worldspace array :) Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 21, 2014 Author Report Share Posted August 21, 2014 Thanks for this and well done. You should consider releasing this as part of 1052 because both Snap Pro and P4L will be part of modular player_build. I'll make a pull request and see what happens ;) Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 21, 2014 Author Report Share Posted August 21, 2014 Version 1.0.1 Fixed a zero divisor error. Shortened up the compiles by removing duplicate code. Replace old compiles with the ones below: KK_fnc_floatToString = { private "_arr"; if (abs (_this - _this % 1) == 0) exitWith { _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 ] }; Friendly 1 Link to comment Share on other sites More sharing options...
justchil Posted August 22, 2014 Report Share Posted August 22, 2014 Does this look right: Before mod: [161.962,[568.695,15333.1,0.131],"7656119797XXXXXX"] After mod: ["308.735962","[13918.163086,13630.681641,0.392172]","7656119797XXXXXX"] Using a compiles with provided code wrapped in a if (isServer) Just noticed the update so I will apply :D Edit: Appears to be working well in my test environment. :wub: ! Link to comment Share on other sites More sharing options...
RimBlock Posted August 22, 2014 Report Share Posted August 22, 2014 Yep, should work perfectly fine as it only modifies the existing entries in the worldspace array :) Great, that is what I thought. Have you worked out the max length for the 3 values with [] and "" ?. Whilst the actual changes should not affect P4L, there may be a little issue with blowing the max field size especially with other mods looking to use the woldspace field for their persistant data too. I have started a discussion on how best to manage usage of the worldspace filed http://epochmod.com/forum/index.php?/topic/15860-disscussion-on-usage-of-the-worlspace-field-by-mod-makers/?p=119210 so we can try to come up with a loose agreement between mod makers. Although it wont really affect this mod, you may want to jump in or keep an eye on it. Hopefully it will contain info from various mod makers intending to use this field so we can all agree and ajust accordingly. Link to comment Share on other sites More sharing options...
Jossy Posted August 22, 2014 Report Share Posted August 22, 2014 Awesome work we'd been trying to wrap out heads around this the last few weeks, cursed the arma 2 engine and it's silly float digit output limit!!! :angry: Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 Version 1.0.2 Fixed the previous fix. (If you updated to v1.0.1 then this is a crucial update! If by a rare chance that the object's angle is 0, the code in server_monitor will fail and your server will fail to load! Sorry for the inconvenience.) Replace old 'KK_fnc_floatToString' with the one below. 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]) }; raymix 1 Link to comment Share on other sites More sharing options...
robvdheijden Posted August 22, 2014 Report Share Posted August 22, 2014 do u also have any suggestions in how to get the server to load again? after messing around for a bit only thing that i could get to work is a database backup Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 do u also have any suggestions in how to get the server to load again? after messing around for a bit only thing that i could get to work is a database backup Yeah, look through the object_data table for a worldspace looking like this: example: [0, "[1325.2564, 1541.21564, 0.21512]", "165165168516541"] For me it was the above case, to fix simply add quotations to the single number, 0 --> "0", this will fix the issue. Example becomes this: ["0", "[1325.2564, 1541.21564, 0.21512]", "165165168516541"] Link to comment Share on other sites More sharing options...
justchil Posted August 22, 2014 Report Share Posted August 22, 2014 Whew I just had the problem thx for the update. Link to comment Share on other sites More sharing options...
justchil Posted August 22, 2014 Report Share Posted August 22, 2014 My server is still unable to load.14:11:51 Error in expression <)];};_dir = _worldspace select 0;if (count (_worldspace select 1) == 3) then >14:11:51 Error position: <count (_worldspace select 1) == 3) then >14:11:51 Error count: Type String, expected Array,Config entry14:11:51 File z\addons\dayz_server\system\server_monitor.sqf, line 125 Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 Whew I just had the problem thx for the update. Yeah it's a pretty scary sight especially when you have a populated server. Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 My server is still unable to load. 14:11:51 Error in expression <)]; }; _dir = _worldspace select 0; if (count (_worldspace select 1) == 3) then > 14:11:51 Error position: <count (_worldspace select 1) == 3) then > 14:11:51 Error count: Type String, expected Array,Config entry 14:11:51 File z\addons\dayz_server\system\server_monitor.sqf, line 125 Read the reply above that I put to the other guy, I explain how to fix it, if you're still clueless dump your object_data table and I'll fix it for you. Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 Great, that is what I thought. Have you worked out the max length for the 3 values with [] and "" ?. Whilst the actual changes should not affect P4L, there may be a little issue with blowing the max field size especially with other mods looking to use the woldspace field for their persistant data too. I have started a discussion on how best to manage usage of the worldspace filed http://epochmod.com/forum/index.php?/topic/15860-disscussion-on-usage-of-the-worlspace-field-by-mod-makers/?p=119210 so we can try to come up with a loose agreement between mod makers. Although it wont really affect this mod, you may want to jump in or keep an eye on it. Hopefully it will contain info from various mod makers intending to use this field so we can all agree and ajust accordingly. Using this and P4L comes out at about half the worldspace limit from what I could see in my object_data table. Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 Awesome work we'd been trying to wrap out heads around this the last few weeks, cursed the arma 2 engine and it's silly float digit output limit!!! :angry: Thanks buddy, yeah it's a pain. Link to comment Share on other sites More sharing options...
justchil Posted August 22, 2014 Report Share Posted August 22, 2014 Found it: [0.615"[6260.908691,10551.994141,0.105028]","76561197977758477"]. I was looking for just a zero... hopefully this is the only one lol Link to comment Share on other sites More sharing options...
robvdheijden Posted August 22, 2014 Report Share Posted August 22, 2014 Yeah, look through the object_data table for a worldspace looking like this: example: [0, "[1325.2564, 1541.21564, 0.21512]", "165165168516541"] For me it was the above case, to fix simply add quotations to the single number, 0 --> "0", this will fix the issue. Example becomes this: ["0", "[1325.2564, 1541.21564, 0.21512]", "165165168516541"] ok thanks for the response i quickly did a database backup cause we have around 20 people playing on the server this time of day and i had already tried to change the 0 to a differend value good to know to look for the quotations next time Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 ok thanks for the response i quickly did a database backup cause we have around 20 people playing on the server this time of day and i had already tried to change the 0 to a differend value good to know to look for the quotations next time Np, sorry for the inconvenience. Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 Found it: [0.615"[6260.908691,10551.994141,0.105028]","76561197977758477"]. I was looking for just a zero... hopefully this is the only one lol Luckily for me there was 4 but they were all right next to each other lol. Link to comment Share on other sites More sharing options...
SmokeyBR Posted August 22, 2014 Report Share Posted August 22, 2014 metal floors and wood crates are staying in place but my cinder walls are still moving,,, any thoughts ? Link to comment Share on other sites More sharing options...
Mikeeeyy Posted August 22, 2014 Author Report Share Posted August 22, 2014 metal floors and wood crates are staying in place but my cinder walls are still moving,,, any thoughts ? Strange, can you post a copy of your object_data table? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now