Item functions failing in OnAdd

Post » Mon Jul 28, 2014 12:15 pm

I've been trying to fix what seems to be a bug in Powered Power Armor. It adds a token to dead NPCs in the current cell which, in its OnAdd block, replaces the equipped armor with a different armor. The problem is that while the new armor is properly added and equipped, the old armor is not being removed. RemoveItem, GetItemCount, etc. are all acting like they're functioning properly, even reporting that the item count and total inventory count are decrementing, but the item is not being removed. I've had some success in using a second token to attempt the RemoveItem again after some number of frames, but that only works sometimes.

ELSEif listgetformindex PPAT45dWhole rArmor > -1    rContainer.removeitem rArmor 1    rContainer.additem PPATokenDeconstructionDelay 1    set sArmorIndex to listgetformindex PPAT45dWhole rArmor    IF sDeconstruct == 2 || PPAMechanic == 0        set rArmor to listgetnthform PPAT45dHusk sArmorIndex        rContainer.additem rArmor 1        rContainer.equipitem rArmor  ; no unequip flag set, shell is non-recoverable    ELSE        set rArmor to listgetnthform PPAT45dShell sArmorIndex        rContainer.additemhealthpercent rArmor 1 fArmorCondition        rContainer.equipitem rArmor    ENDif

Does anyone know what's going on here? Is there some known problem with these functions?

Thanks
User avatar
Pete Schmitzer
 
Posts: 3387
Joined: Fri Sep 14, 2007 8:20 am

Return to Fallout 3