Functions without document: Difference between revisions

From Total War Modding
(additions)
(faction potential)
 
(One intermediate revision by the same user not shown)
Line 26: Line 26:
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes & cm:pending_battle_cache_get_defender_embedded_character_subtypes ==
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes & cm:pending_battle_cache_get_defender_embedded_character_subtypes ==
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')
Returns table ''embedded_character_subtypes''




Line 41: Line 43:


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.  
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 ==
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 ==
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 ==
== cm:set_plague_component_state ==
Line 58: Line 70:
- faction(): Faction that died
- faction(): Faction that died


- is_game_over(): Is game over
- is_game_over(): Is the game over
[[Category:Script]]
[[Category:Script]]

Latest revision as of 14:45, 10 June 2024

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

cm:add_unit_to_faction_mercenary_pool

cm:add_unit_to_faction_mercenary_pool(faction_script_interface faction, 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:instantly_research_technology

cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})

Instantly completes research for the specified technology for the specified faction

cm:instantly_research_all_technologies

cm:instantly_research_all_technologies(${1:string faction key})


Instantly completes research on all technologies for the specified faction

cm:instantly_clear_all_technologies

cm:instantly_clear_all_technologies(${1:string faction key})


Instantly resets all technologies for the specified faction to an unresearched state.

cm:pending_battle_cache_get_attacker_embedded_character_subtypes & cm:pending_battle_cache_get_defender_embedded_character_subtypes

cm:pending_battle_cache_get_defender_embedded_character_subtypes(number index_of_defender)

Returns table embedded_character_subtypes


Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.

cm:is_agent_transformation_available

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

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

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

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

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


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

FactionDeath

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