Talk:GetFactionRank - Actor

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

The ranks are a bit deceiving and this page should probably be updated with more detail.

-2 : Is a special value that not only means the NPC is not in the faction, but it also means they have never been in the faction.

-1 : When you remove an actor from a faction, this is the rank they revert to. So it not only carries potential membership, but past membership as well.

There is also a bug that can lead to unexpected results. If you SetFactionRank() to a negative value other than -1, IsInFaction() will return true. So if you write mod-friendly code that stores off the original faction rank and restores it later, it can leave the Actor with a rank of -2 and IsInFaction() checks still returning true. So be careful and remember to not rely on rank alone for membership checks.

Hmm, all the companions have CurrentCompanionFaction on their forms, and this is set to -1 by default. Through my tests with Piper, her rank changes to 0 when she's the current companion. When I dismissed her, the rank changed to -2. --Rasikko (talk) 2021-02-28T08:14:02 (EST)
This is my findings on the matter concerning followers:

  • 0 = Is the current follower and has been added to the faction via AddToFaction.
  • -1 = Hasn't been added to the faction via AddtoFaction yet and therefor is not available as a follower yet.
  • -2 = The follower has been dismissed.

--Rasikko (talk) 2021-02-28T09:46:06 (EST)