[Release] BaseBuilding 1.2 Improvements 0.1 (better and editable Keycode, permanent Owner)

seaweeduk

OpenDayZ Rockstar!
I'm having issues with tents still inserting survivor id instead of unique_id causing foreign key errors and no entry in the DB, I have the right table setup AFAIK but I can't see how that foreign key constraint is going to work without actually changing the tent build code to add unique_id?

Did I miss a post somewhere or something.
 

seaweeduk

OpenDayZ Rockstar!
I flat out removed the foreign key constraint on owner_id, tents and objects both saving now. No doubt this is going to break something though :D
 

dheir

New Member
I could be wrong here, and i'm not quite sure if it matters. but in the following code should
_code and _fuel be switched around in the first code section?

Hi there,


Merge the first line with this line

Code:
private ["_class","_uid","_charID","_object","_worldspace","_key","_code","_fuel"];

Below this
Code:
_class =_this select 3;

Add this
Code:
_fuel = _this select 4;
_code = _this select 5; //added to pick up the code which we passed from player_build.sqf

kikyou2
 

spectrez

Member
Staff member
The problem lies within the original files of kik, reality doesnt seem to support the string which is sent to the DB, which is too bad, all i really wanted was a fix for code 0 so people couldnt move stuff that wasnt player made.
 

seaweeduk

OpenDayZ Rockstar!
i tried just that, and now they wont go away when you remove either a tent or object


Yep same problem here, deployables aren't deleted database side now, although I didn't actually test the removals fully before I removed the foreign key constraint.

Kikyou any advice on how to get PID and UID to work correctly together? I have a reality test instance I can give you full RDP access to if you only have access to epoch files?

Clearly table schema changes are required but I think there is more to be done if tents are going to work too? MAybe bring the clientside build function for tents into the mission and have that add the UID too?
 

seaweeduk

OpenDayZ Rockstar!
The more I think about it the more I realise all I really need is the 4 digit codes and the edit functionality anyway, I will try and strip these out until a working solution for reality is reached, assuming its even possible.
 

kikyou2

Valued Member!
I could be wrong here, and i'm not quite sure if it matters. but in the following code should
_code and _fuel be switched around in the first code section?


For the private section it doesn't matters in which order they are placed. Its just to prevent that they get problems with other scripts.

Yep same problem here, deployables aren't deleted database side now, although I didn't actually test the removals fully before I removed the foreign key constraint.

Kikyou any advice on how to get PID and UID to work correctly together? I have a reality test instance I can give you full RDP access to if you only have access to epoch files?

Clearly table schema changes are required but I think there is more to be done if tents are going to work too? MAybe bring the clientside build function for tents into the mission and have that add the UID too?


As I said I will have a look on reality files if I have time to do so. At the moment I'm really busy with my own server ;)

There is no problem with having access to files, cause I own a root and can set up my own test servers as I want. The time is the problem

Atm I'm working to get the 1.0.1 update on my server, but I edited some things:
-bought vehicles do not parachute anymore, they spawn with 5 seconds delay (red arrow is pointing at that time to show that something will spawn) and will be locked immediately
-the safes are using my 4 digit system of basebuilding mod and uses the graphical hud instead of the mousewheel thing of epoch
-the 30m plot now also works for BaseBuilding Stuff (is needed)
-fixed that you cannot build or remove things in trader cities
-fixed that you cannot start building somewhere it is allowed and walk into the place where its restricted and build then (abuse fix)
-I implemented the 1.0.1 Epoch Crafting things into Basebuilding Mod so that there aren't two systems running separetly, to have a imagination how it will work on my server have a look on that screen:

Aaw6zBO.jpg
 

seaweeduk

OpenDayZ Rockstar!
For the private section it doesn't matters in which order they are placed. Its just to prevent that they get problems with other scripts.




As I said I will have a look on reality files if I have time to do so. At the moment I'm really busy with my own server ;)

There is no problem with having access to files, cause I own a root and can set up my own test servers as I want. The time is the problem

Atm I'm working to get the 1.0.1 update on my server, but I edited some things:
-bought vehicles do not parachute anymore, they spawn with 5 seconds delay (red arrow is pointing at that time to show that something will spawn) and will be locked immediately
-the safes are using my 4 digit system of basebuilding mod and uses the graphical hud instead of the mousewheel thing of epoch
-the 30m plot now also works for BaseBuilding Stuff (is needed)
-fixed that you cannot build or remove things in trader cities
-fixed that you cannot start building somewhere it is allowed and walk into the place where its restricted and build then (abuse fix)
-I implemented the 1.0.1 Epoch Crafting things into Basebuilding Mod so that there aren't two systems running separetly, to have a imagination how it will work on my server have a look on that screen:

Aaw6zBO.jpg


