Iterate over all followers in script?

Post » Mon Feb 03, 2014 9:46 pm

Hi all,

I'd like to setup a loop to iterate over all of the player's followers. Does anyone have thoughts on how to achieve this?

Right now I'm aware that you can reference a player's follower as such:

Follower1.GetRef() ;gets the first followerFollower2.GetRef(); gets the second follower;; Follower1 and Follower2 are of type ReferenceAlias, and initialized to:;; Pick Quest: DialogueFollower;; PickAlias: Follower

And this would access up to 2 followers (humans only, would not include dogs or Serena) providing I initialized them. but with all these mods out there to allow you N followers, I'd rather futureproof my code and iterate over all of the followers regardless of being human, dog, vampire, etc. (DialogueFollower only works for humans above).

Thanks!

User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Tue Feb 04, 2014 1:25 am

GetPlayerTeammate()

should handle all vanilla followers and almost all modded followers. It should also work for unlimited follower mods which expand on the vanilla system.

User avatar
sw1ss
 
Posts: 3461
Joined: Wed Nov 28, 2007 8:02 pm


Return to V - Skyrim