Jump to content

How to check for an invalid (Form <None>) form in an array?


Recommended Posts

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

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

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 by PJMail
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...