[Project] Basebuilding 1.2 change Code

kikyou2

Valued Member!
Hi there!

Since the Basebuilding 1.2 Mod is a great addition for every Server I want to fix some of the issues which this still have.

First I want to fix the Codes which are generated for the removal of Objects or to Operate Gates.

The Code is exactly the same as the ObjectUID and the ObjectUID is generated from the numbers of the position of the Object. If the Object shifts the Object Code will no longer work and here is the problem -> nearly every Object shift.

So I wanted to take another way to generate the Code. My atm best idea is to change it to the following:
-if the Object is written to the database it will write the PlayerUID to the CharacterID field and not the CharacterID so that if you die you're still the owner of the Object (this I want to change too for normal tents etc)
-the Code should be taken from this field too

The advantage is that the code will not change so the Code should work still if the Object shifts.

I will start for this today and will post the complete solution if I'll have one, maybe you're interested in this too and want to help?

Then just post everything here! It doesn't matter whether you can code, if you can contribute a new idea or something it can help too!

Thanks for your attention, now gettin it on! :)

Cheers

kikyou2
 
thank god someone starts doing this one =)
i cant really help on coding this stuff i can change some things here and there... but this one is some levels above my skills ^^

do you know the keypanel system of origins when building a house?
there you can enter your own code before the object is built...
maybe you can do something like this here too?
because remembering a 15letter code is not real easy i guess...
and in this case maybe we can use ONE code for BOTH keypanels for gates too?

also like the idea with the permanent tents too

if you need a server to test your stuff... i can help you out...
i have an own rootserver so i can host some more if needed...
 
thank god someone starts doing this one =)
i cant really help on coding this stuff i can change some things here and there... but this one is some levels above my skills ^^

I'm far away from just typing something in and it will work, I try something out and test it ingame and see if it works - if not I go back to the beginning. As far as I can see the only thing to change this should be to change everywhere dayz_characterID to dayz_characterUID I'm currently doing this :)

do you know the keypanel system of origins when building a house?
there you can enter your own code before the object is built...
maybe you can do something like this here too?

The problem is here that we got to use something which is in the database. The ObjectUID was used from the developer cause its unique for every object and is already written to the database.
The only suitable other thing is the CharacterID field which is normally used to identify you as owner of tents etc. In DayZ Epoch this field is already filled for Vaults and Cars with the PlayerUID that you don't lose your owner status. I don't see why this shouldn't be also for tents and for craftable items.

And when we write it to the database we can use it as Code that the Script can compare them :)

I think I could do something like type in your own code, the only problem I see is that this must be written in the CharacterID field. So the owner remove would not be possible anymore because your own Code wouldn't match the CharacterID or the PlayerUID.

So this would only possible if you remove the normal remove function and only allow removing things via code.

Will see which of both methods will be best to handle.

if you need a server to test your stuff... i can help you out...
i have an own rootserver so i can host some more if needed...

Thanks for your offer but I have my own root to so there is no need :)
 
in origins the code and owner are written in the hitpoints table of the objects

Code:
[["stage_1",0],["stage_2",0],["stage_3",0],["stage_4",0],["playername",1.0e07],["passwordtut",yourcode]]

the stages are indicating if the building (in this case a house) is complete (0 is complete)
the playername shows to who it belongs and passwordtut links the code to open/close it...

so all the buildables can keep their unique id... but the code to operate/remove would be stored in the hitpoints table which is not used bei them so far...
 
You're right that would be a option too ;)

Currently I'm stuck at the dayz_playerUID function which seems to return 0 for all players but it should only this for AIs normally.

I will try _uid = getplayeruid player; instead
 
Though not having looked through daimyo's great BB 1.2, I'm eager to do something, too!... I wish I were familiar with coding things ..

The problem is here that we got to use something which is in the database. The ObjectUID was used from the developer cause its unique for every object and is already written to the database.
I even don't have a image of what should be done finally, but here's a little thing I'd thought so as to store multiple values in a single field. sorry in advance if it sounds bit silly here...
Code:
//Provided that you want to store 'PlayerID : XXXXX', 'Password : YYYY', 'OtherValue : ZZZ',
storedValue = XXXXX * 10000000 + YYYY * 1000 + ZZZ;
//if you want to retrieve original values,
PlayerID = storedValue/10000000;
Password = (storedValue - PlayerID*10000000)/1000;
OtherValue = (storedValue - PlayerID*10000000 - Password*1000);
you can choose arbitrary number of places of the values with a little more tweak.
 
