Skip to content

Weapon Properties Being Lost -- Persistent Server

InquisitorInquisitor Member Posts: 3
edited February 23 in Builders - Scripting
Quite despite myself, I've become caretaker for a persistent server. For the last six months, it's had a particular bug that I am at a complete loss to explain. Specifically, items that can be held in the mainhand or offhand slot are, at seemingly random, losing their permanent properties.

Here's what I know:

* It can occur to items whether they are currently being held or not. Weapons have lost properties while being used, but unused weapons in inventory have lost also properties.
* It doesn't only affect weapons. It primarily affects weapons, but it has also happened to magic staves, and we have one report of it affecting a shield.
* It only removes permanent properties. Temporary properties remain after the permanent properties are lost (e.g. greater magic weapon, darkfire).
* It can occur even when a player is completely idle. Characters have lost properties while completely afk before. I've handed a player a replacement weapon, and literally seen it lose properties between examinations in less than a minute.
* It does not affect every item. Players with a dozen weapons in inventory will have only one weapon lose properties at a time -- it's not wiping everything for everyone. It also doesn't affect every player.
* It occurs sporadically. There have been two or three day periods where no one has reported an item loss, followed by a single day where we have five players report losses. Sometimes a single player will lose 3-4 items in a few hours of playtime.
* We have had one report of a player's item regaining properties days after it had lost them, something that occurred after multiple resets (we reset daily). So far, I've seen no confirmed reports of that happening again (although it's possible they're just discarding the items), and I'm not even sure if it happened, but it was reported and there's no reason to think the player in question was wrong about what happened.

Other potentially relevant information:

* The server in question is running the PRC, which adds numerous classes, races, and abilities to the game. It is possible that the script responsible is somewhere in the PRC, but other PRC servers aren't having the problem, and the server had run without any issue for literal years until recently.
* The bug corresponds with a bunch of changes we made all at once, which makes hunting it down hard. We moved to a new dedicated server, running linux native, shortly before the bug started appearing. We also reorganized our haks, updated the PRC, and updated NWNX:EE.

I've run out of ideas. I've looked into the haks, searched our databases, and people have helped me examine scripts looking for anything that might be responsible. At this point, I'm desperate for any ideas about what could possibly be responsible. Replacing items has become a part time job and an incredible strain on our volunteer staff and our players and is unfair to everyone.

