[Bug] FormList functions seem to break under certain conditi

Post » Wed Jun 20, 2012 11:39 pm

I have reason to believe that certain Formlist functions break formlist functionality after performing certain operations.

I have 8 empty Formlists, which are populated at runtime, using this function. This same function is used for "reset everything to default" as well, hence the Revert() calls which may be unnecessary during the first run-through.

Warning: It's long, and populates 278 forms split across 8 formlists.

Spoiler

function WEAREnabled()	notification("W.E.A.R. is being configured, please wait...")		_DE_Armor_Body_Full.Revert()		;Armor Full	_DE_Armor_Body_Full.AddForm(ArmorBanditCuirass)	_DE_Armor_Body_Full.AddForm(ArmorOrcishCuirass)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHeavyArmor03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHeavyArmor04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHeavyArmor05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassAlteration03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassConjuration03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassDestruction03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHealth03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassIllusion03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassRestoration03)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassAlteration04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassConjuration04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassDestruction04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHealth04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassIllusion04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassRestoration04)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassAlteration05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassConjuration05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassDestruction05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassHealth05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassIllusion05)	_DE_Armor_Body_Full.AddForm(EnchArmorOrcishCuirassRestoration05)	messagebox("The Full Armor formlist contains " + _DE_Armor_Body_Full.GetSize() + " of 23 expected records.")  	_DE_Armor_Body_Limited.Revert()	;Armor Limited	_DE_Armor_Body_Limited.AddForm(ArmorHideCuirass)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassAlteration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassConjuration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassDestruction01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassHealth01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassIllusion01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassRestoration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassAlteration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassConjuration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassDestruction02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassHealth02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassIllusion02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassRestoration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassAlteration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassConjuration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassDestruction03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassHealth03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassIllusion03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassRestoration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassLightArmor01)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassLightArmor02)	_DE_Armor_Body_Limited.AddForm(EnchArmorHideCuirassLightArmor03)	_DE_Armor_Body_Limited.AddForm(ArmorBanditCuirass2)	_DE_Armor_Body_Limited.AddForm(ArmorBanditCuirass1)	_DE_Armor_Body_Limited.AddForm(ArmorIronCuirass)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronArmorAlteration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassAlteration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassDestruction01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHealth01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassIllusion01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassRestoration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassAlteration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassConjuration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassConjuration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassDestruction02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHealth02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassIllusion02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassRestoration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassAlteration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassConjuration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassDestruction03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHealth03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassIllusion03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassRestoration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHeavyArmor01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHeavyArmor02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronCuirassHeavyArmor03)	_DE_Armor_Body_Limited.AddForm(ArmorStuddedCuirass)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassHealth01)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassHealth02)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassHealth03)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassLightArmor01)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassLightArmor02)	_DE_Armor_Body_Limited.AddForm(EnchArmorStuddedCuirassLightArmor03)	_DE_Armor_Body_Limited.AddForm(ArmorIronBandedCuirass)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassAlteration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassConjuration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassDestruction01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHealth01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassIllusion01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassAlteration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassConjuration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassDestruction02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHealth02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassIllusion02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassAlteration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassConjuration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassDestruction03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHealth03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassIllusion03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassRestoration01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassRestoration02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassRestoration03)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHeavyArmor01)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHeavyArmor02)	_DE_Armor_Body_Limited.AddForm(EnchArmorIronBandedCuirassHeavyArmor03)		messagebox("The Limited Armor formlist contains " + _DE_Armor_Body_Limited.GetSize() + " of 76 expected records.")		_DE_Armor_Feet_Full.Revert()	;Feet Full	_DE_Armor_Feet_Full.AddForm(ArmorStormcloakBoots)	_DE_Armor_Feet_Full.AddForm(ArmorBanditBoots)	_DE_Armor_Feet_Full.AddForm(ClothesJarlShoes)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsStamina03)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsStamina04)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsStamina05)	_DE_Armor_Feet_Full.AddForm(ArmorOrcishBoots)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsCarry03)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsCarry04)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsCarry05)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFire03)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFrost03)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistShock03)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFire04)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFrost04)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistShock04)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFire05)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistFrost05)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsResistShock05)	_DE_Armor_Feet_Full.AddForm(EnchArmorOrcishBootsMuffle)	messagebox("The Feet Full formlist contains " + _DE_Armor_Feet_Full.GetSize() + " of 20 expected records.")  	_DE_Armor_Feet_Limited.Revert()	;Feet Limited	_DE_Armor_Feet_Limited.AddForm(ArmorHideBoots)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFire01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFrost01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistShock01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFire02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFrost02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistShock02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFire03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistFrost03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsResistShock03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsCarry01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsCarry02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsCarry03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsSneak01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsStamina01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsSneak02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsStamina02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsSneak03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorHideBootsStamina03)	_DE_Armor_Feet_Limited.AddForm(ArmorIronBoots)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsCarry01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsCarry02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsCarry03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFire01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFrost01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistShock01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFire02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFrost02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistShock02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFire03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistFrost03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsResistShock03)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsStamina01)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsStamina02)	_DE_Armor_Feet_Limited.AddForm(EnchArmorIronBootsStamina03)		messagebox("The Feet Limited formlist contains " + _DE_Armor_Feet_Limited.GetSize() + " of 35 expected records.")  	_DE_Armor_Hands_Full.Revert()	;Hands Full	_DE_Armor_Hands_Full.AddForm(ArmorBanditGauntlets)	_DE_Armor_Hands_Full.AddForm(ArmorOrcishGauntlets)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsAlchemy03)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsAlchemy04)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsAlchemy05)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsMarksman03)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsMarksman04)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsMarksman05)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsOneHanded03)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsOneHanded04)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsOneHanded05)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsSmithing03)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsSmithing04)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsSmithing05)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsTwoHanded03)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsTwoHanded04)	_DE_Armor_Hands_Full.AddForm(EnchArmorOrcishGauntletsTwoHanded05)	_DE_Armor_Hands_Full.AddForm(ArmorStormcloakGauntlets)		messagebox("The Hands Full formlist contains " + _DE_Armor_Hands_Full.GetSize() + " of 18 expected records.")  	_DE_Armor_Hands_Limited.Revert()	;Hands Limited	_DE_Armor_Hands_Limited.AddForm(ArmorHideGauntlets)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsAlchemy01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsAlchemy02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsAlchemy03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsPickpocket01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsPickpocket02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsPickpocket03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsLockpicking01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsLockpicking02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsLockpicking03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsOneHanded01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsOneHanded02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsOneHanded03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsTwoHanded01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsTwoHanded02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsTwoHanded03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsMarksman01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsMarksman02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsMarksman03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsSmithing01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsSmithing02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorHideGauntletsSmithing03)	_DE_Armor_Hands_Limited.AddForm(ArmorIronGauntlets)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsAlchemy01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsAlchemy02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsAlchemy03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsOneHanded01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsOneHanded02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsOneHanded03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsTwoHanded01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsTwoHanded02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsTwoHanded03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsMarksman01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsMarksman02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsMarksman03)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsSmithing01)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsSmithing02)	_DE_Armor_Hands_Limited.AddForm(EnchArmorIronGauntletsSmithing03)		messagebox("The Hands Limited formlist contains " + _DE_Armor_Hands_Limited.GetSize() + " of 38 expected records.")  	_DE_Armor_Head_Full.Revert()	;Head Full	_DE_Armor_Head_Full.AddForm(ArmorBanditHelmet)	_DE_Armor_Head_Full.AddForm(ArmorOrcishHelmet)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlchemy03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlchemy04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlchemy05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlteration03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlteration04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetAlteration05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMarksman03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMarksman04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMarksman05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetConjuration03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetConjuration04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetConjuration05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetIllusion03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetIllusion04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetIllusion05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMagicka03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMagicka04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetMagicka05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetRestoration03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetRestoration04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetRestoration05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetDestruction03)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetDestruction04)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetDestruction05)	_DE_Armor_Head_Full.AddForm(EnchArmorOrcishHelmetWaterbreathing)		messagebox("The Head Full formlist contains " + _DE_Armor_Head_Full.GetSize() + " of 27 expected records.")  	_DE_Armor_Head_Limited.Revert()	;Head Limited	_DE_Armor_Head_Limited.AddForm(ArmorHideHelmet)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlchemy01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlchemy02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlchemy03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlteration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlteration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetAlteration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMarksman01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMarksman02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMarksman03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetConjuration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetConjuration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetConjuration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetIllusion01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetIllusion02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetIllusion03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMagicka01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMagicka02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetMagicka03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetRestoration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetRestoration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetRestoration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetDestruction01)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetDestruction02)	_DE_Armor_Head_Limited.AddForm(EnchArmorHideHelmetDestruction03)	_DE_Armor_Head_Limited.AddForm(ArmorIronHelmet)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlchemy01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlchemy02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlchemy03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlteration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlteration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetAlteration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMarksman01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMarksman02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMarksman03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetConjuration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetConjuration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetConjuration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetIllusion01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetIllusion02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetIllusion03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMagicka01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMagicka02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetMagicka03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetRestoration01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetRestoration02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetRestoration03)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetDestruction01)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetDestruction02)	_DE_Armor_Head_Limited.AddForm(EnchArmorIronHelmetDestruction03)		messagebox("The Head Limited formlist contains " + _DE_Armor_Head_Limited.GetSize() + " of 50 expected records.")		Game.GetPlayer().UnequipAll()	_DE_Backpack_Menu2_Setup_Optionshardcoe_BEAREnabledConfirm.Show()	endFunction

