Jump to content

Array Add() function not working


Recommended Posts

Glad to hear it's working. Now that I'm home it's easier to type.

 

The issue you probably were running in to is that the OnInit wasn't firing because you were loading a save that already had a spawned object containing the script. It would be worth reading the wiki page for OnInit https://www.creationkit.com/fallout4/index.php?title=OnInit_-_ScriptObject specifically the circumstances of when it is called. I just realized I have a few scripts on a mod to go update now.

 

Something else to be aware of. If the player was to leave the cell which causes the 3D to unload for the actors, your resetactors function may fail. Also the OnLoad having the 3 resets is redundant. The cell reset alone should do it. Unless the cell is in an encounter zone that is marked as no reset. Then the script will fail and halt. Calling self.Reset() and just Reset() is the same thing. Not including Self makes it implied vs explicit.

 

Another thing that's more of a nit picky thing. There's really no point in registering for Player OnDeath and then checking for != Player in the event. If the player triggers it, the game will force a reload before anything else would fire up anyway and the whole crap resets to the save. So it's pretty pointless.

 

Thanks for the feedback on the code! I went through your points and made a load of changes :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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