Jump to content

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


Mikeeeyy

Recommended Posts

  On 10/10/2015 at 12:54 AM, Mikeeeyy said:

Also for your vehicle paint use this:

_object_position = {
	private["_position","_worldspace","_fuel","_key","_colour","_colour2"];
	_position = getPosATL _object;
	if (_object isKindOf "AllVehicles") then {
		_colour = _object getVariable ["Colour","0"];
		_colour2 = _object getVariable ["Colour2","0"];
		_worldspace = [getDir _object, _position, _colour, _colour2] call AN_fnc_formatWorldspace;
		_fuel = fuel _object;
	} else {
		_worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace;
		_fuel = 0;
	};
	_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
	//diag_log ("HIVE: WRITE: "+ str(_key));
	_key call server_hiveWrite;
};

 

Ahhh, ok, good thing I looked before testing. That is definitely different from before. Will do.

Link to comment
Share on other sites

  On 10/10/2015 at 12:54 AM, Mikeeeyy said:

Also for your vehicle paint use this:

_object_position = {
	private["_position","_worldspace","_fuel","_key","_colour","_colour2"];
	_position = getPosATL _object;
	if (_object isKindOf "AllVehicles") then {
		_colour = _object getVariable ["Colour","0"];
		_colour2 = _object getVariable ["Colour2","0"];
		_worldspace = [getDir _object, _position, _colour, _colour2] call AN_fnc_formatWorldspace;
		_fuel = fuel _object;
	} else {
		_worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace;
		_fuel = 0;
	};
	_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
	//diag_log ("HIVE: WRITE: "+ str(_key));
	_key call server_hiveWrite;
};

 

Ok, I followed all of the new instructions and I have paint so I used the above mentioned code and all seems to be fixed.

I bought 4 vehicles from trader lined them up neatly in a row and painted two of them. I also built 3 different angels of metal floors. The first 4 vehicles I TPed using infiSTAR so I bought one more and drove it a distance and left it.

Restarted the server and all 5 vehicles stayed in place I did not notice a move so I think the missing digits you mentioned Mikeeeyy should be fine. The vector built metal floors stayed as well.

Mickeeeyy thanks again for all you do and I will let you know if I have any players report any other issues, but base test show everything should be good :)

Link to comment
Share on other sites

  On 10/10/2015 at 1:34 AM, azzdayz said:

Ok, I followed all of the new instructions and I have paint so I used the above mentioned code and all seems to be fixed.

I bought 4 vehicles from trader lined them up neatly in a row and painted two of them. I also built 3 different angels of metal floors. The first 4 vehicles I TPed using infiSTAR so I bought one more and drove it a distance and left it.

Restarted the server and all 5 vehicles stayed in place I did not notice a move so I think the missing digits you mentioned Mikeeeyy should be fine. The vector built metal floors stayed as well.

Mickeeeyy thanks again for all you do and I will let you know if I have any players report any other issues, but base test show everything should be good :)

No problem, although you should test the accuracy by snapping floors together then restarting the server. See if any gaps form in between the floors.

Link to comment
Share on other sites

  On 10/10/2015 at 1:51 AM, Mikeeeyy said:

No problem, although you should test the accuracy by snapping floors together then restarting the server. See if any gaps form in between the floors.

Just tested that for you and there is no gaps between the floors. I did notice the floors built at a 45 degree angel have a hairline gap, but there is no gap at all when building flat, they snap that way before restart. I don't think that has anything to do with your script though. That may have already been like that and I never noticed until I went looking.

Link to comment
Share on other sites

  On 10/10/2015 at 2:16 AM, azzdayz said:

Just tested that for you and there is no gaps between the floors. I did notice the floors built at a 45 degree angel have a hairline gap, but there is no gap at all when building flat, they snap that way before restart. I don't think that has anything to do with your script though. That may have already been like that and I never noticed until I went looking.

Okay, thanks for testing.

Link to comment
Share on other sites

  On 10/11/2015 at 8:46 PM, JokerZClan said:

I cannot find:

_worldspace = [
        round (getDir _object),
        _position
    ];

In my file? Is this necessary then?

