Page 1 of 1

Locked down items decay

Posted: Sat Jan 16, 2010 4:26 pm
by HumbleMeister
Hi, every time we lock something down in the house.. it decays and dissappears. scenario is creat a chest using the GM character. saying i wish to lock this down. then in a few minutes.. it dissappears. should the "lock down" command set the item decay to "no decay" (what ever the number is)? This is frustrating. I know you can use the "tweak" command to set the decay to not decay.. but only the GM can do this. other players are stuck without a soltion, or is there something I don't know about? Any help is appreciated. Sincerely, HumbleMeister

Posted: Sun Jan 24, 2010 1:44 pm
by Xuri
Note: I split this from a thread in the bug archive. Generally it's not a good idea to reply to topics in the bug archive, as they tend to be overlooked (I didn't see it until today, for instance) and in many cases it's easier to deal with a new thread than having to look through long threads with years-old posts. At least in those cases when the new bug differs slightly than the old, fixed one.

Easier then to make a new thread and instead reference the older posts if necessary through a link. Just saying :)

Anyway, about the bug:

I tried recreating your problem in-game myself, and thought I had found it when I locked down two items, tried to pick one of them back up again (so it would bounce back) and then saw that the item I had tried to pick up decayed. However, when I added some more items to the floor and locked those down too, some of them decayed even though I hadn't touched them afterwards.

Added yet some more items and locked those down - and none of them decayed for a long while. Until suddenly, out of the blue, ALL the items vanished. Including the door to my house :O

Not sure what's up, but there's definitely a bug there somewhere. :/

Edit: A work-around for this is to disable decay for items (changing ALL of the DECAY=1 tags in the item-DFNs from 1 to 0). Another option would be to increase the decay timer in UOX.INI to the max, which I believe is 65535... though this isn't more than 18 hours worth of seconds. :/

Posted: Sun Jan 24, 2010 2:45 pm
by Xuri
Another work-around:

Put the following in a .js file and set it up as a global script (by giving it script ID = 0 in jse_fileassociations.scp):

Code: Select all

function onCreateDFN( objMade, objType ) 
{ 
   if( objType == 0 ) 
      objMade.decayable = 0; 
} 

function onCreateTile( objMade, objType ) 
{ 
   if( objType == 0 ) 
      objMade.decayable = 0; 
}
This will set all new objects created to non-decayable. Not ideal, but at least the items should longer vanish on you. :/

Posted: Mon Jan 25, 2010 7:57 am
by Puck
This may sound like a stupid question, but "all new objects" as in ALL new objects?

Like... every item that entered the gameworld apart from corpses?

And just out of curiosity... is there a limit on how much crap you can have lying around? (apart from harddrive space :P )

Posted: Mon Jan 25, 2010 11:15 am
by Xuri
Yep, as in ALL new items. The "onCreateDFN" part of it takes care of items created from the DFN entries, while the "onCreateTile" part takes care of items created outside of the DFN entries, i.e. using only the hardcoded hex-id's and tiledata values and nothing more.

There's no known limitation :P But at a certain point you/your players will start to run into lag-issues and/or "black hole"-problems when logging in (i.e. you login to a black screen and the client refuses to continue because there's an overload of dynamic objects in the area).

Implement trash-bins, and/or garbage collecting NPCs that delete items they come in contact with ^^

Posted: Mon Jan 25, 2010 3:52 pm
by Puck
this is weird...

I'm pretty sure I added this properly. When I log in the admin account and look at stuff with .tweak, I see the "Decay" flags set as expected.

For testing I cranked down corpse and item decay timer to 3 in the uox.ini...

and it seems the corpses don't want to rot. at all. If I actually click the "decay" field and manually enter "1" (which was already displayed there), the according corpse decays just fine. Also, I lit a campfire, let it burn down and looked at the glowing leftovers with .tweak. It said decay=0. A few seconds later, the remains of the campfire were gone :lol:

Consider me confuzzled.

edit: ignoring the problems I just described... now if I removed the bottom half of the script, would that mean, that only player crafted items are set to decay=0? (Testing right now, and it seems that's what it does.)

Posted: Mon Jan 25, 2010 6:32 pm
by Xuri
Player-created, as well as GM-created through the 'ADD-menu. And some script-created. =P

UOX3 seldom adds the "raw items" by itself - though it does happen, for instance when a GM manually adds items to decorate a world using 'ADD 0x####, or in certain hardcoded situations.

Posted: Mon Jan 25, 2010 7:15 pm
by Puck
Like when animals die?

Because after I removed

Code: Select all

function onCreateTile( objMade, objType )
{
   if( objType == 0 )
      objMade.decayable = 0;
}
from the script, animals killed after that point decayed again

Posted: Mon Jan 25, 2010 7:57 pm
by Xuri
Yep!

Posted: Mon Jan 25, 2010 10:02 pm
by Puck
[snip]

Posted: Wed Jan 27, 2010 1:30 am
by Puck
I'm getting issues with that script, as described here:
viewtopic.php?p=10547#10547

Posted: Mon Feb 01, 2010 5:05 am
by Xuri
Just to add some more info here...

This bug seems to be caused by several different factors.
One of them is that if you attempt to pick up an item that is locked down, it will "bounce" back telling you that you can't do that - and in the process its multi-value will somehow be reset to 0!

The way UOX3's item-decay code is setup, no items inside a multi should ever decay, no matter if they are locked down or not. We can ask questions about this policy, but the fact of the matter is that it doesn't work.

There seems to be several ways in which items lose their multi-value, and when they do, they will decay.

The "findMulti" code also seems to not work correctly at all times, as it will sometime fail to locate the multi a player or item is located in (I've traced through the code and seen this happen, but not sure WHY it happens).

Posted: Mon Feb 01, 2010 5:20 am
by Xuri
More details.

Doors lose their multi-values every time you open them, but regain them every time you close them. This means that if a door should be open when the decay-timer for it runs out, it will actually decay. So - keep those doors closed, people!

Edit: This seems to be only valid for front-doors that get moved outside of the house's "boundary" when they are opened. So technically, UOX3 doesn't do anything "wrong" when it removes those doors - it just doesn't know any better ;P

Posted: Mon Feb 01, 2010 7:54 am
by Xuri
Fixed on CVS. Locked down items (and open doors) should no longer decay. There might still be an issue with items losing their attachment to the house, though - but at least they shouldn't decay!