Jump to content
  • 0

Base Decay .... I know, I'm sorry .....


ElDubya

Question

Hi all, 

 

Yes, another bloody question about base decay, I apologise. I honestly don't understand how it works.

 

I have this in my init.sqf

DZE_DamageBeforeMaint = 0.03;
DZE_maintainRange = ((DZE_PlotPole select 0)+20);

This in my variables.sqf

DZE_maintainClasses = ["DZE_LockedStorage","ModularItems","Fortifications","DZE_Housebase","LightPole_DZ","BuiltItems","Plastic_Pole_EP1_DZ","Fence_corrugated_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","StickFence_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","DeerStand_DZ","Scaffolding_DZ","FireBarrel_DZ"];

This in my hiveext.ini

CleanupPlacedAfterDays = 30

And this in my SQL DB

EVENT `setDamageOnAge` ON SCHEDULE EVERY 1 DAY STARTS '2014-11-19 06:37:29' ON COMPLETION NOT PRESERVE ENABLE 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` = '[]') )

My understanding of all that up there is that every 3 days, objects in the area to be maintained sustain 10% damage per item. After 3 days, players are able to scroll and maintain their base. So essentially, without maintaining, their base will be 100% damaged and deleted after 30 days? 

 

How exactly does base decay work? Does it delete the whole lot in one foul swoop after a restart once 100% damage has been reached, or does it delete a wall/floor/ceiling at a time until it's all gone? Do items delete once they have achieved a certain damage level or does the damage have to be at 100% before it deletes? 

 

Thanks for any and all replies :)

 

 

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Hey, your base will not be destroyed after 3days cause of the event afaik. cause it says SET `Damage`=0.1 wich would just update the Damage to 0.1 so if the damage is 0.576 it will be set to 0.1 after three days that is just what i belive cause i never saw any building part that has over 0.1 damage in my DB

Link to comment
Share on other sites

  • 0

Ok, now I am REALLY confused. This is the code that people have been told to use?

 

 

Information taken from here ^^^.

-- ----------------------------
-- Event structure for setDamageOnAge
-- ----------------------------
DROP EVENT IF EXISTS `setDamageOnAge`;
DELIMITER ;;
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` = '[]') )
;;
DELIMITER ;

Now, here's the "magic" one.  What this does is looks for all objects in your database that are older than 3 days.  It then sets the damage on those objects to .1 (10%) so that it will trigger the "maintenance" code invoked by using the plot pole maintenance function.  As a side effect, by setting the damage on an object, it also updates the LastUpdated field for that object in the database, which prevents those objects from being deleted by other jobs.  That is why it's critical that this job is in place.

 

Am I not doing this right at all?

Link to comment
Share on other sites

  • 0

I don't know where this is from but with this: Damage`=0.1

...you add exactly 0.1 damage to the object. If you want to get old objects removed (with another event or query which deletes objects where damage = 1) you will need to add 0.1 each time you execute this.

So like Damage`= Damage + 0.1

 

For 3 days: this query takes into account that the object has not been 'touched' or changed for 3 days. The event itself will run every day once. And as I said above: damage will never get higher than 0.1 with this query.

Link to comment
Share on other sites

  • 0

CleanupPlacedAfterDays = 30  with that as long as you click maintain once every 30 days it wont disappear.

 

At one time i had an event in DB that just erased eveything aside from vaults (they reset to 0000) tied to a player once the player is inactive for 14 days. 

 

and used   CleanupPlacedAfterDays = -1 for no maintenance 

 

But unfortunately some how all of my events got erased and i cant find that one for the life of me. Ill take another look around and if i get my hands on it ill post it for you.

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