vicyntae Posted October 13, 2018 Share Posted October 13, 2018 I have no idea what happened, but for some reason, a part of my mod, an actor scanner, stopped working for me. I managed to pinpoint the error down to the line, and the issue is that GetReference(), along with GetActorReference(), stopped working, It's not that they are not returning what's there, they aren't returning at all, leaving my scripts stuck. Has any one else had this issue? I've tried deleting my skyrim installation and reinstalling SKSE, but that didn't help. Here's the function that's not working: Form[] Function getActors()Notice("Getting current actor list...")Int iInt NumAlias = SCX_MonitorManagerQuest.GetNumAliases()Note("NumAliases = " + NumAlias)Int kForm[] ReturnArray = Utility.CreateFormArray(NumAlias, None)While i < NumAliasReferenceAlias LoadedAlias = SCX_MonitorManagerQuest.GetNthAlias(i) as ReferenceAliasNote("Found alias " + i + ": " + LoadedAlias as bool)Actor Target = LoadedAlias.GetReference() as Actor This line isn't returning.If TargetNotice("Loaded actor " + i + " = " + nameGet(Target))ReturnArray = Targetk += 1ElseNote("Alias " + i + " empty...")EndIfi += 1EndWhileNote("Num actors found: " + k)Return ReturnArrayEndFunction Link to comment Share on other sites More sharing options...
foamyesque Posted October 13, 2018 Share Posted October 13, 2018 Are you sure it isn't returning at all, and have you checked the debug logs? Link to comment Share on other sites More sharing options...
vicyntae Posted October 13, 2018 Author Share Posted October 13, 2018 (edited) Are you sure it isn't returning at all, and have you checked the debug logs?Debug logs show nothing from my scripts nor from the game in regards to GetReference, and when I delete the actual function call, the script continues normally. I've waited several minutes for the script to show the next message, but it doesn't. EDIT: I also checked to see if the OnInit block was completing on the manager quest, and it finished before anything was called to it. Edited October 14, 2018 by vicyntae Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 14, 2018 Share Posted October 14, 2018 The line before it looks wrong. Change: ReferenceAlias LoadedAlias = SCX_MonitorManagerQuest.GetNthAlias(i) as ReferenceAlias To: ReferenceAlias LoadedAlias = (SCX_MonitorManagerQuest.GetNthAlias(i) as Alias) as ReferenceAlias See if it works or not. Link to comment Share on other sites More sharing options...
foamyesque Posted October 14, 2018 Share Posted October 14, 2018 Are you sure it isn't returning at all, and have you checked the debug logs?Debug logs show nothing from my scripts nor from the game in regards to GetReference, and when I delete the actual function call, the script continues normally. I've waited several minutes for the script to show the next message, but it doesn't. EDIT: I also checked to see if the OnInit block was completing on the manager quest, and it finished before anything was called to it. What does the Note function do, and does it work elsewhere? Have you tried Debug.Trace statements to check the script's state? Do you or any of the scripts in the inheritance chain override GetReference()? Link to comment Share on other sites More sharing options...
vicyntae Posted October 14, 2018 Author Share Posted October 14, 2018 Ugh, found it. I replaced the oninit block on the alias itself inself instead of the quest, and it started working. Now to find out why the oninit block wasn't working. Thanks for your help guys. Link to comment Share on other sites More sharing options...
foamyesque Posted October 14, 2018 Share Posted October 14, 2018 Ugh, found it. I replaced the oninit block on the alias itself inself instead of the quest, and it started working. Now to find out why the oninit block wasn't working. Thanks for your help guys. OnInit blocks will delay execution of any functions called on that script object that are not, themselves, in an OnInit block. If you had some kind of infinite loop processing on the alias's OnInit, it might do it? Link to comment Share on other sites More sharing options...
Recommended Posts