chambcra Posted August 24, 2022 Share Posted August 24, 2022 Here's the two lines that produce the output: set TempRef to player.GetNthFollower CountPrintC "%.0f - %n - %i - %.0f - %.0f - %n - %i - %.0f" Count, TempRef, TempRef, Package, Procedure, Target, Target, FollowerOnboardStatus The player is cornelio not Farwil. I'm thinking this isn't a bug with obse but something goofy in this particular game. But, how to avoid it? If I do a double check to see if the npc's target is the player it won't work because sometimes the target is the player and sometimes is says <no name> for a legitimate follower that is following in the game. Any ideas?Thanks Link to comment Share on other sites More sharing options...
RomanR Posted August 25, 2022 Share Posted August 25, 2022 I don't how complex is your checking, but if this function returns invalid values I think I would try to check field returned by GetFollowers myself and test the records against 0 (as 0 means often invalid reference). In case of invalid entries I would simply cease any action and would call GetFollowers again next frame. Link to comment Share on other sites More sharing options...
chambcra Posted August 25, 2022 Author Share Posted August 25, 2022 Thanks RomanR. I've done what you suggest with looking at element 0 of the returned array (GetFollowers). That's what the line right above tdt is showing. I'm not sure what you mean with "cease any action and would call GetFollowers again next frame". I'm still foggy about the doing something in the next frame. Do you always have to use a timer or set a flag or something? I'll give it a try for sure. That would be great if that's all I need to do. This script is run from a spell and can be repeatedly cast with the same result but there are several other scripts where I need the followers info like doors for instance.Here's the whole script: Line 1: SCN a1ccFollowerInfoScriptLine 2:Line 3: short NumberOfFollowersLine 4: short CountLine 5: short ProcedureLine 6: short PackageLine 7: short FollowerOnboardStatusLine 8: short PlayerOnBoardStatusLine 9: short NumElementsLine 10:Line 11: ref TempRefLine 12: ref TargetLine 13:Line 14: array_var Followers_aryLine 15:Line 16:Line 17: Begin ScriptEffectStartLine 18: let Count := 0Line 19: let NumberOfFollowers := player.GetNumFollowersLine 20: let Followers_ary := player.GetFollowersLine 21: let NumElements := ar_Size Followers_aryLine 22: printc "%.0f Followers" NumberOfFollowersLine 23: printc "Index - Name - RefId - Package - Procedure - Target - Onboard"Line 24: While Count < NumberOfFollowersLine 25: if ( Count == 0 )Line 26: let FollowerOnboardStatus := a1ccDwemerHomeRef.Follower1OnboardLine 27: elseif ( Count == 1 )Line 28: let FollowerOnboardStatus := a1ccDwemerHomeRef.Follower2OnboardLine 29: elseLine 30: let FollowerOnboardStatus := a1ccDwemerHomeRef.Follower3OnboardLine 31: endifLine 32: set TempRef to player.GetNthFollower CountLine 33: set Target to TempRef.GetPackageTargetLine 34: let Package := TempRef.GetCurrentAIPackageLine 35: let Procedure := TempRef.GetCurrentAIProcedureLine 36: PrintC "%.0f - %n - %i - %.0f - %.0f - %n - %i - %.0f" Count, TempRef, TempRef, Package, Procedure, Target, Target, FollowerOnboardStatusLine 37: Line 38: let Count += 1Line 39: LoopLine 40: let PlayerOnBoardStatus := a1ccDwemerHomeRef.PlayerOnBoardLine 41: printc "PlayerOnboard = %.0f" PlayerOnBoardStatusLine 42: ;Array versionLine 43: printc " "Line 44: set Count to 0Line 45: While Count < NumElementsLine 46: let TempRef := Followers_ary[Count]Line 47: set Target to TempRef.GetPackageTargetLine 48:Line 49: printc "%.0f - %n - %n - %i" Count, TempRef, Target, TargetLine 50:Line 51: let Count += 1Line 52: LoopLine 53:Line 54: end Link to comment Share on other sites More sharing options...
GamerRick Posted August 25, 2022 Share Posted August 25, 2022 (edited) What do you get if you do a ar_dump Followers_ary ? Also, what exactly is the problem here? Do you think Bremmen should be following you and not Farwil? Using the mod RefScope, you can see exactly what AI package is on an NPC. Also, you are assuming TempRef is an NPC. Edited August 25, 2022 by GamerRick Link to comment Share on other sites More sharing options...
chambcra Posted August 25, 2022 Author Share Posted August 25, 2022 Thanks GamerRick. I'll have to read up on ar_dump Followers_ary. I'm not familiar with that. I'll give it a try. The problem is the game is crashing when the player activates that door. Bremmen is not and should be following the player. He is following Farwil as he should. The problem is the code above usually always works to give correct followers ( of the player )but in this one particular save game it gives erroneous results. I've used "QQuix Conceptual - AI package info reporter" to look at the AI and my script looks at the AI which is package 1 and procedure 11, shown in the picture. I've also done a moveto Farwil and with the console and tdt it shows the package and procedure and it all agrees package 1 and procedure 11 but he's not following the player so "player.GetNthFollower 0" should not be saying he is following the player. TempRef is just a reference variable that is being set to the follower reference so it works in the print statements. Lines 36 and 49. Link to comment Share on other sites More sharing options...
chambcra Posted August 26, 2022 Author Share Posted August 26, 2022 Here's the ar_dump. RefScope is a good idea, I'll work on that. Bremman is a legitimate follower of the player during the quest "The Wayward Knight". My guess is a bug in the game has left something in the save game ever since that quest was played. I just need a way to remove this false status in the game. Maybe to access and change a game variable that is causing obse to think this npc is following the player? Link to comment Share on other sites More sharing options...
GamerRick Posted August 26, 2022 Share Posted August 26, 2022 (edited) I have no clue. I have some of your code in place to test when I have a follower. I will do the Cheydinhal gate soon and see what I get..... Edited August 26, 2022 by GamerRick Link to comment Share on other sites More sharing options...
RomanR Posted August 26, 2022 Share Posted August 26, 2022 (edited) To cease action I thought of testing the ref against zero, for example like this (print lines are optional): set TempRef to player.GetNthFollower Count if TempRef != 0 set Target to TempRef.GetPackageTarget let Package := TempRef.GetCurrentAIPackage let Procedure := TempRef.GetCurrentAIProcedure PrintC "%.0f - %n - %i - %.0f - %.0f - %n - %i - %.0f" Count, TempRef, TempRef, Package, Procedure, Target, Target, FollowerOnboardStatus else print "Check 1: Follower on index "+$Count+" seems invalid." endifAnd here: set Count to 0 While Count < NumElements let TempRef := Followers_ary[Count] if Tempref != 0 set Target to TempRef.GetPackageTarget printc "%.0f - %n - %n - %i" Count, TempRef, Target, Target else print "Can't get a target - follower on index "+$Count+" is invalid." endif let Count += 1 Loop Edited August 26, 2022 by RomanR Link to comment Share on other sites More sharing options...
chambcra Posted August 26, 2022 Author Share Posted August 26, 2022 Okay, cool. This problem is in a save game from someone who did some testing for me on a mod I'm working on. I recently completed the Wayward Knight myself and Bremman was following me during the quest and then stopped following after the quest completed. This might be something that is extremely rare. The reason I want to look into it is because while playing Morroblivion I had something similar a few times where a dead npc (enemy I killed) was showing up on my follower list. In those cases the rogue follower could be disabled easy enough but with a live actor I wouldn't want to disable them. I have a small Airship mod which has the same problem. When you go onboard by activating the ship Bremman shows up and immediately takes off running fast because he's going back to Farwil (no crash because it all happens outside) My new airship that I'm working on is big with doors and interior spaces and that's what's causing the crashing because I guess forcing a non-following actor into an interior space doesn't work very well. While I was inside the Oblivion realm with Bremman, Farwil, and companion Vilja all following me, for a test, I summoned this new giant airship and the four of us went onboard and went inside with no problem. If you want to try it let me know, I could use another tester.Thanks Link to comment Share on other sites More sharing options...
chambcra Posted August 26, 2022 Author Share Posted August 26, 2022 Okay RomanR. I didn't see your post. We were both typing at the same time. I think I see what you're saying. Maybe the reference is invalid and still gives me the phony baloney? I'll give that a try tomorrow morning. The only thing is the reference is already printing out ( 31bc8 ) but sometimes things don't work the way you think they should. It'll be easier to try it than keep thinking about it.Thanks Link to comment Share on other sites More sharing options...
Recommended Posts