Thanks for the input I will have a look what I can do.

Currently I'm trying to change the basic code to get a knowhow at how the script is working. So for this testing purposes I tried to first change that the Buildables are all related to the PlayerUID instead of the CharacterID.

I managed that it writes the PlayerUID into the database. Then I wanted to try that the PlayerUID is the Code which you need to get access to the Object. Here I'm stucked, cause the script says you correctly that the code of the thing is your playerUID and everything works fine but it does not accept the key if you type it in. I activated a debug hint that tells me the content of the keycode variable but the output is "any" :/

Here is what I've done from now:

enterCode.sqf


Code:
keyCode = _lever getVariable ["CharacterID","0"];
Changed to
Code:
keyCode = _lever getVariable ["PlayerUID","0"];

--------------------------

player_remove.sqf


added under // Pre-Checks
Code:
_playeruid= getplayerUID player

changed
Code:
if ( _ownerID == dayz_characterID ) then {
call _func_ownerRemove;
};
to
Code:
if ( _ownerID == _playeruid ) then {
call _func_ownerRemove;
};

--------------------------

player_build.sqf


Added under // Location placement declarations
Code:
_playeruid= getPlayerUID player;

changed
Code:
cutText [format["You have constructed a %1, REMEMBER THIS PERMANENT KEYCODE: %2 .  Make sure to build 2 (one in/one out) Key Panels as soon as possible to get both codes!",_text,_uid], "PLAIN DOWN",60];
to
Code:
cutText [format["You have constructed a %1, REMEMBER THIS PERMANENT KEYCODE: %2 .  Make sure to build 2 (one in/one out) Key Panels as soon as possible to get both codes!",_text,_playeruid], "PLAIN DOWN",60];

changed
Code:
cutText [format["You have constructed a %1\n Keycode for object removal: %2 .\n",_text,_uid], "PLAIN DOWN",60];
to
Code:
cutText [format["You have constructed a %1\n Keycode for object removal: %2 .\n",_text,_playeruid], "PLAIN DOWN",60];

changed

Code:
_object setVariable ["CharacterID",dayz_characterID,true];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];

to
Code:
_object setVariable ["PlayerUID",_playeruid,true];
dayzPublishObj = [_playeruid,_object,[_dir,_location],_classname,_playeruid];

--------------------------

server_publishObject.sqf


added at the beginning
Code:
_playeruid =_this select 4;

below this
Code:
_object setVariable ["ObjectUID", _uid,true];
added
Code:
_object setVariable ["PlayerUID",_playeruid,true];

--------------------------

server_monitor.sqf


above this
Code:
if ((_object isKindOf "Static") && !(_object isKindOf "TentStorage")) then {
added
Code:
_object setVariable ["PlayerUID", _ownerID, true]
 
After server restart the code works *rofl*

So it works but I have to look for a solution why it doesn't work immediately after build
 
Hi Kikyou2,

i think using PlayerUID as keypanel code for operating gates and object removal is a bad idea, because the PlayerUID is stored within the squad.xml, and it is possible to get them from there without any problem.

Greets

Panadur
 
Hi Kikyou2,

i think using PlayerUID as keypanel code for operating gates and object removal is a bad idea, because the PlayerUID is stored within the squad.xml, and it is possible to get them from there without any problem.

Greets

Panadur

Hi there Panadur ;),

this was just the early first idea of what could have been done and when you reread the whole thread you will see that I'm currently working to change that code to the PlayerUID to get some knowhow on which parts the code is called and how you can change it.

The plan is to save the PlayerUID in the Character Field but not as Code, only that you're stay the owner even if you die. The code should be saved preferably in the Hitpoints Field and should be generated via a combination of characterID, playerUID and a variable like time.
The best solution would be that you can choose your own code and type it in before you build something - that is my major goal. :)
 
Thank u we will try this on our servers asap.

lost-soldiers.soundmarine.at

send from my Galaxy S2 using tapatalk
 
