pxd2050 Posted November 24, 2021 Share Posted November 24, 2021 I want to call the function in alias, but ForceRefTo(ActorRef) seems that for doesn't work.Debug does not display, What went wrong? Scriptname TBM_MainScript Extends Quest Hidden Function SetAlias(Actor ActorRef) int slot = FindEmpty() If slot == -1 int i = TBM_followers.Length - 1 actor Lfollower = TBM_followers[i].GetActorRef() TBM_followers[i].clear() Lfollower.RemoveFromFaction(TBM_StayClose) Lfollower.EvaluatePackage() slot = i endif TBM_followers[slot].ForceRefTo(ActorRef) (TBM_followers[slot] as TBM_AliasScript).LoadAlias() EndFunction ----------------------------- Scriptname TBM_AliasScript extends ReferenceAlias Function LoadAlias() ActorRef = self.GetActorReference() if !ActorRef debug.notification("what is wrong?" ) return endif PlayerRef = Game.GetPlayer() ActorRef.MoveTo(ActorRef) ActorRef.AddToFaction(TBM_StayClose) ActorRef.EvaluatePackage() if ActorRef.GetCurrentPackage() == PlayerFollowerPackageBeside RegisterForSingleLOSLost(ActorRef, PlayerRef) Else ActorRef.ClearKeepOffsetFromActor() endif debug.notification("welocme " + ActorRef) EndFunction Link to comment Share on other sites More sharing options...
pxd2050 Posted November 24, 2021 Author Share Posted November 24, 2021 Solved the problem. add "ActorRef.AddToFaction(TBM_StayClose)" endif ActorRef.AddToFaction(TBM_StayClose) TBM_followers[slot].ForceRefTo(ActorRef) (TravelBesidesMeMCMQuest as TBM_MCMScript).AliasInit() Link to comment Share on other sites More sharing options...
Recommended Posts