Model Hierarchy
Quick link to the external model hierarchy documentation: Model Hierarchy
The model hierarchy provides script with a mechanism to query and browse game objects. Model hierarchy objects that represent game entities such as factions, regions or military forces may be accessed by script, usually through event contexts
. Each model hierarchy object provides an interface on which calls may be made to query that object. For example, a faction may be queried to determine its name, a settlement may be queried to determine its position, or a military force may be queried to determine its current stance.
In many cases objects may also be queried to access related objects. For example, each faction
object provides a faction_leader
method which can be called to return a character
object representing the faction leader character of that faction. This character object can then be queried like any other character object, including being asked for other related objects such as the military force commanded by the character or the region the character is stood in.
A list of model hierarchy interfaces is given further down this page. To see the list of functions they each provide, visit the external documentation. Each interface section on this page provides a link to the relevant section of the external model hierarchy documentation.
In most circumstances the model hierarchy is read-only. Changes to the game cannot be made through model hierarchy functions - see the episodic_scripting
interface for a list of code-provided functions that can effect changes the game model. Certain exceptions exist, such as the modify-ritual interfaces.
The following image illustrates many of the main objects provided by the model hierarchy and how they link together. It is by no means authoritative! See the further down this page, or external documentation, for a full list.
Loaded in Campaign | |
Loaded in Battle | |
Loaded in Frontend |
The model hierarchy is accessed mainly through event contexts
. When an event is triggered by the campaign model it provides a context object to any listener scripts that gets called. This context object can provides one or more objects within the model hierarchy, each of which represent objects in the game such as a faction, a settlement, or a character. For example, the context of the FactionTurnStart
event provides a faction
object representing the faction that is starting its turn, whereas the CharacterLootedSettlement
object provides both a character
and settlement
object.
A list of events and what methods the related context object provides can be found in the external model hierarchy documentation. A list of the various objects that the model hierarchy provides is also given further down this page.
As well as accessing through event contexts, the model
script interface which underpins the rest of the model hierarchy may also be accessed at any time by calling cm:model
on the episodic_scripting
interface.
Example - Accessing the model hierarchy through the FactionTurnStart event:
core:add_listener(
"example_faction_turn_start_listener",
"FactionTurnStart",
true,
function(context)
-- access the faction starting its turn
local faction = context:faction();
-- retrieve a character script interface representing the faction's leader
local faction_leader = faction:faction_leader();
-- output some information about the faction starting its turn and the location of the faction leader
out("* faction " .. faction:name() .. " is starting its turn, faction leader is at [" .. faction_leader:logical_position_x() .. ", " .. faction_leader:logical_position_y() .. "]");
end,
true
);
faction wh3_main_ksl_the_ice_court is starting its turn, faction leader is at [418, 118]
Example - Accessing the model directly:
local model = cm:model();
out("There are currently " .. model:world():faction_list():num_items() .. " factions in the game");
There are currently 108 factions in the game
Objects retrieved from the model hierarchy in script are imperminent should not be stored for reference later in time. The game reserves the right to delete objects from memory from time to time, so a model hierarchy object stored over time may find itself invalidated. It is safe to use an object reference taken as a local variable on the tick on which it was taken, unless something happens on that tick to invalidate it (e.g. taking a character reference and then killing it - the character reference is no longer safe to use).
If it is required to access a model hierarchy object over time, then a permanent reference by which the object may be looked up should be stored in place of the object itself. This is often the command-queue index (a unique id for each object of a certain type) but can be a string key.
Example - Bad script that tries to use a reference to an object over time:
This script may work some of the time, but is not safe and will cause intermittent failures on some machines.
-- get a faction
local faction = cm:get_faction("wh_main_emp_empire")
out("The Empire have " .. faction:num_allies() .. " allies")
randomise_alliances()
-- wait one second, and try and re-access faction (BAD)
cm:callback(
function()
out("After randomising alliances, The Empire have " .. faction:num_allies() .. " allies")
end,
1
)
Example - Good script that looks up the faction by key each time it's used over time:
-- get a faction
local faction_key = "wh_main_emp_empire"
local faction = cm:get_faction(faction_key)
out("The Empire have " .. faction:num_allies() .. " allies")
randomise_alliances()
-- wait one second, look up the faction again from its key and use the new reference (GOOD)
cm:callback(
function()
local faction = cm:get_faction(faction_key)
out("After randomising alliances, The Empire have " .. faction:num_allies() .. " allies")
end,
1
)
Active Ritual List
A list of active_ritual
script interfaces. This list is mainly accessed from the faction_rituals
script interface.
Active Ritual
The active ritual interface represents a ritual, previously cast by a faction, that is currently still active.
Armory
The armory script interface is owned by the family_member
script interface, and grants a way to get armory information for that family member.
Bonus Values
The bonus values script interface provides access to bonus values for a campaign object such as a character
, faction
or faction_province_manager
.
BONUS_VALUES_SCRIPT_INTERFACE
agent_value
basic_value
building_chain_value
projectile_value
projectile_shot_type_value
subculture_value
faction_value
resource_value
unit_ability_value
missile_weapon_value
army_special_ability_value
ritual_value
ritual_chain_value
unit_attribute_value
unit_category_value
unit_class_value
unit_caste_value
main_unit_value
battlefield_deployable_siege_item_value
technology_category_value
technology_value
action_results_additional_outcome_value
province_initiative_effect_value
deployable_value
building_level_value
province_initiative_value
agent_action_value
campaign_map_attrition_value
name_value
agent_subtype_value
special_ability_phase_value
unit_set_special_ability_phase_value
loyalty_event_effect_value
pooled_resource_factor_junction_value
pooled_resource_value
special_ability_group_value
character_training_group_value
public_order_provider_value
scripted_value
Building List
A list of building
script interfaces. This is accessible from the garrison_residence
script inteface.
Building Base
A building base script interface represents the base class of buildings constructed in slot
, foreign_slot
or military_force_slot
containers.
Building
A building script interface represents a building constructed in a slot
within a settlement
.
Campaign AI
The campaign AI script interface provides functionality related to AI systems. It is accessible from the model
script interface.
CAMPAIGN_AI_SCRIPT_INTERFACE
is_null_interface
strategic_stance_between_factions
strategic_stance_between_factions_available
strategic_stance_between_factions_promotion_or_blocking_is_set
strategic_stance_between_factions_promotion_is_active
strategic_stance_between_factions_promotion_current_level
strategic_stance_between_factions_promotion_start_round
strategic_stance_between_factions_promotion_start_level
strategic_stance_between_factions_promotion_end_round
strategic_stance_between_factions_promotion_end_level
strategic_stance_between_factions_is_being_blocked
strategic_stance_between_factions_is_being_blocked_until
funds_available_for_immediate_payment_for_faction_by_area
funds_available_for_upkeep_for_faction_by_area
Campaign Dilemma Builder
A campaign dilemma builder provides an interface for building campaign dilemmas in script. An object of this type may is returned when the episodic scripting function cm:create_dilemma_builder
is called.
Campaign Incident Builder
A campaign incident builder provides an interface for building campaign incidents in script. An object of this type may is returned when the episodic scripting function cm:create_incident_builder
is called.
Campaign Mission
A campaign mission script interface represents an active mission in campaign. Not currently used.
Campaign Payload Builder
The campaign payload builder facilitates construction of payloads in script. Payloads are rewards given for completion of missions, incidents and dilemmas. A payload builder can be created by calling cm:create_payload
, and is currently used to provide payload setup to a campaign_dilemma_builder
.
CAMPAIGN_PAYLOAD_BUILDER_SCRIPT_INTERFACE
is_null_interface
abandon_settlement
action_points_percentage_change
agent_capacity_adjustment
faction_ancillary_gain
character_ancillary_gain
ancillary_loss
army_transfer
building_chain_demolition
character_experience_change
character_loyalty_adjustment
character_loyalty_effect
character_post_assignment
character_to_kill
character_to_wound
character_trait_change
components_from_record
damage_army
damage_buildings
damage_buildings_home_region
damage_character
damage_walls
demolish_secondary_buildings
destroy_faction
diplomatic_attitude_adjustment
diplomatic_attitude_adjustment_between
disable_faction_characters_movement
effect_bundle_to_all_factions
effect_bundle_to_character
effect_bundle_to_faction
effect_bundle_to_faction_province
effect_bundle_to_force
effect_bundle_to_home_region
effect_bundle_to_region
effect_bundle_to_region_group
entity_resource_transaction
faction_pooled_resource_transaction
faction_pooled_resource_transaction_from_record
faction_pooled_resource_transaction_percentage
faction_pooled_resource_transfer
faction_province_pooled_resource_transaction
faction_province_pooled_resource_transaction_percentage
faction_slaves_adjustment
favour_points
foreign_slot
foreign_slot_transfer
form_confederation
give_region
grant_vision
grant_vision_of_faction_characters
grant_vision_of_faction_regions
influence_adjustment
located
add_mercenary_to_faction_pool
add_mercenary_to_province_pool
military_force_pooled_resource_transaction
military_force_pooled_resource_transaction_percentage
open_gates
province_development_point_increase
province_slaves_adjustment
random_ancillary_loss
random_subpayload
rebellion
region_pooled_resource_transaction
region_pooled_resource_transaction_percentage
region_transfer
reveal_foreign_slots
scripted_mission
show_war_coordinaton_extra_information
spawn_agent
spawn_military_force
spawn_military_force_ritual_site
spawn_storm
spawn_unit
spawn_unit_home_region
subpayload
teleport_army
text_display
transported_military_force
treasury_adjustment
unit_capacity_adjustment
war_coordination_target
winds_of_magic_strength_change
add_unit
remove_unit
destroy_unit
valid
clear
Caravans System
An interface to the caravan system, provided by the world
script interface.
Caravan List
A list of caravan
script interfaces. Such lists are provided by the faction_caravans
script interface.
Caravan Recruitment Item List
A list of caravan_recruitment_item
script interfaces. Provided by the faction_caravans
script interface.
Caravan Recruitment Item
A caravan recruitment item represents a caravan master that can be recruited. It is found within the caravan_recruitment_item_list
provided by the faction_caravans
script interface.
Caravan
An interface representing a caravan on the campaign map. These are provided by caravan-related events, and found within caravan_list
list interfaces such as those provided by the faction_caravans
interface.
Character Details List
A list of character_details
script interfaces. Each character_details
script interface is a persistent reference to a character
.
Character Details
A character details interface is a persistent interface related to character
. While the character
interface related to an immortal character in game can be destroyed and recreated with a new command-queue-index value, the related character_details
interface does not change cqi.
CHARACTER_DETAILS_SCRIPT_INTERFACE
is_null_interface
model
faction
forename
surname
get_forename
get_surname
character_type
character_type_key
character_subtype
character_subtype_key
character_subtype_has_female_name
is_part_of_subtype_set
is_immortal
is_unique
has_trait
all_traits
trait_points
has_ancillary
is_male
has_skill
background_skill
number_of_traits
trait_level
loyalty
personal_loyalty_factor
family_member
character_initiative_sets
lookup_character_initiative_set_by_key
pooled_resource_manager
character
Character Imprisonment Rejection Reason Mask
An interface that can be queried to determine why a character imprisonment failed.
Character Initiative List
A list of initiative
script interfaces. This list is mainly accessed from the initiative_set
script interface which is owned by a character
.
Character Initiative
A character initiative provides effects over a duration. They are closer in behaviour to skills than effect bundles, and empower the Ogre Kingdoms Big Names feature. Character initiatives are returned by related events and can be ultimately accessed through character
interfaces via initiative_set
and initiative_list
script interfaces.
Character Initiative Set List
A list of initiative_set
script interfaces, accessible from the character_details
script interface.
Character Initiative Set
A character initiative set is a collection of related initiative
objects. Sets can be accessed from the character_details
script interface.
Character Initiative Status
A character initiative status represents a snapshot of the status of a initiative
. Such objects can be returned by a initiative_set
interface.
Character List
A list of character
script interfaces.
Character Observation Options
Observation options govern what level of information is shown during the end-turn sequence. A character observation options interface represents a type of this information, either regarding all allies, all enemies, all neutrals or a specific faction
. Interfaces of this type can be retrieved by calling certain functions on the world
script interface.
Character
The character script interface represents a character in campaign. This is a key interface which is provided by many events and other interfaces in the model hierarchy.
CHARACTER_SCRIPT_INTERFACE
is_null_interface
has_garrison_residence
has_region
has_military_force
model
garrison_residence
faction
region
sea_region
region_data
military_force
forename
surname
get_forename
get_surname
flag_path
in_settlement
in_port
is_besieging
is_blockading
is_carrying_troops
character_type
character_type_key
character_subtype
character_subtype_key
is_part_of_subtype_set
is_governor
has_trait
all_traits
trait_points
has_ancillary
battles_fought
action_points_remaining_percent
action_points_per_turn
is_male
performed_action_this_turn
is_ambushing
turns_at_sea
turns_in_own_regions
turns_in_enemy_regions
is_faction_leader
rank
defensive_sieges_fought
defensive_sieges_won
offensive_sieges_fought
offensive_sieges_won
fought_in_battle
won_battle
percentage_of_own_alliance_killed
ministerial_position
position
logical_position_x
logical_position_y
display_position_x
display_position_y
battles_won
offensive_battles_won
offensive_battles_fought
defensive_battles_won
defensive_battles_fought
offensive_naval_battles_won
offensive_naval_battles_fought
defensive_naval_battles_won
defensive_naval_battles_fought
offensive_ambush_battles_won
offensive_ambush_battles_fought
defensive_ambush_battles_won
defensive_ambush_battles_fought
cqi
is_embedded_in_military_force
embedded_in_military_force
has_skill
background_skill
is_hidden
is_deployed
has_recruited_mercenaries
routed_in_battle
body_guard_casulties
number_of_traits
trait_level
loyalty
personal_loyalty_factor
family_member
command_queue_index
is_politician
post_battle_ancillary_chance
is_caster
is_visible_to_faction
can_equip_ancillary
is_at_sea
is_wounded
character_details
can_reach_character
can_reach_settlement
can_reach_position
can_reach_character_in_stance
can_reach_settlement_in_stance
can_reach_position_in_stance
effect_bundles
has_effect_bundle
pooled_resource_manager
bonus_values
is_loaned
try_get_agent_plague_components
Cooking Dish
The cooking dish interface represents a dish within the cooking system. It is provided by the FactionCookedDish
script event and from the faction_cooking_info
script interface.
Cooking System
This top-level cooking system interface is accesible from the world
script interface.
Custom Effect Bundle
The custom effect bundle interface allows customisation of an existing effect bundle record. The record must be defined in the effect_bundles
database table.
Debug Drawing
An interface providing some functionality to draw debug lines. This object will not be available in the retail version on the game.
Effect Bundle List
A list of effect_bundle
interfaces.
Effect Bundle
An effect bundle is a collection of effect
modifiers, and can be applied to many types of game objects.
Effect List
A list of effect
interfaces.
Effect
An effect that provides bonus values via a scope. These can be applied to game objects to produce in-game modifications, usually via an effect_bundle
.
Faction Caravans
The faction caravans interface provides access to caravan
objects owned by a faction
. Such objects are returned by the caravans_system
script interface.
Faction Character Tagging System
The faction character tagging system is a method for one faction to tag characters, to which effects are applied. This is used to empower the Gift of Slaanesh feature. This interface is accessed from the world
interface.
Faction Character Tag Entry List
A list of faction_character_tag_entry
interfaces.
Faction Character Tag Entry
A faction character tag entry represents a tag attached to a character. It is returned by character tagging events and by the faction_character_tagging_system
interface.
Faction Cooking Info
Provides information related to a the cooking status of a faction
. Such objects are retrieved from the cooking_system
interface.
Faction List
A list of faction
interfaces.
Faction Plague
The faction plague interface provides details of which plague components are available to a faction.
Faction Province Manager List
A list of faction_province_manager
interfaces.
Faction Province Manager
A faction province manager interface provides an interface to the portion of a province that a particular faction
owns.
Faction Rituals
The faction rituals interface provides access to lists of rituals associated with a faction
.
Faction
The faction script interface represents an in-game faction. This is a key interface and is provided by many events and other interfaces.
FACTION_SCRIPT_INTERFACE
is_null_interface
region_list
character_list
military_force_list
model
is_factions_turn
is_human
is_idle_human
name
home_region
faction_leader
has_faction_leader
has_home_region
flag_path
started_war_this_turn
ended_war_this_turn
ancillary_exists
num_allies
at_war
allied_with
non_aggression_pact_with
military_access_pact_with
trade_agreement_with
military_allies_with
defensive_allies_with
is_vassal_of
is_ally_vassal_or_client_state_of
at_war_with
trade_resource_exists
trade_value
trade_value_percent
unused_international_trade_route
trade_route_limit_reached
sea_trade_route_raided
treasury
treasury_percent
losing_money
expenditure
income
net_income
tax_level
upkeep
upkeep_income_percent
upkeep_expenditure_percent
research_queue_idle
has_technology
is_currently_researching
has_available_technologies
num_completed_technologies
num_generals
culture
subculture
has_food_shortage
imperium_level
diplomatic_standing_with
diplomatic_attitude_towards
factions_non_aggression_pact_with
factions_military_access_pact_with
factions_trading_with
factions_at_war_with
factions_met
factions_of_same_culture
factions_of_same_subculture
factions_allied_with
factions_defensive_allies_with
factions_military_allies_with
get_foreign_visible_characters_for_player
get_foreign_visible_regions_for_player
command_queue_index
is_quest_battle_faction
holds_entire_province
is_vassal
is_dead
total_food
food_production
food_consumption
get_food_factor_value
get_food_factor_base_value
get_food_factor_multiplier
unique_agents
has_effect_bundle
has_rituals
rituals
has_faction_slaves
num_faction_slaves
max_faction_slaves
percentage_faction_slaves
get_climate_suitability
pooled_resource_manager
has_ritual_chain
has_access_to_ritual_category
foreign_slot_managers
is_allowed_to_capture_territory
can_be_human
effect_bundles
is_rebel
is_faction
unit_cap
unit_cap_remaining
bonus_values
agent_cap
agent_cap_remaining
agent_subtype_cap
agent_subtype_cap_remaining
team_mates
is_team_mate
is_primary_faction
turn_is_skipped
num_provinces
num_complete_provinces
provinces
complete_provinces
is_contained_in_faction_set
master
vassals
is_in_confederation
was_confederated
faction_initiative_sets
lookup_faction_initiative_set_by_key
units_recruited_in_set
mercenary_pool
plagues
Family Member List
A list of family_member
interfaces.
Family Member
The family member script interface represents a character
within a family tree. This interface is persistent, even if the related character is destroyed and recreated.
Foreign Slot List
A list of foreign_slot
interfaces.
Foreign Slot Manager List
A list of foreign_slot_manager
interfaces.
Foreign Slot Manager
A foreign slot manager has ownership of all foreign_slot
objects for a faction
within a settlement
/region
. A manager is returned by the various foreign-slot-related events, and from the region
script interface.
Foreign Slot
A foreign slot is a building slot owned by a faction
in a foreign settlement
. This underpins mechanics such as Chaos Cults and Skaven Under-Empires. A foreign slot is owned by a foreign_slot_manager
.
Garrison Residence
The garrison residence script interface represents the garrison residence within a settlement
. It can be queried to determine information about any military_force
present within the garrison, or the siege status of the settlement. There is only one settlement/garrison residence in each region
.
Horde Details
The horde details script interface represents the horde aspect of a military force that belongs to a horde faction. The horde details script interface can be queried for military_force_slot
objects related to the military force/horde.
Main Unit Record
The main unit record data of a unit.
Military Force List
A list of military_force
interfaces.
Military Force
A military force interface represents any army or navy on the campaign map, including garrison armies. This is a key interface.
MILITARY_FORCE_SCRIPT_INTERFACE
is_null_interface
has_general
is_army
is_navy
model
unit_list
character_list
general_character
faction
has_garrison_residence
garrison_residence
horde_details
contains_mercenaries
upkeep
active_stance
can_activate_stance
morale
is_armed_citizenry
will_suffer_any_attrition
can_recruit_agent_at_force
can_recruit_unit
can_recruit_unit_class
can_recruit_unit_category
recruitment_items
recruitment_item_count
strength
command_queue_index
has_effect_bundle
effect_bundles
force_type
pooled_resource_manager
bonus_values
is_set_piece_battle_army
set_piece_battle_army_key
lookup_streak_value
mercenary_pool
get_plague_if_infected
try_get_military_force_plague
Military Force Slot
A military force slot interface represents a building slot within a horde-type military_force
.
Military Force Slot List
A list of military_force_slot
interfaces.
Military Force Type
Represents a military_force
type record.
Model
The model script interface is the root object of the model hierarchy. It is accessible from many other objects, and can be accessed at any time by calling cm:model.
MODEL_SCRIPT_INTERFACE
is_null_interface
world
pending_battle
date_in_range
date_and_week_in_range
turn_number
campaign_type
campaign_name
campaign_name_key
session_id
random_percent
random_int
is_multiplayer
is_player_turn
character_can_reach_character
character_can_reach_settlement
character_can_reach_position
character_can_reach_character_in_stance
character_can_reach_settlement_in_stance
character_can_reach_position_in_stance
character_can_ever_reach_position
character_can_ever_reach_character
character_can_ever_reach_settlement
difficulty_level
combined_difficulty_level
faction_is_local
player_steam_id_is_odd
campaign_ai
prison_system
family_member_for_command_queue_index
character_for_command_queue_index
military_force_for_command_queue_index
faction_for_command_queue_index
unit_for_command_queue_index
has_family_member_command_queue_index
has_character_command_queue_index
has_military_force_command_queue_index
has_faction_command_queue_index
has_unit_command_queue_index
logical_position_for_display_position
display_position_for_logical_position
debug_drawing
shared_states_manager
unit_size_multiplier
lookup_family_member_by_startpos_id
lookup_character_by_startpos_id
unit_caste
manual_saves_disabled
Modify Ritual Performing Character List
A list of modify_ritual_performing_character
interfaces.
Modify Ritual Performing Character
A modifiable performing character for a modifiable ritual. The character performing the ritual may be queried and replaced with this interface. A modify_ritual_performing_character_list
of such character interfaces may be retrieved from a modify_ritual_setup
interface.
This interface is a mutable relative of ritual_performing_character
.
Modify Ritual Performing Character
A modifiable ritual interface, which may be used to customise a ritual in script. An object with this interface may be created by calling cm:create_new_ritual_setup
, or the clone_as_modify_interface
function on the ritual_setup
script interface.
Once a ritual has been sufficiently modified, it may be passed in to cm:perform_ritual_with_setup
to be performed.
Modify Ritual Target
A modifiable target for a modifiable ritual. The target of the ritual may be queried and replaced with this interface. An object with this interface may be retrieved from the modify_ritual_setup
interface.
MODIFY_RITUAL_TARGET_SCRIPT_INTERFACE
is_null_interface
valid
target_faction_status
target_region_status
target_force_status
target_type
target_record_key
get_target_faction
get_target_region
get_target_force
is_faction_valid_target
is_region_valid_target
is_force_valid_target
can_target_self
status_for_faction_target
status_for_region_target
status_for_force_target
get_all_valid_target_forces_in_faction
get_all_valid_target_regions_in_faction
get_all_valid_target_factions
clear
set_target_faction
set_target_region
set_target_force
Null Script Interface
An empty interface, returned in situations where a requested interface doesn't exist.
Observation Options
Observation options represent choices made about the amount of information shown to the local player during the end-turn sequence. Observation options objects can be retrieved from the world
interface, modified, and then applied with the episodic_scripting
interface - see the Character Observation Options
section of this documentation.
Pending Battle
The pending battle script interface represents a currently-active battle sequence. The battle may or may not have taken place yet. A pending battle object may be retrieved from various battle-related script events and from the model
interface.
PENDING_BATTLE_SCRIPT_INTERFACE
is_null_interface
has_attacker
has_defender
has_contested_garrison
model
attacker
secondary_attackers
defender
secondary_defenders
contested_garrison
is_active
attacker_is_stronger
percentage_of_attacker_killed
percentage_of_defender_killed
percentage_of_attacker_routed
percentage_of_defender_routed
attacker_commander_fought_in_battle
defender_commander_fought_in_battle
attacker_commander_fought_in_melee
defender_commander_fought_in_melee
attacker_won
defender_won
is_draw
attacker_battle_result
defender_battle_result
attacker_casulaties
defender_casulaties
attacker_kills
defender_kills
attacker_ending_cp_kill_score
defender_ending_cp_kill_score
attacker_total_hp_lost
defender_total_hp_lost
naval_battle
siege_battle
ambush_battle
failed_ambush_battle
night_battle
battle_type
attacker_strength
defender_strength
has_been_fought
set_piece_battle_key
has_scripted_tile_upgrade
get_how_many_times_ability_has_been_used_in_battle
region_data
logical_position
display_position
is_auto_resolved
ended_with_withdraw
Plague
The plague script interface represents a plague spread between military forces and regions.
Plague component
The plague component script interface represents the components that make up a plague.
Plague component list
A list of plague_component
interfaces.
Pooled Resource Factor List
A list of pooled_resource_factor
interfaces.
Pooled Resource Factor
A pooled resource factor is a means by which a pooled resource may be modified. These are listed in the pooled_resource_factors
database table.
Pooled Resource List
A list of pooled_resource
interfaces.
Pooled Resource Manager
A pooled resource manager links pooled_resource
objects to an something which they can be applied to, such as a faction
, military_force
or province
.
Pooled Resource
A pooled resource script interface represents a pooled resource, a design-driven currency of some kind like Oathgold, Grimoires, Skulls etc. Valid pooled resources are listed in the pooled_resources
database table. A pooled resource belongs to a pooled_resource_manager
, which is itself linked to some game object like a faction
or character
to which the pooled resource is associated.
Prison System
The top-level interface for the prison system. An object of this type can be accessed from the model
script interface.
Province List
A list of province
interfaces.
Province
A province script interface represents a province on the campaign map, containing one or more regions represented by region
script interfaces. The portion of a province that a faction controls is represented by a faction_province_manager
script interface.
Region Data List
A list of region_data
interfaces.
Region Data
A region data represents the base data for a region on the campaign map. This may or may not be represented by a region
or sea_region
.
Region List
A list of region
interfaces.
Region Manager
The region manager is a top-level object which provides information about regions and settlements on the campaign map.
Region
A region interface represents a region on the campaign map. A region is the land area associated with a settlement
, and there are one or more regions within each province
. The region script interface is a key interface, and is provided by many different script events and other interfaces.
Each region is associated with a region_data
script interface, which are also linked to sea_region
interfaces.
REGION_SCRIPT_INTERFACE
is_null_interface
cqi
model
owning_faction
slot_list
settlement
garrison_residence
name
province_name
public_order
num_buildings
slot_type_exists
building_exists
last_building_constructed_key
resource_exists
any_resource_available
adjacent_region_list
building_superchain_exists
is_abandoned
can_recruit_agent_at_settlement
faction_province_growth
faction_province_growth_per_turn
gdp
is_province_capital
has_development_points_to_upgrade
has_faction_province_slaves
num_faction_province_slaves
max_faction_province_slaves
percentage_faction_province_slaves
has_active_storm
region_data_interface
get_selected_edict_key
get_active_edict_key
foreign_slot_managers
foreign_slot_manager_for_faction
effect_bundles
faction_province_effect_bundles
has_effect_bundle
faction_province_has_effect_bundle
province
faction_province
pooled_resource_manager
bonus_values
is_contained_in_region_group
get_plague_if_infected
characters_in_region
Resource Transaction
The resource cost of a transaction. Currently associated with an active_ritual
interface, indicating the cost of that ritual when performed.
Ritual Performing Character List
A list of ritual_performing_character
interfaces.
Ritual Performing Character
A character performing a ritual. This is related to modify_ritual_performing_character
, but this interface is immutable. A ritual_performing_character_list
of such interfaces may be obtained from a ritual_setup
interface.
Ritual Performing Character Status
The validity status of a ritual_performing_character
performing a ritual.
Ritual Setup
An unmodifiable interface representing the setup of a ritual. See also modify_ritual_setup
.
Ritual Status
An unmodifiable interface representing the status of a ritual. An object of this interface can be obtained from the faction_rituals
interface.
RITUAL_STATUS_SCRIPT_INTERFACE
is_null_interface
available
disabled
cannot_afford_resource_cost
unlock_mission_not_completed
chain_locked
prior_chain_stages_incomplete
already_completed_in_chain
on_cooldown
chain_locked_by_another_faction
reaction_constraints_not_met
not_enough_slaves
no_available_ritual_sites
script_locked
war_declaration_required
invalid_performing_characters
invalid_target
blocked_by_pending_battle
blocked_by_pending_action
Ritual Target Faction Status
An unmodifiable interface representing the status of a faction
that's the target of a ritual. This interface is a child of the modify_ritual_target
and ritual_target
interfaces.
Ritual Target Military Force Status
An unmodifiable interface representing the status of a military_force
that's the target of a ritual. This interface is a child of the modify_ritual_target
and ritual_target
interfaces.
Ritual Target Region Status
An unmodifiable interface representing the status of a region
that's the target of a ritual. This interface is a child of the modify_ritual_target
and ritual_target
interfaces.
Ritual Target
An unmodifiable interface representing the target of a ritual. This is an immutable version of modify_ritual_target
. Objects of this type may be obtained from the active_ritual
and ritual_setup
interfaces.
RITUAL_TARGET_SCRIPT_INTERFACE
is_null_interface
valid
target_faction_status
target_region_status
target_force_status
target_type
target_record_key
get_target_faction
get_target_region
get_target_force
is_faction_valid_target
is_region_valid_target
is_force_valid_target
can_target_self
status_for_faction_target
status_for_region_target
status_for_force_target
get_all_valid_target_forces_in_faction
get_all_valid_target_regions_in_faction
get_all_valid_target_factions
Route Network
An interface representing a network of nodes, as the Caravans network for Cathay. An object with this interface may be obtained by calling the lookup_route_network
function on the world
interface. A list of route networks may be found in the campaign_map_route_networks
database table.
Route Node List
A list of route_node
interfaces.
Route Node
An interface representing a node in a route_network
.
Route Path
An interface representing the path a caravan
is taking through a route_network
.
Route Position
An interface representing the position of a caravan
alongh a route_path
. Objects with this interface are supplied by caravan-related script events and the caravan
and route_node
interfaces.
Route Segment List
A list of route_segment
interfaces.
Route Segment
An interface representing a link between two route_node
objects on a route_network
.
Sea Region List
A list of sea_region
interfaces.
Sea Region Manager
A central interface which can be queried for information about sea_region
entities in the game. This interface can be accessed from the world
script interface.
Sea Region
An interface representing a region of sea. This is linked to a region_data
interface.
Settlement
A settlement interface represents a settlement on the campaign map. It is most-commonly accessed through the region
interface, and is also related to the garrison_residence
interface.
SETTLEMENT_SCRIPT_INTERFACE
is_null_interface
key
cqi
has_commander
logical_position_x
logical_position_y
display_position_x
display_position_y
model
commander
faction
region
slot_list
is_port
get_climate
display_primary_building_chain
primary_building_chain
primary_slot
port_slot
active_secondary_slots
first_empty_active_secondary_slot
is_walled_settlement
number_of_wall_breaches
Shared States Manager
A central interface, accessed through the model
interface, which can be used to query shared state values. Shared state values are accessible by the campaign model, UI and script, and can be used to empower functionality shared between all three. See also the Shared States
section of the episodic_scripting
documentation.
Slot List
A list of slot
interfaces.
Slot
A slot interface represents a building slot in a settlement
, within which a building
may be constructed (or may already exist). It is related to the military_force_slot
interface which represent a building slot within a horde-type military_force
.
Teleportation Network List
A list of teleportation_network
interfaces.
Teleportation Network
An interface representing a teleportation network, such as as network between the Realms of Chaos. Such an interface may be obtained from an teleportation_network_system
object.
Teleportation Network System
A central interface to the teleportation network system, accessible from the world
script interface.
Teleportation Node List
A list of teleportation_node
interfaces.
Teleportation Node Record List
A list of teleportation_node_record
interfaces.
Teleportation Node Record
A record related to a teleportation_node
. Objects with this interface are returned by various teleportation-network-related script events.
Teleportation Node
An interface representing an active node on a teleportation_network
.
Unique Agent Details List
A list of unique_agent_details
interfaces.
Unique Agent Details
An interface representing the details of a unique agent, such as the Green Knight. A faction
interface may be queried for a unique_agent_details_list
of unique agents the faction contains. Furthermore, objects with this interface are returned by various unique-agent-related script events.
Unit List
A list of unit
interfaces.
Unit Purchasable Effect List
A list of unit_purchasable_effect_list
interfaces.
Unit Purchasable Effect
An interface that represents a unit purchasable effect. Objects with this interface are returned by the various unit-purchased-effect-related script events, and a unit_purchasable_effect_list
of such interfaces is obtainable from the unit
script interface.
Unit
An interface that represents a unit belonging to a military_force
.
UNIT_SCRIPT_INTERFACE
is_null_interface
command_queue_index
has_force_commander
has_unit_commander
is_land_unit
is_naval_unit
model
force_commander
unit_commander
military_force
unit_key
unit_category
unit_class
unit_caste
faction
percentage_proportion_of_full_strength
experience_level
can_upgrade_unit_equipment
can_upgrade_unit
get_unit_custom_battle_cost
has_banner_ancillary
banner_ancillary
can_purchase_effect
get_unit_purchasable_effects
get_unit_purchased_effects
can_unpurchase_effect
War Co-ordination
A central interface to access war co-ordination information. This interface is returned by the cm:war_coordination
function on the episodic_scripting
interface, which allows it to be mutable (changes to the model can be made through it).
Winds of Magic Compass
A central interface to access the compass system. This is accessible from the world
script interface.
World
World is a central interface that provides access to a variety of other game objects. It is primarly accessible from the model
interface.
WORLD_SCRIPT_INTERFACE
is_null_interface
faction_list
region_manager
sea_region_manager
model
province_list
province_exists
province_by_key
faction_by_key
faction_exists
ancillary_exists
climate_phase_index
whose_turn_is_it
is_factions_turn_by_key
region_data
land_region_data
sea_region_data
region_data_at_position
region_data_for_key
observation_options_for_faction
observation_options_for_allies
observation_options_for_enemies
observation_options_for_neutrals
cooking_system
faction_character_tagging_system
caravans_system
lookup_route_network
winds_of_magic_compass
characters_owning_ancillary
teleportation_network_system
faction_strength_rank
lookup_factions_from_faction_set
lookup_regions_from_region_group