Background for Skyrim SE
Member of the Actor script
voidfunctionAddToFaction(FactionakFaction)

Description

Wiki Description

Adds the Actor to a specified Faction at rank 0. If the Actor is already in the faction, this function does nothing.

Documentation Comment

Adds this actor to a faction at rank 0 if they aren't already in it


Caveats

CK Wiki - Notes

  • For faction members of factions normally an enemy to the player, simply adding the player to the faction will not make them friendly to the player if their Aggression level is "Very Aggressive". Therefore when you add the player to such factions, you must also change their reaction accordingly through Faction.SetReaction(...) and make them a "friend".
  • Additionally, some actors are part of more than one enemy faction, and you must take account for this by also using SetReaction() on any other factions they are part of.
  • This function checks if you're in the passed in faction by calling Actor.IsInFaction(...), and if not, calls Actor.SetFactionRank(...) and sets your rank to 0. This may or may not be related to the above notes concerning SetReaction. More testing is needed.

Parameters

FactionakFaction

CK Wiki Description

The Faction to which the Actor should be added.


Examples

; Add Hrothgar to the Dark Brotherhood 
Hrothgar.AddToFaction(DBFaction)

;Adding the player to the Falmer Faction wont make the Falmers friendly. So change their reaction.
Actor property PlayerRef auto

Faction property FalmerFaction auto
Faction property PlayerFaction auto

PlayerRef.AddToFaction(FalmerFaction)
PlayerFaction.SetReaction(FalmerFaction, 3)

Auto-Generated Example

Faction myFaction__akFaction

myActor__toCallFunctionOn.AddToFaction(myFaction__akFaction)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.