Skip to content

FactionDefinition ​

Inherits: DatabaseResource < Resource

Enhanced faction definition with reputation levels and relationships

Properties ​

Colorfaction_colorColor.WHITE
Array[ReputationLevel]reputation_levels[]
Dictionaryfaction_relationships{}
boolis_builtinfalse
Array[int]skill_trees[]

Variables ​

Dictionaryruntime_reputation{}

Methods ​

booladd_reputation( other_faction_id: int, amount: int )
boolset_reputation( other_faction_id: int, amount: int )
intget_reputation( other_faction_id: int )
ReputationLevelget_standing_level( other_faction_id: int )
Stringget_standing_name( other_faction_id: int )
ReputationLevelget_reputation_level_for_value( reputation: int )
ReputationLevelget_reputation_level_by_name( level_name: String )
voidadd_reputation_level( level: ReputationLevel )
boolremove_reputation_level( level_name: String )
Array[String]get_reputation_level_names()
ReputationLevelget_highest_reputation_level()
ReputationLevelget_lowest_reputation_level()
voidset_relationship_with_faction( other_faction_id: int, standing_name: String )
Stringget_relationship_with_faction( other_faction_id: int )
boolremove_relationship_with_faction( other_faction_id: int )
boolis_hostile_to( other_faction_id: int )
boolis_friendly_to( other_faction_id: int )
boolis_neutral_to( other_faction_id: int )
boolcan_target_as_enemy( other_faction_id: int )
voidclear_runtime_reputation()
voidset_runtime_reputation( reputation_data: Dictionary )
Dictionaryget_runtime_reputation()
intget_id()

Signals ​

standing_changed( other_faction_id: int, old_standing: String, new_standing: String ) ​

Emitted when this faction's standing with another faction changes

Property descriptions ​

Color faction_color = Color.WHITE ​

Primary color associated with this faction

Array[ReputationLevel] reputation_levels = [] ​

Reputation levels for this faction (sorted by min_reputation)

Dictionary faction_relationships = ​

Predefined relationships with other factions (faction_id -> standing_name like "Hostile", "Friendly")

bool is_builtin = false ​

Whether this faction is a built-in system faction

Array[int] skill_trees = [] ​

Skill trees of this faction (ids of the skill_tree type). They open once the party has met the faction (it has a standing with it) and spend the points of the faction pools (SkillPointPool.scope)

Variable descriptions ​

Dictionary runtime_reputation = ​

Runtime reputation values with other factions (faction_id -> reputation_value)

Method descriptions ​

bool add_reputation( other_faction_id: int, amount: int ) ​

Add reputation with another faction

bool set_reputation( other_faction_id: int, amount: int ) ​

Set reputation with another faction

int get_reputation( other_faction_id: int ) ​

Get reputation with another faction

ReputationLevel get_standing_level( other_faction_id: int ) ​

Get current standing level with another faction

String get_standing_name( other_faction_id: int ) ​

Get standing name with another faction

ReputationLevel get_reputation_level_for_value( reputation: int ) ​

Get reputation level that contains a specific reputation value

ReputationLevel get_reputation_level_by_name( level_name: String ) ​

Get reputation level by name

void add_reputation_level( level: ReputationLevel ) ​

Add a new reputation level (maintains sorting)

bool remove_reputation_level( level_name: String ) ​

Remove reputation level by name

Array[String] get_reputation_level_names() ​

Get all reputation level names

ReputationLevel get_highest_reputation_level() ​

Get the highest reputation level

ReputationLevel get_lowest_reputation_level() ​

Get the lowest reputation level

void set_relationship_with_faction( other_faction_id: int, standing_name: String ) ​

Set relationship with another faction

String get_relationship_with_faction( other_faction_id: int ) ​

Get relationship with another faction

bool remove_relationship_with_faction( other_faction_id: int ) ​

Remove relationship with another faction

bool is_hostile_to( other_faction_id: int ) ​

Check if this faction is hostile to another faction

bool is_friendly_to( other_faction_id: int ) ​

Check if this faction is friendly to another faction

bool is_neutral_to( other_faction_id: int ) ​

Check if this faction is neutral to another faction

bool can_target_as_enemy( other_faction_id: int ) ​

Check if this faction can target another as an enemy

void clear_runtime_reputation() ​

Clear runtime reputation (for new game)

void set_runtime_reputation( reputation_data: Dictionary ) ​

Initialize runtime reputation from save data

Dictionary get_runtime_reputation() ​

Get runtime reputation for saving

int get_id() ​

Get ID from filename or use faction_id