Jump to content

Basebuilding 1.2 Plot pole and wreck fix


Recommended Posts

So I have been messing around with the two files that conflict each other and would like to know if some one has this working?

Here are the two files:

//Allow player to delete objects
	_player_deleteBuild = false;
	if(_isAlive) then {
		if(_isDestructable or _isWreck or _isRemovable) then {
			if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then {
				_player_deleteBuild = true;
			};
		};
	};

	if(_player_deleteBuild) then {
		if (s_player_deleteBuild < 0) then {
			s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
		};
	} else {
		player removeAction s_player_deleteBuild;
		s_player_deleteBuild = -1;
	};

and...

//Remove Object Custom removal test
	if((typeOf(cursortarget) in allremovables) && _hasToolbox && _canDo && !remProc && !procBuild && !removeObject) then {
		if (s_player_deleteBuild < 0) then {
			s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\player_remove.sqf",cursorTarget, 1, true, true, "", ""];
		};
	} else {
		player removeAction s_player_deleteBuild;
		s_player_deleteBuild = -1;
	};

Each one alone works but not together. Does anyone know how to correctly make both work or merging them? I would like to be able to remove wrecks and plot poles as well as the basebuilding 1.2 objects.

Link to comment
Share on other sites

I already have a custom version of that with my own new building materials and items. That part is easy. I just need to know how to merge the two pieces of code so both remove scripts work together instead of overwriting each other.

Link to comment
Share on other sites

well i got a solution wich is working for me... i got improvements 0.3 also working but i have very modified version of basebuilding... but this should work for every version... just do it step by step and read through it...

 

Create a Backup of and open your fn_selfActions.sqf

 

1.1

search for "Remove Object Custom removal test"....

delete the code of that function if u have improvements 0.3.... if not do step 1.2

 

1.2

Replace the code at "Remove Object Custom removal test" with this one: (if u have improvements 0.3 u already deleted this code so pls skip... u will create a function like this in step 3)

 

