Jump to content

Script: Stop Companions from following the player / Auto-Dismiss


Zorkaz

Recommended Posts

If you mean companions that fill the standard Followers Quest Companion slot then:

Actor CurrentCompanion 
If (Alias_FollowersCompanion.GetReference() != None) ;Followers Quest Companion Alias
   CurrentCompanion = Alias_FollowersCompanion.GetReference()  as Actor
ElseIf (Alias_FollowersDogmeatCompanion.GetReference() != None) ;Followers Quest Dogmeat Alias
   CurrentCompanion = Alias_FollowersDogmeatCompanion.GetReference()  as Actor
EndIf
If (CurrentCompanion != None)
   (PFollowers as FollowersScript).DismissCompanion(CurrentCompanion, ShowLocationAssignmentListIfAvailable = false, SuppressDismissMessage = true) ;they will go default home or last dismissed workshop 
EndIf

If you mean any other follower then;

Actor[] PlayerFollowers = Game.GetPlayerFollowers()
If (PlayerFollowers.Length > 0)
   Int iIndex = 0 
   While (iIndex < PlayerFollowers.Length)
      Actor ThisFollower = PlayerFollowers[iIndex]
      ;Undo whatever base game quest (like BOSR04) or random mod stuff which manged to attach a playerfollower AI package (like bosr04scribefollowplayer)
      iIndex +=1
   EndWhile
EndIf

To stop them following without dismissing, attach a Travel package with destination set to package start location via a quest alias using a super-high priority 99 quest (hoping that the original PlayerFollower package attach quest is lower) and run the EvaluatePackage() command on them.

Link to comment
Share on other sites

Thank you for your quick response and insight.

 

For anyone reading this and wondering: Yes I know about the fact that you can check the "Player Followers can't follow here" box but it can't be unflagged via script, at least not in the world data settings.

 

Unless SKK50 proves me wrong

Link to comment
Share on other sites

  • Recently Browsing   0 members

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