tes3faction⚓︎
A faction game object.
This type inherits the following: tes3baseObject
Properties⚓︎
attributes
⚓︎
Read-only. An array-style table holding the two attributes that govern advancement. Maps to values in tes3.attribute
namespace.
Returns:
result
(tes3.attribute[])
blocked
⚓︎
The blocked state of the object.
Returns:
result
(boolean)
deleted
⚓︎
Read-only. The deleted state of the object.
Returns:
result
(boolean)
disabled
⚓︎
Read-only. The disabled state of the object.
Returns:
result
(boolean)
id
⚓︎
Read-only. The unique identifier for the object.
Returns:
result
(string)
modified
⚓︎
The modification state of the object since the last save.
Returns:
result
(boolean)
name
⚓︎
The faction's player-facing name.
Returns:
result
(string)
objectFlags
⚓︎
Read-only. The raw flags of the object.
Returns:
result
(number)
objectType
⚓︎
Read-only. The type of object. Maps to values in tes3.objectType
.
Returns:
result
(tes3.objectType)
persistent
⚓︎
The persistent flag of the object.
Returns:
result
(boolean)
playerExpelled
⚓︎
The player's expelled state in the faction. You should prefer to use the expel
or clearExpel
functions to modify this, to ensure the changes are visible to all systems.
Returns:
result
(boolean)
playerJoined
⚓︎
The player's join state for the faction. You should prefer to use the join
or leave
functions to modify this, to ensure the changes are visible to all systems.
Returns:
result
(boolean)
playerRank
⚓︎
The player's current rank in the faction.
Returns:
result
(number)
playerReputation
⚓︎
The player's current reputation in the faction.
Returns:
result
(number)
ranks
⚓︎
Read-only. An array-style table holding the ten related tes3factionRank
s.
Returns:
result
(tes3factionRank[])
reactions
⚓︎
Read-only. A collection of tes3factionReaction
s.
Returns:
result
(tes3factionReaction[])
skills
⚓︎
Read-only. An array-style table holding the seven skills that govern advancement. Maps to values in tes3.skill
namespace.
Returns:
result
(tes3.skill[])
sourceless
⚓︎
The soruceless flag of the object.
Returns:
result
(boolean)
sourceMod
⚓︎
Read-only. The filename (including the extension) of the mod that owns this object. It has nil
value if the object was anything other than loaded from an ESP or ESM file.
Returns:
result
(string)
supportsLuaData
⚓︎
If true, references of this object can store temporary or persistent lua data.
Returns:
result
(boolean)
Methods⚓︎
__tojson
⚓︎
Serializes the object to json.
local string = myObject:__tojson()
Returns:
string
(string)
clearExpel
⚓︎
Clears the expulsion of the player from this faction. It also ensures the character sheet UI is updated.
local success = myObject:clearExpel()
Returns:
success
(boolean)
demote
⚓︎
Demotes the player to the previous rank of this faction, if they are a member. It does not automatically make the player leave the faction if demoted too far. It also ensures the character sheet UI is updated.
local success = myObject:demote()
Returns:
success
(boolean)
expel
⚓︎
Expels the player from this faction. It displays a message box notifying the player that they are expelled. It also ensures the character sheet UI is updated.
local success = myObject:expel()
Returns:
success
(boolean)
getHighestJoinedReaction
⚓︎
For this faction, this function finds the best reaction for another faction that the player has joined. It returns that reaction and its associated faction, or nil
for both values if the no relationship is applicable.
local reaction, faction = myObject:getHighestJoinedReaction()
Returns:
reaction
(number, nil): The reaction, if any, that is best for the faction.faction
(tes3faction, nil): The faction association, if any, that is best for the faction.
getLowestJoinedReaction
⚓︎
For this faction, this function finds the worst reaction for another faction that the player has joined. It returns that reaction and its associated faction, or nil
for both values if the no relationship is applicable.
local reaction, faction = myObject:getLowestJoinedReaction()
Returns:
reaction
(number, nil): The reaction, if any, that is worst for the player.faction
(tes3faction, nil): The faction association, if any, that is worst for the player.
getRankName
⚓︎
This function fetches the player-facing name of a rank in the faction.
local result = myObject:getRankName(rank)
Parameters:
rank
(number): A rank number in range [0, 9] inclusive.
Returns:
result
(string)
getReactionWithFaction
⚓︎
Returns a reaction value for another faction, or nil
if no relationship exists between the two factions.
local reaction = myObject:getReactionWithFaction(faction)
Parameters:
faction
(tes3faction): Another faction to get a reaction for.
Returns:
reaction
(number, nil): The reaction, if any, with the other faction.
join
⚓︎
Makes the player join this faction. It also ensures the character sheet UI is updated.
local success = myObject:join()
Returns:
success
(boolean)
leave
⚓︎
Makes the player leave this faction. It also ensures the character sheet UI is updated.
local success = myObject:leave()
Returns:
success
(boolean)
promote
⚓︎
Promotes the player to the next rank of this faction, if they are a member. It does not automatically make the player join the faction. It also ensures the character sheet UI is updated.
local success = myObject:promote()
Returns:
success
(boolean)
setRankName
⚓︎
This function changes the player-facing name of a given rank in the faction.
myObject:setRankName(rank, name)
Parameters:
rank
(number): A rank number in range [0, 9] inclusive.name
(string): A new name to set.