Jump to content

what is wrong with ForceRefTo(ActorRef)?


pxd2050

Recommended Posts

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

  • Recently Browsing   0 members

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