Jump to content

Photo

Custom follower dismisses himself after combat

follower creation kit script custom follower ai packages

  • Please log in to reply
No replies to this topic

#1
aquadashling

aquadashling

    Stranger

  • Members
  • Pip
  • 4 posts

I'm completely new to creation kit modding, so I apologize if I'm totally overlooking something or otherwise just seem incompetent.

 

ive been using the creation kit to create my own custom dremora follower because none exist that satisfy on special edition nexus. originally i tried using a follower package activate via quest stage sequences and setting the stage through papyrus fragments activated at the end of the dialogue, for example the "follow me" prompt chosen by the player would activate the corresponding dialogue and then set the stage to 20, which then activated the follower package. The problem was that for some reason the follower wouldnt stop the unsheathing sync that happens when he follows you even if i dismissed him, and it took him forever to actually start/stop following me, as if it took awhile for the package to be read or something.

 

Anyways, so I stopped using that method and looked for more online resources to create a fully functioning follower and I found one guiding you on creating a custom follower with their own framework; custom dialogue options and scripts and so on, which was perfect since I wanted to use custom voices which were essentially the Dremorv oice files rearranged to be immersive as a follower. I followed this method of using papyrus quest scripts and set the dialogue with fragments to activate the chosen scripts. it works very well in game, except a major problem im having with it is that the follower keeps dismissing himself after combat, everytime we engage, and im not sure how to solve it. 

 

If anyone can help, or ask me to be more specific or provide more information, I would be very thankful. Below I will provide a link to the guide I followed and the script I followed from it.

 

Guide

 

Script:

 

Scriptname DakronychQuestScript extends Quest

 
Actor Property PlayerREF Auto
ReferenceAlias Property FollowerAlias Auto
Faction Property DismissedFollowerFaction Auto
Faction Property CurrentHireling Auto
Message Property  FollowerDismissMessage Auto
Message Property  FollowerDismissMessageWedding Auto
Message Property  FollowerDismissMessageCompanions Auto
Message Property  FollowerDismissMessageCompanionsMale Auto
Message Property  FollowerDismissMessageCompanionsFemale Auto
Message Property  FollowerDismissMessageWait Auto
SetHirelingRehire Property HirelingRehireScript Auto
 
;Property to tell follower to say dismissal line
Int Property iFollowerDismiss Auto Conditional
 
Function SetFollower(ObjectReference FollowerRef)
     actor FollowerActor = FollowerRef as Actor
     FollowerActor.RemoveFromFaction(DismissedFollowerFaction)
     If FollowerActor.GetRelationshipRank(PlayerREF) <3 && FollowerActor.GetRelationshipRank(PlayerREF) >= 0
          FollowerActor.SetRelationshipRank(PlayerREF, 3)
     EndIf
     FollowerActor.SetPlayerTeammate()
     ;FollowerActor.SetActorValue("Morality", 0)
     FollowerAlias.ForceRefTo(FollowerActor)
     FollowerActor.EvaluatePackage()
EndFunction
 
Function FollowerWait()
     actor FollowerActor = FollowerAlias.GetActorRef() as Actor
     FollowerActor.SetActorValue("WaitingForPlayer", 1)
     SetObjectiveDisplayed(10, abforce = true)
     ;follower will wait 3 days
     FollowerAlias.RegisterForSingleUpdateGameTime(72) 
EndFunction
 
Function FollowerFollow()
     actor FollowerActor = FollowerAlias.GetActorRef() as Actor
     FollowerActor.SetActorValue("WaitingForPlayer", 0)
     SetObjectiveDisplayed(10, abdisplayed = false)
     FollowerActor.EvaluatePackage()
EndFunction
 
Function DismissFollower(Int iMessage = 0, Int iSayLine = 1)
     If FollowerAlias && FollowerAlias.GetActorReference().IsDead() == False
          If iMessage == 0
               FollowerDismissMessage.Show()
          ElseIf iMessage == 1
               FollowerDismissMessageWedding.Show()
          ElseIf iMessage == 2
               FollowerDismissMessageCompanions.Show()
          ElseIf iMessage == 3
               FollowerDismissMessageCompanionsMale.Show()
          ElseIf iMessage == 4
               FollowerDismissMessageCompanionsFemale.Show()
          ElseIf iMessage == 5
               FollowerDismissMessageWait.Show()
          Else
              ;failsafe
              FollowerDismissMessage.Show()
          EndIf
          actor DismissedFollowerActor = FollowerAlias.GetActorRef() as Actor
          DismissedFollowerActor.StopCombatAlarm()
          DismissedFollowerActor.AddToFaction(DismissedFollowerFaction)
          DismissedFollowerActor.SetPlayerTeammate(false)
          DismissedFollowerActor.RemoveFromFaction(CurrentHireling)
          DismissedFollowerActor.SetActorValue("WaitingForPlayer", 0)
          ;hireling rehire function
          HirelingRehireScript.DismissHireling(DismissedFollowerActor.GetActorBase())
          If iSayLine == 1
               iFollowerDismiss = 1
              DismissedFollowerActor.EvaluatePackage()
             ;Wait for follower to say line
             Utility.Wait(2)
          EndIf
             FollowerAlias.Clear()
             iFollowerDismiss = 0
             ;don't set count to 0 if Companions have replaced follower
          If iMessage == 2
               ;do nothing
          EndIf
     EndIf
EndFunction

 







Also tagged with one or more of these keywords: follower, creation kit, script, custom follower, ai packages

Page loaded in: 1.034 seconds