Comments

  • MelkiorMelkior Member Posts: 252
    This might be related. The TL;DR version is that perhaps the scripting is re-using object pointers when it shouldn't?

    I had a strange problem where an invisible placeable was being used to trigger the random appearance (on heartbeat) of a usable placeable (which could be used by a PC to "pick up" an item, destroying the placeable in the process).

    In order to prevent the invisible placeable from spawning multiple copies of the usable placeable, the object pointer was put onto the invisible placeable as a local variable so it could track whether or not the spawned placeable still existed. But I found that sometimes, the invisible placeable simply wouldn't respawn the visible placeable after it was destroyed, no matter how long I waited.

    I eventually realised that what was happening was that another invisible placeable was creating a new object which then received the same object pointer as the previously destroyed object, so the invisible placeable couldn't detect that the placeable which it had spawned had been destroyed. I got around that by putting the object pointer for the invisible object on the created placeable, so the creator placeable could keep track of whether or not it was the spawner for that object.

    *** The Important Point ***
    My first guess would be that you have a delayed command which is supposed to remove a "permanent" effect from an item, but by the time the delay expires, the original object no longer exists and a completely different object is now using the same object pointer, so by the time the delay expires, the pointer is pointing at the wrong item.

    I use a "permanent" effect as a functionally temporary effect in a set of scripts which allow a bard to equip a small or large shield without suffering arcane spell failure. The "permanent" reversal of the shield's arcane spell failure is removed on-unequip to prevent other classes from exploiting the effect.

    I hope this helps you with your problem.
  • InquisitorInquisitor Member Posts: 3
    Melkior wrote: »
    This might be related. The TL;DR version is that perhaps the scripting is re-using object pointers when it shouldn't?

    I had a strange problem where an invisible placeable was being used to trigger the random appearance (on heartbeat) of a usable placeable (which could be used by a PC to "pick up" an item, destroying the placeable in the process).

    In order to prevent the invisible placeable from spawning multiple copies of the usable placeable, the object pointer was put onto the invisible placeable as a local variable so it could track whether or not the spawned placeable still existed. But I found that sometimes, the invisible placeable simply wouldn't respawn the visible placeable after it was destroyed, no matter how long I waited.

    I eventually realised that what was happening was that another invisible placeable was creating a new object which then received the same object pointer as the previously destroyed object, so the invisible placeable couldn't detect that the placeable which it had spawned had been destroyed. I got around that by putting the object pointer for the invisible object on the created placeable, so the creator placeable could keep track of whether or not it was the spawner for that object.

    *** The Important Point ***
    My first guess would be that you have a delayed command which is supposed to remove a "permanent" effect from an item, but by the time the delay expires, the original object no longer exists and a completely different object is now using the same object pointer, so by the time the delay expires, the pointer is pointing at the wrong item.

    I use a "permanent" effect as a functionally temporary effect in a set of scripts which allow a bard to equip a small or large shield without suffering arcane spell failure. The "permanent" reversal of the shield's arcane spell failure is removed on-unequip to prevent other classes from exploiting the effect.

    I hope this helps you with your problem.

    If this is what's happening, what do I need to do to figure out which script is the problem child?
  • InquisitorInquisitor Member Posts: 3
    Melkior wrote: »
    This might be related. The TL;DR version is that perhaps the scripting is re-using object pointers when it shouldn't?

    I had a strange problem where an invisible placeable was being used to trigger the random appearance (on heartbeat) of a usable placeable (which could be used by a PC to "pick up" an item, destroying the placeable in the process).

    In order to prevent the invisible placeable from spawning multiple copies of the usable placeable, the object pointer was put onto the invisible placeable as a local variable so it could track whether or not the spawned placeable still existed. But I found that sometimes, the invisible placeable simply wouldn't respawn the visible placeable after it was destroyed, no matter how long I waited.

    I eventually realised that what was happening was that another invisible placeable was creating a new object which then received the same object pointer as the previously destroyed object, so the invisible placeable couldn't detect that the placeable which it had spawned had been destroyed. I got around that by putting the object pointer for the invisible object on the created placeable, so the creator placeable could keep track of whether or not it was the spawner for that object.

    *** The Important Point ***
    My first guess would be that you have a delayed command which is supposed to remove a "permanent" effect from an item, but by the time the delay expires, the original object no longer exists and a completely different object is now using the same object pointer, so by the time the delay expires, the pointer is pointing at the wrong item.

    I use a "permanent" effect as a functionally temporary effect in a set of scripts which allow a bard to equip a small or large shield without suffering arcane spell failure. The "permanent" reversal of the shield's arcane spell failure is removed on-unequip to prevent other classes from exploiting the effect.

    I hope this helps you with your problem.

    ... quite independent of my asking, one of my players (who has been going over the scripts with a fine toothed comb for weeks) finally found what we think is the problem script, and it is *exactly* what you describe here. Thank you so much!
  • MelkiorMelkior Member Posts: 252
    That's a toughie. If you don't know much scripting, you might need someone who knows scripting well to help you, in person.

    I can give you a few clues about what to look for and where to look, but nothing definite. You'll need some scripting expertise to figure it out yourself.

    The most likely place to look is in on-equip and on-unequip, and look through any non-standard scripting which is being called from either or both of those, just in case the effects are being applied there.

    A very troublesome possibility is if it turns out to be an effect which has been added to customise an existing spell.

    Then again, it could be a result of something similar to what I was doing.

    But unfortunately, I can't diagnose the problem remotely, and I doubt anyone could. Someone would need to be there and look through the scripts to find out what they're doing and figure out where they're doing it wrong.

    And worst of all, I could be completely on the wrong track and the problem could be caused by something completely different.
Sign In or Register to comment.