Jump to content
  • 0

Base Decay Question


LoadingSA

Question

So here's what I want to do. I want to make it so players on my server don't need plot poles to build but do need to use them to maintain their base every 10 days.

 

I want to change it so the area maintain their base from a plot pole but it needs to effect a bigger area, say 100m.

 

I also want to edit it so it's "free" to use the maintain option.

 

I also use CPC godmode for buildings so I don't know if that will effect the maintain option.

 

anyone know how I can do this?

Link to comment
Share on other sites

Recommended Posts

  • 0

Yeah, you would think, although i have had that setting since the server has been set up, it used to be fine but has changed for some reason and not sure why

 

 

sorry read that at a very late time

 

try this in your init

 

DZE_GodModeBase = true;

 

just under the map positions and well above 

 

dayz_maxAnimals = 5; // Default: 8
dayz_tameDogs = true;
DynamicVehicleDamageLow = 0; // Default: 0
DynamicVehicleDamageHigh = 100; // Default: 100
Link to comment
Share on other sites

  • 0

The -1 setting is known to not work correctly. What happens is sometimes the server code ignores this setting and does a clean up anyways.

 

To prevent this you should set it to a positive number like 20 or 30 days. Then have your players to maintain there base to keep it on the server.

 

How to allow your player(s) to maintain?

Open up your dayz_code.pbo. Inside the actions folder you will find maintain_area.sqf

 

Place the maintain_area.sqf in your MPmission/Scripts folder. (Or what ever folder you want)

 

You can edit the maintain cost so its cheap if you want. Open the maintain_area.sqf and find this block of code

_requirements = [];
switch true do {
	case (_count <= 10):  {_requirements = [["ItemGoldBar10oz",1]]};
	case (_count <= 20):  {_requirements = [["ItemGoldBar10oz",2]]};
	case (_count <= 35):  {_requirements = [["ItemGoldBar10oz",3]]};
	case (_count <= 50):  {_requirements = [["ItemGoldBar10oz",4]]};
	case (_count <= 75):  {_requirements = [["ItemGoldBar10oz",6]]};
	case (_count <= 100): {_requirements = [["ItemBriefcase100oz",1]]};
	case (_count <= 175): {_requirements = [["ItemBriefcase100oz",2]]};
	case (_count <= 250): {_requirements = [["ItemBriefcase100oz",3]]};
	case (_count <= 325): {_requirements = [["ItemBriefcase100oz",4]]};
	case (_count <= 400): {_requirements = [["ItemBriefcase100oz",5]]};
	case (_count <= 475): {_requirements = [["ItemBriefcase100oz",6]]};
	case (_count <= 550): {_requirements = [["ItemBriefcase100oz",7]]};
	case (_count <= 625): {_requirements = [["ItemBriefcase100oz",8]]};
	case (_count > 625):  {_requirements = [["ItemBriefcase100oz",9]]};
};

Change to the amounts you wish.

 

Next open your custom fn_selfActions.sqf and search for this block of code

  if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
   if (s_player_maintain_area < 0) then {
     s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
    s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
   };

Change that too (remember if you placed the maintain_area.sqf inside a different folder then Scripts change the call)

 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
   if (s_player_maintain_area < 0) then {
     s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "Scripts\maintain_area.sqf", "maintain", 5, false];
    s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "Scripts\maintain_area.sqf", "preview", 5, false];
   };

No custom fn_selfAction.sqf?

Open your dayz_code.pbo and you will find it inside the compile folder. Place the fn_selfAction.sqf inside your Mpmission/Scripts folder. (Or what ever folder you want)

 

Now open your custom compiles and search for fn_selfAction.sqf and change that line to (remember if you placed the fn_selfActions.sqf inside a different folder then Scripts change the call)

fnc_usec_selfActions = compile preprocessFileLineNumbers "Scripts\fn_selfActions.sqf";

No custom compiles?

Open your dayz_code.pbo and you will find it inside the init folder. Place the compiles.sqf inside your MPmissions/Scripts folder. (Or what ever folder you want)

 

Now open your init.sqf inside your Mpmission and find

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

change that to (remember if you placed the compiles.sqf inside a different folder then Scripts change the call)

call compile preprocessFileLineNumbers "Scripts\compiles.sqf";

 

Next you need to allow players to maintain by

1) Database event that places damage on objects.

This will only let them maintain object that are X amount of days old. Change the INTERVAL 3 DAY to how ever many days the object has to be to receive the damage so it can be maintained.

DROP EVENT IF EXISTS setDamageOnAge;
CREATE EVENT setDamageOnAge
   ON SCHEDULE EVERY 1 DAY
   COMMENT 'This sets damage on a wall so that it can be maintained'
   DO
     UPDATE `Object_DATA` SET `Damage`=0.1 WHERE `ObjectUID` <> 0 AND `CharacterID` <> 0 AND `Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 3 DAY) AND ( (`Inventory` IS NULL) OR (`Inventory` = '[]') )
; 

OR

2) Allow them to maintain the objects at full health. (This will let them maintain anytime they want)

Open your MPmissions/init.sqf and add

DZE_DamageBeforeMaint = 0;

right with the other    DZE_    (config settings)

 

Now change your decay to a positive number

CleanupPlacedAfterDays = 20

Change to how many days a placed empty object has to be to get deleted. The number is in days.

 

End result is if players are active and maintain there base it WILL NOT be deleted. No more bases being deleted randomly.

Link to comment
Share on other sites

  • 0

Never had issues with -1

 

why not then simply set it to 9999?

Some do and some don't.

 

For those that have that problem the reason to not set it to 9999 is the server code will ignore the CleanupPlacedAfterDays setting and if bases are too old they get deleted.

 

Simple answer is CleanupPlacedAfterDays is buggy and if your players are not maintaining there base to update the timestamp it will be deleted.

 

Also if you have every base stay on your server forever it will end up lagging very bad. This comes into play more for those that have high pop servers.

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...