Talk:SetPlayerTeammate - Actor

There are no discussions on this page.

This sample is right out of DialogueFollowerScript and shows setting a follower, which uses the SetPlayerTeammate 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:38, 13 June 2012 (EDT)

Caveat to #4 - it seems kills as well as crimes are attributed to the player. In OnDeath/OnDying events where akKiller should be the teammate, it is actually the player.
Cscottydont (talk) 2013-02-06T13:51:36 (EST)

Return to "SetPlayerTeammate - Actor" page.