Difference between revisions of "GetFactions - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>TidalWraith
(Using a new format for this one let me know what you think.)
 
imported>TidalWraith
(Added Example)
Line 14: Line 14:
A [[Faction Script| Faction]] array is returned containing all factions the actor is a part of within the specified rank range
A [[Faction Script| Faction]] array is returned containing all factions the actor is a part of within the specified rank range
   
   
== Examples ==
<source lang="papyrus">
        ;This example grabs the player, then their factions and finally prints the array of factions to the Papyrus log.
Actor PlayerRef = Game.GetPlayer()
Faction[] PlayerFactions = PlayerRef.GetFactions(-128, 127);The maximum range allowed.
Debug.Trace(PlayerRef.GetName() + " is a part of the following factions: " + PlayerFactions)
</source>
== See Also ==
== See Also ==
* [[AddToFaction - Actor| AddToFaction ]]
* [[AddToFaction - Actor| AddToFaction ]]

Revision as of 02:08, 20 June 2015


Faction[] Function GetFactions(int minRank, int maxRank) native


Returns all factions of the actor with the specified minimum and maximum ranks (maximum range of -128 to 127)

Parameters

  • minRank: The minimum rank
  • maxRank: The maximum rank

Return Value

A Faction array is returned containing all factions the actor is a part of within the specified rank range

Examples

        ;This example grabs the player, then their factions and finally prints the array of factions to the Papyrus log.
	Actor PlayerRef = Game.GetPlayer()
	Faction[] PlayerFactions = PlayerRef.GetFactions(-128, 127);The maximum range allowed.
	Debug.Trace(PlayerRef.GetName() + " is a part of the following factions: " + PlayerFactions)

See Also