Talk:SetRelationshipRank - Actor

From the CreationKit Wiki
Revision as of 11:40, 13 June 2012 by imported>Sollar (Created page with "This sample is right out of DialogueFollowerScript and shows setting a follower, which uses the SetRelationshipRank function in real use: Function SetFollower(ObjectReferen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This sample is right out of DialogueFollowerScript and shows setting a follower, which uses the SetRelationshipRank function in real use:

 Function SetFollower(ObjectReference FollowerRef)
   actor FollowerActor = FollowerRef as Actor
   FollowerActor.RemoveFromFaction(pDismissedFollower)
   If FollowerActor.GetRelationshipRank(Game.GetPlayer()) < 3 && FollowerActor.GetRelationshipRank(Game.GetPlayer()) >= 0
     FollowerActor.SetRelationshipRank(Game.GetPlayer(), 3)
   EndIf
   FollowerActor.SetPlayerTeammate()
   pFollowerAlias.ForceRefTo(FollowerActor)
   pPlayerFollowerCount.SetValue(1)	
 EndFunction

--Sollar 12:40, 13 June 2012 (EDT)