Jump to content

Need help figuring out "GetFormFromFile" problems


HappySlapp

Recommended Posts

Hello, I need help with this particular function, I'm a fairly seasoned modder, but have never used this one before, I figured it wouldn't be too hard, but it's throwing all kinds of errors my way, is it my implementation?

 

The Code:

 

  Reveal hidden contents

 

 

My Papyrus Log:

 

  Reveal hidden contents

 

 

This particular line:

[09/29/2023 - 01:18:18PM] [Requiem:Main <RequiemMain (09034C65)>]: 151211165

Happens every time I try and print the FormID of any formlist attached to AmmoType.AmmoList, I'm out of ideas honestly, but maybe it's something simple I'm just not seeing.

Edited by HappySlapp
Link to comment
Share on other sites

You have to initialize array and initialize each element in array before accessing element's fields.

 

something like:

 

AmmoTypes = new AmmoType[54]

AmmoTypes[0] = new AmmoType

AmmoTypes[0].AmmoList = ....

 

AmmoTypes[1] = new AmmoType

AmmoTypes[1].AmmoList = ....

 

and so on

Edited by DlinnyLag
Link to comment
Share on other sites

  • Recently Browsing   0 members

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