Difference between revisions of "GetPlayerFollowers - Game"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Deazurain
m (→‎Return Value: added array link)
 
imported>JuniorEidson
m (Incorrectly referred to objects.Length instead of playerFollowers.length)
 
Line 22: Line 22:
   Actor[] playerFollowers = Game.GetPlayerFollowers( )
   Actor[] playerFollowers = Game.GetPlayerFollowers( )
   int index = 0
   int index = 0
   while (index < objects.Length)
   while (index < playerFollowers.Length)
     ;playerFollowers[index].DoSomething()
     ;playerFollowers[index].DoSomething()
     currentElement += 1
     currentElement += 1

Latest revision as of 12:51, 24 May 2016

Member of: Game Script

Returns an array of the player's followers.

Syntax[edit | edit source]

Actor[] Function GetPlayerFollowers() native global

Parameters[edit | edit source]

None

Return Value[edit | edit source]

Actor array containing all actors that are either:

  1. Running an AI procedure that followers the player (e.g. Follow, Range).
  2. Running a package that is flagged to treat the actor as a player-follower (e.g. a Sandbox on a player companion).

Examples[edit | edit source]

   Actor[] playerFollowers = Game.GetPlayerFollowers( )
   int index = 0
   while (index < playerFollowers.Length)
     ;playerFollowers[index].DoSomething()
     currentElement += 1
   endWhile

See Also[edit | edit source]