Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Global objectServer APIGenerated

Faction

const Faction: object

Defined in: server/api.d.ts:2004

How the game’s factions react to each other, on every client. Combined with Player.setFactionRank it decides who the game treats as friend or foe: NPCs, turrets and companions alike.

clearReaction(faction, other, mutual?): boolean

Gives a reaction back to the game’s data files on every client.

string | number

A TESFaction form ID, as a number or hex string.

string | number

The faction it reacts to, as a number or hex string.

boolean

Both directions, as Faction.SetAlly and Faction.SetEnemy do; true when left out.

boolean

True when one was overridden.

getReaction(faction, other): "neutral" | "enemy" | "ally" | "friend" | null

How one faction reacts to another, where the server overrides it.

string | number

A TESFaction form ID, as a number or hex string.

string | number

The faction it reacts to, as a number or hex string.

"neutral" | "enemy" | "ally" | "friend" | null

The reaction; null when the game’s data files decide.

setReaction(faction, other, reaction, mutual?): boolean

Overrides how one faction reacts to another on every client, as Faction.SetAlly and Faction.SetEnemy do, until it is cleared or the server stops. A faction can be its own enemy. Up to 64 directions are overridden at once.

string | number

A TESFaction form ID, as a number or hex string.

string | number

The faction it reacts to, as a number or hex string.

"neutral" | "enemy" | "ally" | "friend"

Enemies fight on sight; allies and friends help each other, friends also in combat.

boolean

Both directions, as Faction.SetAlly and Faction.SetEnemy do; true when left out.

boolean

True when set; false when the table is full.