JokerZClan, your's might be:

        _worldspace = [
            round(direction _object),
            _position
        ];

Still in your server_updateObject.sqf file.
Like mine was. Must be part of other mods installed? I still  added mikeys code but instead of:

        _worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace;

I put:

         _worldspace = [direction _object, _position] call AN_fnc_formatWorldspace;

Do you think this would still work the same mikey?

Link to comment
Share on other sites

Hello Mikeeeyy!

I installed on vanilla server:

1) P4L

2) Snap Building Pro

3) Vector Building

4) Precise base building 1.0.5

 

I have problem. Vehicles position dont update in database.

Get error hiveext:

2015-10-12 15:27:42 HiveExt: [Error] Error executing |CHILD:305:428:[60.194595,[7876.916016,7433.305664,0.0278015],"<null>",<null>]:0.570871:|

 

Ger error arma2oaserver.rpt:

  Reveal hidden contents

 

 

server_functions.sqf line 1041:

// Use this for Plot for Life and Build Vectors
AN_fnc_formatWorldspace = {
    format ["[%1,%2,""%3"",%4]", _this select 0 call KK_fnc_floatToString, _this select 1 call KK_fnc_positionToString, _this select 2, _this select 3]
};

 

server_functions.sqf:

  Reveal hidden contents
 

 

server_updateObject.sqf:

  Reveal hidden contents

 

 

Can you help me please

Edited by rss_adm
Link to comment
Share on other sites

  On 10/12/2015 at 1:06 PM, rss_adm said:

Hello Mikeeeyy!

I installed on vanilla server:

1) P4L

2) Snap Building Pro

3) Vector Building

4) Precise base building 1.0.5

 

I have problem. Vehicles position dont update in database.

Get error hiveext:

2015-10-12 15:27:42 HiveExt: [Error] Error executing |CHILD:305:428:[60.194595,[7876.916016,7433.305664,0.0278015],"<null>",<null>]:0.570871:|

 

Ger error arma2oaserver.rpt:

Hidden Content

 

 

server_functions.sqf line 1041:

// Use this for Plot for Life and Build Vectors
AN_fnc_formatWorldspace = {
    format ["[%1,%2,""%3"",%4]", _this select 0 call KK_fnc_floatToString, _this select 1 call KK_fnc_positionToString, _this select 2, _this select 3]
};

 

server_functions.sqf:

Hidden Content

 

 

server_updateObject.sqf:

Hidden Content

 

Can you help me please

Use the new 'AN_fnc_formatWorldspace' in the OP.

Link to comment
Share on other sites

hi mikey.  thanks for your continued work on this and of course the script itself.  I just wanted to point out that i did the uninstall and noticed a little issue, nothing major.

Your last step for the uninstall say to open server_swapObject.sqf from the init folder.  It should be server_functions.sqf.

 

Again, thanks a bunch

Link to comment
Share on other sites

  On 10/15/2015 at 12:00 AM, theduke said:

hi mikey.  thanks for your continued work on this and of course the script itself.  I just wanted to point out that i did the uninstall and noticed a little issue, nothing major.

Your last step for the uninstall say to open server_swapObject.sqf from the init folder.  It should be server_functions.sqf.

 

Again, thanks a bunch

Thanks for your input :) I have fixed it.

Link to comment
Share on other sites

  • 1 month later...

Hi

I'm trying to install that.

Instructions all clear, no problem, but when i launch and try to build a garage door, i don't have the options.

My RPT file is raising an error :

My line 989 is if (abs (_this - _this % 1) == 0) exitWith { str _this };

And i use this :

Any ideas ?

Nevermind, i fix that and now i have the option to vector rotate, etc...

But, when i build AND upgrade, and restart the server, items are not there anymore, like not saving in the DB.

Not upgraded items works fine

Apparently there is an issue with upgraded items.

I've put an half cinder wall, and my hive log show that :

2015-12-02 14:40:28 HiveExt: [Information] Method: 308 Params: 11:CinderWallHalf_DZ:0:28:[18.827,[1710.379,5093.714,0.001],76561197999330211,[[0.323,0.946,0],[0,0,1]]]:[]:[]:0:17104509370227:
2015-12-02 14:40:28 HiveExt: [Information] Result: ["PASS"]


