Functions without document

From Total War Modding

This page will include information about functions without a document, or the document has the wrong information.


cm:add_unit_to_province_mercenary_pool(region_script_interface region, string unit_key, string recruitment_source, number unit_count, number replen_chance, number max_units, number max_replen_per_turn, string faction_requirement, string subculture_requirement, string culture_requirement, boolean use_partial_replen, string merc_unit_group)

This one is used to add province mercenaries, in the case of Wh3, they're used for undead's raise dead and Warrior of Chaos' Warband recruitment. The document has the wrong parameters for this function, and the vanilla does not use it, so make sure to check the correct parameters


cm:is_agent_transformation_available(string agent_subtype_key)

Returns true if your agent_subtype is in the DB campaign_to_agent_subtypes_tables with the given campaign. Especially useful if you want to check certain agent_subtype is unique. (Given that modders have added it to that table)


cm:military_force_add_temporary_stance(number mf_cqi,string stance, number turn)

Can be used to give a certain stance to a military force for a time even if that faction does not have access to the stance via campaign_stances_factions_junctions_tables. If 0 is given to turn, it will be infinite.


cm:faction_set_total_potential_override_value(FACTION_SCRIPT_INTERFACE faction, bool use_override_value, int32 total_potential_override_value) – bypasses the faction potential calculation and sets a fixed value

ex: cm:faction_set_total_potential_override_value(cm:get_faction("wh3_main_dae_daemon_prince"), true, 500) This will forcibly set the Daemon Prince's faction potential to 500


cm:faction_set_potential_modifier(FACTION_SCRIPT_INTERFACE faction, int32 faction_potential_modifier) – Calculates the faction potential as normal, then modifies it by an additional amount

ex: cm:faction_set_potential_modifier(cm:get_faction("wh3_main_dae_daemon_prince"), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total.


cm:set_plague_component_state(faction_script_interface faction, string component, string state, boolean set_to_blessed)

Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.


While not function, and is in the document, I'll include it here since Chadvandy does not have it yet.

This listener listens for the faction death and supports these in the contexts

- killer(): Faction that killed this faction

- faction(): Faction that died

- is_game_over(): Is the game over


Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking