Talk:GetFactionRank - Actor

From the Fallout4 CreationKit Wiki
Revision as of 08:14, 28 February 2021 by imported>Scrivener07 (More on faction rank values.)
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)