PJMail Posted May 4, 2022 Share Posted May 4, 2022 I have an array for an NPC's inventory (Form[] InvItems).If one of the pieces recorded in it is invalidated (because the mod it is defined in is removed) that element returns a value of "Form <None>".This does NOT == None. How can I test for it so I don't get errors when trying to use it? Formlists seem to work with element == None, but not elements in arrays (in a Script) it seems. Thanks Link to comment Share on other sites More sharing options...
DlinnyLag Posted May 4, 2022 Share Posted May 4, 2022 What will be the result of Form testing = InvItems[i] as Formin case of invalid Form? Link to comment Share on other sites More sharing options...
PJMail Posted May 5, 2022 Author Share Posted May 5, 2022 Thats what I already do. I am testing against "testing", not "InvItems". I have tried "Game.getform(0x0)" and "Form[] inv=new form[1]" (and compared to inv[0]). All just display and compare as "None" rather than "Form <None>" Link to comment Share on other sites More sharing options...
PJMail Posted May 5, 2022 Author Share Posted May 5, 2022 (edited) My only option at this point is the "!(testing is Weapon)" etc for every valid form type I expect. I am doing an "equipItem" so apart from Weapon and Armor, are there any other form types you can 'equip'? Update: Looks like only those 2... Edited May 5, 2022 by PJMail Link to comment Share on other sites More sharing options...
DlinnyLag Posted May 5, 2022 Share Posted May 5, 2022 I'm wondering is GetFormID returns non-zero value for such invalid forms? Link to comment Share on other sites More sharing options...
LarannKiar Posted May 6, 2022 Share Posted May 6, 2022 My only option at this point is the "!(testing is Weapon)" etc for every valid form type I expect. I am doing an "equipItem" so apart from Weapon and Armor, are there any other form types you can 'equip'? Update: Looks like only those 2... Potions are consumed by equipping. Link to comment Share on other sites More sharing options...
PJMail Posted May 7, 2022 Author Share Posted May 7, 2022 True, but then they are gone (they don't stay equipped). This was for my Mannequin mod so I was only re-equipping weapon and Armor. Link to comment Share on other sites More sharing options...
Recommended Posts