Hi,

hmm, i think i should read more carefully next time then :). Just forget my 2 cents then... i think working and reading posts at same time is just a bad idea :)
 
Thank u we will try this on our servers asap.

lost-soldiers.soundmarine.at

send from my Galaxy S2 using tapatalk

I would advise you to don't do that, I'm throwing this only on my Test Server and testing stuff. Also the PlayerUID as Code isn't that good solution.

If I have the perfect working solution I will write a tutorial how you can change everything or doing a new github for that. For the moment this is everything work on progress and may have many issues ;)

I only posted what I've done so far that everybody can follow what I'm doing here
 
Ok thanks we dont do it !

lost-soldiers.sounfmarine.at

send from my Galaxy S2 using tapatalk
 
Hm I'm a little bit confused.

At this part which is put into the server_monitor.sqf

Code:
_object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
if ((_object isKindOf "Static") && !(_object isKindOf "TentStorage")) then {
_object setpos [(getposATL _object select 0),(getposATL _object select 1), 0];
};
//Set Variable
if (_object isKindOf "Infostand_2_EP1" && !(_object isKindOf "Infostand_1_EP1")) then {
_object setVariable ["ObjectUID", _worldspace call dayz_objectUID2, true];
};

As you can see this is the moment where the ObjectUID is going to put in via setVariable that the BaseBuilding can take it as code.

If I'm not wrong the server_monitor.sqf query every information of an object out of the table, I don't see why we shouldn't do it like this:

Code:
_object setVariable ["ObjectUID", _idKey, true];
if ((_object isKindOf "Static") && !(_object isKindOf "TentStorage")) then {
_object setpos [(getposATL _object select 0),(getposATL _object select 1), 0];
};
//Set Variable
if (_object isKindOf "Infostand_2_EP1" && !(_object isKindOf "Infostand_1_EP1")) then {
_object setVariable ["ObjectUID", _idKey, true];
};

As far as I know if the Object shifts the ObjectUID isn't updated but the Worldspace updates. So the code would stay the same as it was as you build the thing. If you do _worldspace call dayz_objectUID2 it would be calculated again with the new position of the object and then you would have a wrong code cause the BaseBuilding would do at the enterCode.sqf

Code:
keyCode = _lever getVariable ["ObjectUID","0"];

So now it would have the new ObjectUID as the Code and you have the old one.

Am I completely wrong or is it that easy to fix all problems with shifting objects? That would make complete change of the Code system unnecessary!
 
Okay as I can see now the _idKey is unfortunately the ObjectID and not UID.

I will see if I can do a custom read from Hive to get the ObjectUID into a variable.
 
hey kik i know this is a bit off topic but some on as well, but the gate pieces <concrete_wall_ep1> are destructible by 5 as 50 shots even when the setting is enabled in build_list,any ideas why that is,also if anyone needs a nice command to remove dead bodies from the bug your tryin to fix use::::>In Chive etc in sql box enter this with your numbers needing fixing:


update instance_deployable set owner_id =1981 where owner_id = 1951


Where 1951 is the dead bugged body and 1981 would be the persons alive body,also you can find these numbers by searching a players UID with CC etc. Hope this helps, and any help on the door issue would be great <3
 
hey kik i know this is a bit off topic but some on as well, but the gate pieces <concrete_wall_ep1> are destructible by 5 as 50 shots even when the setting is enabled in build_list,any ideas why that is,also if anyone needs a nice command to remove dead bodies from the bug your tryin to fix use::::>In Chive etc in sql box enter this with your numbers needing fixing:


update instance_deployable set owner_id =1981 where owner_id = 1951


Where 1951 is the dead bugged body and 1981 would be the persons alive body,also you can find these numbers by searching a players UID with CC etc. Hope this helps, and any help on the door issue would be great <3

Do satchel charges also destroy your buildables? There was a bug with the destructibility of player built objects for a little while, it was fixed on github though and I've not been able to damage one since.
 
Do satchel charges also destroy your buildables? There was a bug with the destructibility of player built objects for a little while, it was fixed on github though and I've not been able to damage one since.
havent tested charges yet as the as50 is more common on my server,but i deff will,also its only the door pieces,very strange
 
Back
Top