if((speed player <= 1) && (typeOf(cursortarget) in allbuildables_class) && (_ownerID == dayz_characterID)) then {   //when u have the objects attached to the characterID
//if((speed player <= 1) && (typeOf(cursortarget) in allbuildables_class) && (_ownerID == dayz_playerUID)) then { //when u have the objects attached to the playerUID
if (s_player_codeObject < 0) then {
s_player_codeObject = player addAction [("<t color=""#FF0000"">" + (format[localize "str_actions_delete",_text]) +"</t>"), "dayz_code\actions\player_remove.sqf",cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_codeObject;
s_player_codeObject = -1;
};

(when u have modified your basebuilding so it writes down the playerUID to database instead of the characterID then please remove the "//" in front of the line where it says "PlayerUID" and add "//" to the line with characterID or delete the line)

 

 

2.

search for "Remove Object from code" (only if u got improvements 0.3, if not just skip)

delete this code too....

 

 

3.

search for "Enter Code to remove object" (if u have improvements 0.3, if not just skip cause u did everything at step 1.2 already)

and find the following line:

s_player_codeObject = player addaction [("<t color=""#8E11F5"">" + ("Enter Code of Object to remove") +"</t>"),"dayz_code\external\keypad\fnc_keyPad\enterCode.sqf","",5,false,true,"",""];

and replace it with this one:

s_player_codeObject = player addAction [("<t color=""#FF0000"">" + (format[localize "str_actions_delete",_text]) +"</t>"), "dayz_code\actions\player_remove.sqf",cursorTarget, 1, true, true, "", ""];

4.

search for "Allow player to delete objects"

replace the whole function with this one:

 

if((_isWreck or (_isRemovable and ("ItemCrowbar" in _itemsPlayer))) and _hasToolbox and _isAlive) then {
if (s_player_deleteBuild < 0) then {
s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
};

it will remove the "remove by code" when u have improvements 0.3 but comes with a full working "owner remove" function... 

Link to comment
Share on other sites

well and when it is not working... i'm about to release my files in a few days... i just need to sort them out cause i have modified a lot  to get whole base building working correctly together with epoch... the only last bug is that when u got an wire in your inv u have to build the wirefence with base building... otherwise it may disapear when u only use the "itemWire" to build it... but everything else is working like it should... just gimme some sleep, a bit time to sort out the files and a few hours to write a tutorial ^^ then u may be able to use my base building soon... it has custom buildables already wich i added, but it will never be as good as taytay's version ^^ i've seen all the screenshots from the redesigned menu and added materials... my version is just the base building 1.2 with 0.3 improvements, modified for epoch and about 20 buildables added...

Link to comment
Share on other sites

Hey, how is it going with your version? :)

 

well and when it is not working... i'm about to release my files in a few days... i just need to sort them out cause i have modified a lot  to get whole base building working correctly together with epoch... the only last bug is that when u got an wire in your inv u have to build the wirefence with base building... otherwise it may disapear when u only use the "itemWire" to build it... but everything else is working like it should... just gimme some sleep, a bit time to sort out the files and a few hours to write a tutorial ^^ then u may be able to use my base building soon... it has custom buildables already wich i added, but it will never be as good as taytay's version ^^ i've seen all the screenshots from the redesigned menu and added materials... my version is just the base building 1.2 with 0.3 improvements, modified for epoch and about 20 buildables added...

Link to comment
Share on other sites

i'm working on a "Ready to Run" mission and server file package for chernarus, cause i run my own server on takistan (like u can see in my signature ^^ ) actually i only need to set up some battleye filters and i have to add a little thing to the base building code wich i need to test, but when this works, it will be released very very soon.... i dont want to give an exact eta but it will be released before the weekend ;) and for those who want to have only the base building, well my "Pack" wont be a huge one... and it will be easy to disable the mods i've added... but i wont release a standalone cause the tutorial i would have to write would be too complicated... cause i also had to create a lot of "overrides" for the epoch building system...

 

 

***Update: i think i release it today already (inbetween the next 12 hours from now)... only when i find more bugs  / exploits it will be later then today... ^^ but i already have checked nearly everything... (had some creative players on my server helping me finding bugs and exploits...)

 

 

***Update #2: Damn... i need some sleep... sorry guys but u have to wait one more day... i discovered a small bug wich i already fixed (i hope so, cause not tested yet) but i'm too tired to test it today... i'm gonna test it as soon as i wake up and when it is working i will release it...

 

 

***Update #3: i couldnt sleep without havent this fixed xD ok got it now... looks like it is working correctly... if u want to check out how much i have changed, then please join my server... i already uploaded the mission and server file with the newest bugfixes to let the players on my server test it... and when i wake up i'll take a look to the log's if the latest fixes have created some new bugs and if theres nothing wich look suspicios i'm gonna run the last test's with some clanmates... when these test's be sucessful then it will be finally released... hopefully before midday hours...

 

last few words for today:

if _bugsCount = 0 then {
sleep 28800; // 28800 seconds = 480 minutes = 8 hours
};

***Update #4: hey hey.... ok so far it is working like it should... non exploitable and it writes all to database and also removes correctly... only two little bugs are still there:

 

1.

camo nettings and 3 other objects arent removeable cause those cant be targeted at the correct point to activate the remove action in the scroll menu... (working on a fix...)

 

2.

Epochs "Tag as Friendly" system wont let you build together near one plot pole... this is cause i have changed all objects wich be written to database from characterID to playerUID to prevent objects to be deleted cause a player has died... (playerUID is tied to your cd-key... characterID changes to a new one after a death) i only need to figure out where and when the script calls the file "z\addons\dayz_code/actions/player_tagFriendly.sqf" as soon as i find this i can add the override wich i already created to make it work again :P

only thing i need to now is the following ( "i_dont_know" will be the thing i need to know, cause i cant find it anywhere... already searched whole epoch github files...)

i_dont_know =  compile preprocessFileLineNumbers "z\addons\dayz_code/actions/player_tagFriendly.sqf"

anybody who know where to find that line? ^^ already checked everything where i normaly have found the line when i had to add an override like i have to do here too... hmm :-/ did same with the pitch tent and other functions...

 

 

 

ok so far... these two bugs aren't critical and i could release an updated version later...

 

so do u want a release of this working version with the two bugs?

 

or

 

should i first try fixing it and release it later somewhen without these two little bugs...?

Link to comment
Share on other sites

I'd love it as it is now, with those two bugs, it's fine :D

 

Do you have the files separate to allow for merging to an existing install? I ask because I'm running 1.0.5.1 and just installed custom server 1.2.1, so would be awesome to have the files separate - or like, a 'find this line, paste this' style guide :D

 

 

i'm working on a "Ready to Run" mission and server file package for chernarus, cause i run my own server on takistan (like u can see in my signature ^^ ) actually i only need to set up some battleye filters and i have to add a little thing to the base building code wich i need to test, but when this works, it will be released very very soon.... i dont want to give an exact eta but it will be released before the weekend ;) and for those who want to have only the base building, well my "Pack" wont be a huge one... and it will be easy to disable the mods i've added... but i wont release a standalone cause the tutorial i would have to write would be too complicated... cause i also had to create a lot of "overrides" for the epoch building system...

 

 

***Update: i think i release it today already (inbetween the next 12 hours from now)... only when i find more bugs  / exploits it will be later then today... ^^ but i already have checked nearly everything... (had some creative players on my server helping me finding bugs and exploits...)

 

 

***Update #2: Damn... i need some sleep... sorry guys but u have to wait one more day... i discovered a small bug wich i already fixed (i hope so, cause not tested yet) but i'm too tired to test it today... i'm gonna test it as soon as i wake up and when it is working i will release it...

 

 

***Update #3: i couldnt sleep without havent this fixed xD ok got it now... looks like it is working correctly... if u want to check out how much i have changed, then please join my server... i already uploaded the mission and server file with the newest bugfixes to let the players on my server test it... and when i wake up i'll take a look to the log's if the latest fixes have created some new bugs and if theres nothing wich look suspicios i'm gonna run the last test's with some clanmates... when these test's be sucessful then it will be finally released... hopefully before midday hours...

 

last few words for today:

if _bugsCount = 0 then {
sleep 28800; // 28800 seconds = 480 minutes = 8 hours
};

***Update #4: hey hey.... ok so far it is working like it should... non exploitable and it writes all to database and also removes correctly... only two little bugs are still there:

 

1.

camo nettings and 3 other objects arent removeable cause those cant be targeted at the correct point to activate the remove action in the scroll menu... (working on a fix...)

 

2.

Epochs "Tag as Friendly" system wont let you build together near one plot pole... this is cause i have changed all objects wich be written to database from characterID to playerUID to prevent objects to be deleted cause a player has died... (playerUID is tied to your cd-key... characterID changes to a new one after a death) i only need to figure out where and when the script calls the file "z\addons\dayz_code/actions/player_tagFriendly.sqf" as soon as i find this i can add the override wich i already created to make it work again :P

only thing i need to now is the following ( "i_dont_know" will be the thing i need to know, cause i cant find it anywhere... already searched whole epoch github files...)

i_dont_know =  compile preprocessFileLineNumbers "z\addons\dayz_code/actions/player_tagFriendly.sqf"

anybody who know where to find that line? ^^ already checked everything where i normaly have found the line when i had to add an override like i have to do here too... hmm :-/ did same with the pitch tent and other functions...

 

 

 

ok so far... these two bugs aren't critical and i could release an updated version later...

 

so do u want a release of this working version with the two bugs?

 

or

 

should i first try fixing it and release it later somewhen without these two little bugs...?

Link to comment
Share on other sites

well... i know u all waiting for someone to release base building.... i could release this now cause it has no more critical bugs or some exploits wich could give players an advantage... so the mainpart is working perfect... BUT if u want a "standalone" in the style of "find this line edit with this" then u have to give me some more time... the only thing i could make possible would be a ready to run pack... cause i edited a lot of files... all objects a player can build (Epoch and BB1.2) are writing the playerUID (tied to cd-key) to the database... so now when u die, your tent will still be yours... or the base u've builded ^^ original was using the characterID wich is created by the server... i also have disabled the break tool and spawn as a zombie systems... but i think i will release two versions... one with these two features off (just like i use it too) and one wich will have it like the original epoch version... but i dont really like those two features... ok spawning as a zombie is fun but sometimes u just want to go fast back to your dead body to get your stuff back... and i've seen players always cry when they spawn as a zombie... nice idea but the user should be able to decide if he want to be a zombie or a survivor... and well the break tool system... god damn it ^^ my server is running on takistan... theres not much loot ^^ so it could take a lot of time to find new tools... and well players also dont like this feature ^^

oh my ^^ i'm writing and writing... i should better keep coding now ^^ to release this soon :P

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
  • Discord

×
×
  • Create New...