I've not checked out epoch myself but I'm very grateful for your work, I already had an automated solution to replace ID's with living ID's on restart the 4 digit codes are a godsend and I'm sure I'll get something working with them + ID's soon :D
 

seaweeduk

OpenDayZ Rockstar!
So far I have all the UID's reverted back to ID's again and swapped them out in your code too, so far everything saving to db but when I enter a code I get told access granted but don't get a remove option?

They edit OK db side too codes everything is saved even after editting.

edit: seems removeObject is the problem I think, if I remove the check for that from selfActions I get the option to remove an item after entering a code successfully.

I will continue playing around tomorrow and hopefully end up with something workable
 

kikyou2

Valued Member!
There are two options to remove something.

The green owner remove button and the purple BaseOwner remove button if you typed in the right code.
 

seaweeduk

OpenDayZ Rockstar!
There are two options to remove something.

The green owner remove button and the purple BaseOwner remove button if you typed in the right code.


Ah I edited the wrong line when I removed the check for removeObject I tried it on the right one and still no option

Code:
    // Remove Object from code
    if((typeOf(cursortarget) in allbuildables_class) && _canDo  && !procBuild && !remProc && removeObject ) then {
        _validObject = cursortarget getVariable ["validObject",false];
        if (_validObject) then {
            if (s_player_codeRemove < 0) then {
                s_player_codeRemove = player addaction [("<t color=""#8E11F5"">" + ("Base Owners Remove Object") +"</t>"),"dayz_code\actions\player_remove.sqf","",5,false,true,"",""];
            };
        } else {
            player removeAction s_player_codeRemove;
            s_player_codeRemove = -1;
        };
    } else {
        player removeAction s_player_codeRemove;
        s_player_codeRemove = -1;
    };

I'm guessing I've missed an edit somewhere in another file (probably codeCompare maybe?) but I can't for the life of me see which of these it is causing the problem
(typeOf(cursortarget) in allbuildables_class) && _canDo && !procBuild && !remProc && removeObject

I can confirm everything is working perfectly DB side, code edits into the fuel column, owners_id as the character ID's again etc.

edit:
Infact I'm not getting the green option either despite having the same char ID, I think I have missed something somewhere :( I will revert to basebuilding 1.2 again tomorrow and try adding just the code changes again without the UID's.
 

spectrez

Member
Staff member
@seaweeduk

If you could fix this i would be eternally greatful :) having the bugs with people exploiting the "0" code would be really nice to get fixed
 

kikyou2

Valued Member!
@seaweeduk

If you could fix this i would be eternally greatful :) having the bugs with people exploiting the "0" code would be really nice to get fixed

Should be easy to fix. Didn't try this but should work in my mind

Inside codeCompare.sqf change it like this:

Above
Code:
// compare arrays to see if code matches
if (typeOf(_panel) == "Infostand_2_EP1") then {

Add
Code:
if (keyCode == 0) then {cutText ["Removing buildables which are placed serverside is not allowed!", "PLAIN DOWN"];breakOut "exit";};
 

spectrez

Member
Staff member
Damn, that was fast, will test right away


EDIT:

Results in nothing being removable, and it doesnt return any sound or msg.
 

spectrez

Member
Staff member
Should be easy to fix. Didn't try this but should work in my mind

Inside codeCompare.sqf change it like this:

Above
Code:
// compare arrays to see if code matches
if (typeOf(_panel) == "Infostand_2_EP1") then {

Add
Code:
if (keyCode == 0) then {cutText ["Removing buildables which are placed serverside is not allowed!", "PLAIN DOWN"];breakOut "exit";};

This sadly isnt working, so if anyone has any input to how i should go about with this issue
 

Phoenix

Member
I'm getting feeling that my Reality fix isn't working for some people because there have been some mistakes made along the way of your installations :p
 

kikyou2

Valued Member!
This sadly isnt working, so if anyone has any input to how i should go about with this issue


Then try this, also untested.

Open your fn_selfactions.sqf

search for
Code:
_ownerID = _cursorTarget getVariable ["characterID","0"];

below that add this if you use my 4 digit system
Code:
_code = _cursorTarget getVariable ["Code","0"];

and if you use normal Basebuilding System try
Code:
_code = _cursorTarget getVariable ["ObjectUID","0"];

then search for

Code:
if((speed player <= 1) && !removeObject && (typeOf(cursortarget) in allbuildables_class) && cursorTarget distance player < 5 && _canDo) then {

and change that line to (doesn't matter if my version or not)
Code:
if((speed player <= 1) && !removeObject && (typeOf(cursortarget) in allbuildables_class) && cursorTarget distance player < 5 && _canDo && (_code > 0)) then {

If this works you will not get a Enter Code option for the things where the code is 0

If it doesn't work I will later have a quick look at that myself and test it. ;)
 
Top