When i upgrade the wall, my hive goes like :

2015-12-02 14:41:22 HiveExt: [Information] Method: 310 Params: 17104509370227:
2015-12-02 14:41:22 HiveExt: [Information] Result: ["PASS"]


310 is the hive code to delete item, and we can see it's the id of the wall previously builded.

Any idea why it's doing that ?

Link to comment
Share on other sites

  • 5 months later...

Just installed this and am getting the following RPT error:
 

12:54:24 Error in expression <
private "_arr";
if (abs (_this - _this % 1) == 0) exitWith { str _this };
_arr >
12:54:24   Error position: <% 1) == 0) exitWith { str _this };
_arr >
12:54:24   Error %: Type String, expected Number
12:54:24 File z\addons\dayz_server\init\server_functions.sqf, line 978
12:54:24 Error in expression <
private "_arr";
if (abs (_this - _this % 1) == 0) exitWith { str _this };
_arr >
12:54:24   Error position: <% 1) == 0) exitWith { str _this };
_arr >
12:54:24   Error Generic error in expression
12:54:24 File z\addons\dayz_server\init\server_functions.sqf, line 978

My server_updateObject.sqf was originally this (for Plot for Life):
 

_worldspace = [(getDir _object) call KK_fnc_floatToString,    _position call KK_fnc_positionToString];

it's now this:
 

_worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace;

 

Line 978 in server_functions.sqf is this:
 

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])
};


Anyone got any ideas? Thanks.

Link to comment
Share on other sites

  On 5/7/2016 at 3:25 AM, DY357LX said:

 

Expand  

Replace AN_fnc_formatWorldspace with this please:

AN_fnc_formatWorldspace = {
	diag_log _this;
    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)]
};

Then run your server and post your arma2oaserver.rpt file.

Link to comment
Share on other sites

  Reveal hidden contents

As requested. (And I've removed my SteamID.)

And, looking at the database, it doesn't appear that the metal floors and plot pole I built have been saved.

Link to comment
Share on other sites

  On 5/7/2016 at 7:02 PM, DY357LX said:
  Reveal hidden contents

As requested. (And I've removed my SteamID.)

And, looking at the database, it doesn't appear that the metal floors and plot pole I built have been saved.

Expand  

Do those errors appear when your server loads or are you placing objects?

Link to comment
Share on other sites

  On 5/7/2016 at 8:31 PM, Mikeeeyy said:

Do those errors appear when your server loads or are you placing objects?

Expand  

When placing objects.

Currently installed mods:
Gold coins + Banking
Plot for Life
Snap building + vectors
Door Management
Slow Zombies
Master key
Weed fields
WAI
Services Points
Custom loadouts
Safezones

I can provide files if you want them.

Link to comment
Share on other sites

  On 5/7/2016 at 7:02 PM, DY357LX said:
  Reveal hidden contents

As requested. (And I've removed my SteamID.)

And, looking at the database, it doesn't appear that the metal floors and plot pole I built have been saved.

Expand  

Can you post your server_publishObject.sqf file please.

Link to comment
Share on other sites

  Reveal hidden contents

Yeah sure. Thanks for taking the time to help.
This part:

_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];

is from Plot for Life, if I remember rightly.
Maybe I should move the:

  Quote

_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];

Expand  

line up above the Plot for Life lines? Write info to database before  Plot for Life can convert it? (I think that's what it's doing?)

Link to comment
Share on other sites

  On 5/7/2016 at 8:48 PM, DY357LX said:
  Reveal hidden contents

Yeah sure. Thanks for taking the time to help.
This part:

_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];

is from Plot for Life, if I remember rightly.
Maybe I should move the:

line up above the Plot for Life lines? Write info to database before  Plot for Life can convert it? (I think that's what it's doing?)

Expand  

That's the problem, remove those 2 lines:

_worldspace set [0, (_worldspace select 0) call KK_fnc_floatToString];
_worldspace set [1, (_worldspace select 1) call KK_fnc_positionToString];

 

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...