Item decay control script?

Discussion about the development of POL's official distribution scripts.

Moderators: POL Developer, Distro Developer

Post Reply
User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Item decay control script?

Post by Ciechu » Mon Nov 19, 2018 8:52 am

Hi!

I'm looking for all scripts that control items left in game world - exactly decay control.

Where should I look for it in official distro scripts?

I'm using Pol100 Core.

Thank you, Love Ciechu.
"Live Fast, Die Fast"
- GG Allin

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Item decay control script?

Post by Yukiko » Mon Nov 19, 2018 1:11 pm

Item decay is handled by the Core. It is more efficient than having eScript programmes scan through all of the facets (realms) for items. But you have some control over it with settings in /config/servespecopt.cfg and in programmes (scripts) by setting the DecayTime and DecaysOnMultis members on an item.

From servspecopt.cfg:

Code: Select all

#
# DecayItems - Determines if the decay system is enabled or not.
# Default is 1
#
DecayItems=1

#
# DefaultDecayTime - minimum number of minutes before movable items decay (are destroyed)
# Default is 10
#
DefaultDecayTime=10
From the POL Documentation one of the links at the bottom of that page is to the configuration files.

From the itemdesc.cfg documentation:

Code: Select all

DecayTime              (int minutes {default servspecopt.cfg option})

DecaysOnMultis         (0/1 {default 0})
Items normally decay at the default time set in servspecopt.cfg but you can override that time by setting the DecayTime member. Items do not decay on multis such as boats and multi houses but again you can override that by setting the DecaysOnMultis member to 1.

I hope that helps.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: Item decay control script?

Post by ThisIsMe » Mon Nov 19, 2018 11:19 pm

You also have additional control of the decay system and specifically preventing items from decaying.

With the CanDecay syshook, you can use a myriad of conditions from preventing an item from decaying when the trash collection rolls around. This is handy if for instance you want to have a static housing system and want it to simulate very closely to the multis system, thus making your static package feel a bit more like it is something part of the game and not something slapped on top of it as a simple example.

I would however suggest, if you go this route, be very sure about how you use it as you do not want to have a ton of items that are not able to decay with the standard trash collection. Also I believe you also will want to limit the complexity of code used in the syshook as I recall syshooks are run critical and doing anything that is too complex could lead to unforeseen consequences.

User avatar
Ciechu
New User
Posts: 23
Joined: Mon Oct 15, 2018 5:36 am
Location: Poland
Contact:

Re: Item decay control script?

Post by Ciechu » Tue Nov 20, 2018 4:17 am

Your answers are very helpful. I will make my script for handle decay items, but first I will block this in config files.

Thank you very much.

My question was from this, that I think there are some control scripts in distro for that.
"Live Fast, Die Fast"
- GG Allin

Yukiko
Distro Developer
Posts: 2525
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Item decay control script?

Post by Yukiko » Tue Nov 20, 2018 9:24 am

I am happy to help.
It would be nice if decay was performed by the scripts. The problem is that searching the entire map of each facet using eScript programmes (scripts) is slower than the Core doing it. With the sys hook that ThisIsMe mentioned you have a little more control over the decay system. You might look into using that. The Core still does the decay sweep but the sys hook gives you more flexibility.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

Post Reply