Jump to content

[LE] Custom follower dismissed himself after combat


aquadashling

Recommended Posts

UPDATE: This only happens on previous save games. If I load a new game and find him, he works just fine. If anyone maybe could tip how to fix it on save game that would be cool, but I suspect not given how dependant on other variables that problem is on things like other load mods, corrupt data, and so on.



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


Reference Alias Script

Scriptname DakronychQuestScriptAlias extends ReferenceAlias


Faction Property CurrentHireling Auto

Message Property FollowerDismissMessage Auto

Actor Property PlayerREF Auto


Event OnUpdateGameTime()

;kill the update if the follower isn't waiting anymore

If Self.GetActorRef().GetActorValue("WaitingforPlayer") == 1

; debug.trace(self + "Dismissing the follower because he is waiting and 3 days have passed.")

(GetOwningQuest() as DakronychQuestScript).DismissFollower(0,0)

EndIf

EndEvent


Event OnUnload()

;if follower unloads while waiting for the player, wait three days then dismiss him.

If Self.GetActorReference().GetActorValue("WaitingforPlayer") == 1

(GetOwningQuest() as DakronychQuestScript).FollowerWait()

EndIf

EndEvent


Event OnCombatStateChanged(Actor akTarget, int aeCombatState)

If (akTarget == PlayerREF)

; debug.trace(self + "Dismissing follower because he is now attacking the player")

(GetOwningQuest() as DakronychQuestScript).DismissFollower(0, 0)

EndIf

EndEvent


Event OnDeath(Actor akKiller)

; debug.trace(self + "Clearing the follower because the player killed him.")

Self.GetActorRef().RemoveFromFaction(CurrentHireling)

Self.Clear()

EndEvent

Edited by aquadashling
Link to comment
Share on other sites

  • 2 weeks later...

The scripts you are using are the old Levionte ones. There's an issue where Friendly Hits can cause the follower to become aggravated towards the player and because of that it triggers the dismiss function.

The solution is to add a calm / pacify function as follows:-.

 

(1) Modify the DakronychQuestScript by adding the following functions to the bottom.

 

"
;========================
Function CombatStateChanged(Actor akTarget, int aeCombatState)
actor FollowerActor = FollowerAlias.GetActorRef() as Actor
;NB: Don't hurt the Player.
If (akTarget == PlayerRef) || (akTarget == None)
Pacify(FollowerActor)
ElseIf (akTarget.IsPlayerTeammate())
Pacify(FollowerActor)
Pacify(akTarget)
EndIf
EndFunction
Function Pacify(Actor akTarget)
akTarget.StopCombat()
akTarget.SetActorValue("Aggression", 0)
akTarget.StopCombatAlarm()
akTarget.EvaluatePackage()
EndFunction
"
(2) Modify the DakronychQuestScriptAlias script as follows:-
"
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
(GetOwningQuest() as DakronychQuestScript).CombatStateChanged(akTarget, aeCombatState)
; If (akTarget == Game.GetPlayer())
; debug.trace(self + "Dismissing follower because he is now attacking the player")
; (GetOwningQuest() as DakronychQuestScript).DismissFollower(0, 0)
; EndIf
EndEvent
"
(3) Recompile both scripts and the problem should be resolved.
Link to comment
Share on other sites

  • 8 months later...

I am having this issue too, except I followed Joseph Russels tutorial. The follower works fine in other saves, but in my current saves he keeps leaving after combat.

hhhhhhhhhhhhhhhhhhhh

Link to comment
Share on other sites

You can resolve this by adding an "OnLoad" event, and at the beginning and at the end of each 'CombatState' state a "IgnoreFriendlyHits()".

 

* No need for pacify spells or calm spells.

Edited by maxarturo
Link to comment
Share on other sites

Maxarturo's advice is excellent. A similar method can be done using the console, however. Simply open the console, select your follower and type

 

sifh 1

 

Maxarturo's fix will work whenever you use the follower but requires going into the CK - or at minimum some scripts. My approach will need to be redone every time you use the follower in a new game but is, frankly, simpler.

Link to comment
Share on other sites

Thanks everyone for your help :D

In my case, MaxArturo, even if I just spawn a skeever and have him kill it with me doing nothing, he still dismisses himself after battle. However, I will try adding that script to him and see how it goes.

MFitz, ty for the console command! I will try that and let you know how it goes.

NexusComa2, you are probably right. I might need a new save for the follower, but in that case i will just give up on him and go get Inigo.. i've remade this save 3 times ;-;

 

 

 

Edit: Ok, so i tried all the suggestions. None of it is working, but I am making sure i am not hitting him. I have uploaded a example video here: https://streamable.com/v3e6br

I do Sifh 1 on him, i summon the enemy, my followers kill the enemy, he leaves my party.

Edited by Sankese
Link to comment
Share on other sites

I fixed it by using Fallrim's Resaver tool and deleting all the deletable script stuff and then reloading my save. Now he works :D (i only deleted the script stuff on my save in regards to his .esp)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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