Clear as mud! lol Thanks. I do understand. Just keep them in the same script, otherwise the values will be incorrect (corrupted) depending on the last call to these functions.GetFirstRef and GetNextRef are designed to be used together within a single run of a single script.
GetFirstRef is what resets the search. Whenever you use it, you will start over, no matter what you have done before.
GetNextRef, of course, keeps returning the next reference until (1) there is no more references of that type to return or (2) you reset the process by using GetFirstRef again.
If you use them in different scripts (GetFirstRef in one script and GetNextRef on another) or in different frames (GetFirstRef in one frame and GetNextRef in the next) the results are unpredictable, as many other scripts from many other mods may have used them in between.
Hope this helps understanding them.
Now I need to figure out how to pull the data off the array via index (manually walking the index) and use a tempref.moveto player (and other tricks.)
Any advice? I have a variable sized array and the index counter is captured (during the filling of the array) just for this purpose.
Almost got it working. Thanks for all the help!



Sign In
Create Account

Back to top









