Difference between revisions of "MakePlayerFriend - Actor"
Jump to navigation
Jump to search
→Examples: added a slightly modified version of this function. Cuts down GetPlayer() calling down to 1, making it a bit faster than original version.
imported>Thingy Person (→Syntax) |
imported>Lisselli (→Examples: added a slightly modified version of this function. Cuts down GetPlayer() calling down to 1, making it a bit faster than original version.) |
||
Line 29: | Line 29: | ||
; Make Bob a friend of the player | ; Make Bob a friend of the player | ||
Bob.MakePlayerFriend() | Bob.MakePlayerFriend() | ||
</source> | |||
<source lang="papyrus"> | |||
Function MakePlayerFriend() | |||
Actor Player = Game.GetPlayer() ; let's call GetPlayer() only one time. | |||
ActorBase myBase = GetActorBase() | |||
if myBase.IsUnique() | |||
if GetRelationshipRank(Player)== 0 | |||
SetRelationshipRank(Player, 1) | |||
else | |||
endif | |||
else | |||
endif | |||
endFunction | |||
</source> | </source> | ||