This works correctly on the first run-through, and everything is pretty normal.

During play, the player can decide to move a form from one formlist to another, or remove it entirely. In this example, the player wants to move ArmorBanditBoots from _DE_Armor_Feet_Full to _DE_Armor_Feet_Limited. So the following bit of code runs (some code removed for readability):

Spoiler

event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)	 int ibutton = _DE_WEARSelectMenu1.Show()	 if ibutton == 0		  if akBaseObject.HasKeyword(ArmorBoots) || akBaseObject.HasKeyword(ClothingFeet)			   if !_DE_Armor_Feet_Limited.HasForm(akBaseObject)					_DE_Armor_Feet_Limited.AddForm(akBaseObject)			   endif			   if _DE_Armor_Feet_Full.HasForm(akBaseObject)					_DE_Armor_Feet_Full.RemoveAddedForm(akBaseObject)			   endif		  endif	 elseif ibutton == 1		  ;code for other buttons	 endifendEvent

At this time, the form ArmorBanditBoots is successfully moved from _DE_Armor_Feet_Full to _DE_Armor_Feet_Limited. A HasForm() call on this Formlist specifying ArmorBanditBoots returns true.

Here's where the problem starts. If I call WEAREnabled() again, and Revert() the Formlists and attempt to repopulate them, they all revert and repopulate successfully except for _DE_Armor_Feet_Limited. When I call GetSize() on this Formlist, the return is -1. According to http://www.creationkit.com/GetSize_-_FormList, -1 is not a valid return from this function! Additionally, calling _DE_Armor_Feet_Limited.HasForm(ArmorBanditBoots) now returns false!

Has anyone else seen behavior like this before? Am I missing something? Or are Formlists actually breaking at runtime when performing this combination of actions?

Thanks for reading. I have since moved what I was trying to do http://www.gamesas.com/topic/1365378-exampleresourcegeneral-purpose-array-functions/. so it's not imperitive that I get this working.

Edit: Also wanted to mention that this problem is not exclusive to _DE_Armor_Feet_Limited. I watched this behavior occur on any Formlist where I used AddForm to add a form to it, and then attempted to Revert it. GetSize from then on will return -1 on that formlist, and attempting to access the FormList's contents (if it even has any) will fail.
User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Wed Jun 20, 2012 1:58 pm

Having the same issues with revert and removeaddedform

http://www.gamesas.com/topic/1355412-help-removeaddedform-bugged-fails-after-first-use-data-corruption-ensues/page__p__20437854__hl__removeaddedform__fromsearch__1#entry20437854
User avatar
Lucky Boy
 
Posts: 3378
Joined: Wed Jun 06, 2007 6:26 pm


Return to V - Skyrim