<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tw-modding.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rhox</id>
	<title>Total War Modding - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://tw-modding.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rhox"/>
	<link rel="alternate" type="text/html" href="https://tw-modding.com/wiki/Special:Contributions/Rhox"/>
	<updated>2026-05-13T18:24:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1379</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1379"/>
		<updated>2025-12-29T14:57:24Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== Other vanilla using functions ==&lt;br /&gt;
cm:set_force_sphere_of_influence_radius&lt;br /&gt;
&lt;br /&gt;
cm:entity_add_pooled_resource_transaction&lt;br /&gt;
&lt;br /&gt;
cm:awaken_faction_from_death&lt;br /&gt;
&lt;br /&gt;
cm:sabotage_garrison_army&lt;br /&gt;
&lt;br /&gt;
cm:campaign_var_int_value&lt;br /&gt;
&lt;br /&gt;
cm:entity_transfer_pooled_resource&lt;br /&gt;
&lt;br /&gt;
cm:remove_override_building_chain_display_from_region(display_chain, region_key)&lt;br /&gt;
&lt;br /&gt;
cm:get_override_building_chain_display_for_region(display_chain, region_key)&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1378</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1378"/>
		<updated>2025-12-10T09:26:56Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Other vanilla using functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== Other vanilla using functions ==&lt;br /&gt;
cm:set_force_sphere_of_influence_radius&lt;br /&gt;
&lt;br /&gt;
cm:entity_add_pooled_resource_transaction&lt;br /&gt;
&lt;br /&gt;
cm:awaken_faction_from_death&lt;br /&gt;
&lt;br /&gt;
cm:sabotage_garrison_army&lt;br /&gt;
&lt;br /&gt;
cm:campaign_var_int_value&lt;br /&gt;
&lt;br /&gt;
cm:entity_transfer_pooled_resource&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1377</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1377"/>
		<updated>2025-12-10T09:21:45Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Other vanilla using functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== Other vanilla using functions ==&lt;br /&gt;
cm:set_force_sphere_of_influence_radius&lt;br /&gt;
&lt;br /&gt;
cm:entity_add_pooled_resource_transaction&lt;br /&gt;
&lt;br /&gt;
cm:awaken_faction_from_death&lt;br /&gt;
&lt;br /&gt;
cm:sabotage_garrison_army&lt;br /&gt;
&lt;br /&gt;
cm:campaign_var_int_value&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1376</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1376"/>
		<updated>2025-12-10T09:18:33Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Other vanilla using functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== Other vanilla using functions ==&lt;br /&gt;
cm:set_force_sphere_of_influence_radius&lt;br /&gt;
&lt;br /&gt;
cm:entity_add_pooled_resource_transaction&lt;br /&gt;
&lt;br /&gt;
cm:awaken_faction_from_death&lt;br /&gt;
&lt;br /&gt;
cm:sabotage_garrison_army&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1375</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1375"/>
		<updated>2025-12-10T09:14:17Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== Other vanilla using functions ==&lt;br /&gt;
cm:set_force_sphere_of_influence_radius&lt;br /&gt;
&lt;br /&gt;
cm:entity_add_pooled_resource_transaction&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1374</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1374"/>
		<updated>2025-12-07T14:27:42Z</updated>

		<summary type="html">&lt;p&gt;Rhox: 7.0 changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_mercenary_pool(region_script_interface ''region'', string ''unit_key'', string ''mercenary pool'', 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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1366</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1366"/>
		<updated>2025-10-08T03:42:35Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with the community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the users use only one startpos mod, Mixer. Technically, IEE and TOW are also startpos mods. But they're made to have each entry the same as Mixer and Chaos Robie's stuff are appended manually.  &lt;br /&gt;
&lt;br /&gt;
Due to this characteristic, &lt;br /&gt;
Modders have made several works around for many startpos-only features, some parts are still startpos bound and need Mixer's work though. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture. This would also mean the culture you added won't work due to this. Even if your faction does not have heroes, there is also the tech issue. &lt;br /&gt;
* Slot types used for Landmarks: Same as above, Mixu makes slots for each region. &lt;br /&gt;
* Potential for each faction: Same. &lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use the Mixer faction requests thread if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete. Also, Mixu prefers batch work rather than getting small requests multiple times&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. &lt;br /&gt;
** '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, you need startpos. You don't normally need it unless you're going to make a quest battle for the leader. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
* Name group: You can make the name after apwning, but you can't make the name to appear in the recruitment section.&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
* Horde marker in the diplomacy panel: It's related to the feature forest, and the script below does not change this. Theoretically, you can change it with the script to change the icon and tooltip. (But I haven't tried)&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that use this function&lt;br /&gt;
* Settings like starting region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the vanilla techs you want to remove access from your faction. Otherwise, AI can research it plus will create research available alarm to the player when they have researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Use the faction column in the node tables to override the vanilla one. Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to cover all the vanilla tech nodes. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech key. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the node the user has made. If you send all the vanilla nodes to a place with this method to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node sets like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Need some script work but also works. Do note that it can cause problems if another mod adds a tab of its own, but you can create compatibility if you want to.&lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, but you can use other ways.&lt;br /&gt;
** You can use the cm:add_or_remove_faction_features() function in the script to remove or add features from a certain faction&lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables if you want to change accessible features of all the factions of that feature forest&lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1343</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1343"/>
		<updated>2025-09-17T02:58:15Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* cm:add_unit_to_province_mercenary_pool */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This one is used to add province mercenaries. In the case of Wh3, they're used for the 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.&lt;br /&gt;
&lt;br /&gt;
Also, one province can have only one main unit added via this function. So if you added a zombie with a faction Alpha restriction with this function, and add another zombie with the faction Beta restriction with this function, Alpha won't have access to the zombie since that one is overridden.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1318</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1318"/>
		<updated>2025-01-12T04:24:12Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Making own twui */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have any ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.    &lt;br /&gt;
&lt;br /&gt;
Note, if your TWUI references another GUID of other TWUI in command, it shouldn't be changed in most cases. As the referenced component's GUID isn't getting changed. EX: Component(&amp;amp;amp;quot;17A9800A-927B-1EF3-753A8CCD4148C7DB&amp;amp;amp;quot;) and the GUID is directing to the component in the hud_campaign     &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should use cm:get_local_faction thing&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Apply this script to the mod, and start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created, even in the component viewer: Check the script, and whether your twui has the correct structure. If you've set up all correctly, check the callbacks of the TWUI components. Very rarely some of them have 'destroy callbacks' in them&lt;br /&gt;
#Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy&lt;br /&gt;
#Things are not showing properly: Check the DBs and references of the DBs in the twui are correct.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1317</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1317"/>
		<updated>2025-01-09T14:32:18Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Getting Original Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have any ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.    &lt;br /&gt;
&lt;br /&gt;
Note, if your TWUI references another GUID in command, it shouldn't be changed in most cases. As the referenced component's GUID isn't getting changed. EX: Component(&amp;amp;amp;quot;17A9800A-927B-1EF3-753A8CCD4148C7DB&amp;amp;amp;quot;)     &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should use cm:get_local_faction thing&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Apply this script to the mod, and start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created, even in the component viewer: Check the script, and whether your twui has the correct structure. If you've set up all correctly, check the callbacks of the TWUI components. Very rarely some of them have 'destroy callbacks' in them&lt;br /&gt;
#Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy&lt;br /&gt;
#Things are not showing properly: Check the DBs and references of the DBs in the twui are correct.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Troubleshooting&amp;diff=1284</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Troubleshooting&amp;diff=1284"/>
		<updated>2024-07-29T11:35:51Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Generic pointers: */ https://discord.com/channels/373745291289034763/731080362758766652/1267442399588909056&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a troubleshooting guide for mod users in TW: Warhammer 3. There will be different details and more or less big variations, beginning with what mod managers you could use, but generic pointers should be valid for all recent TW games.&lt;br /&gt;
&lt;br /&gt;
– Your neighbourhood Cataph&lt;br /&gt;
&lt;br /&gt;
''last updated in may 2024''&lt;br /&gt;
&lt;br /&gt;
== Managing Mods ==&lt;br /&gt;
So, you have subscribed to mods on the workshop, I say, as I lift one foot to rest on a stool and one arm on that knee for stereotypical posture. By default, you'll obviously be using CA’s mod manager (hereby called George by emulating CA's name-giving tradition) from the game's launcher to enable, remove or whatever the mods you have subscribed to. &lt;br /&gt;
&lt;br /&gt;
However, while George got some upgrades in the past years and has resolved some of its most painful problem, it's still fairly limited in what it does. There is a recommendation at this point of grabbing a community-made mod managers, and oh boy we're so lucky we even have a selection. I cannot in good conscience offer pros/cons of each as I didn't make that kind of comparison within WH3.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Kaedrin/warhammer-mod-manager/releases/ Kaedrin's]: first of this lot, works across multiple titles.&lt;br /&gt;
* [https://github.com/Shazbot/WH3-Mod-Manager/releases/ PropJoes's, aka WH3MM].&lt;br /&gt;
* [https://github.com/Frodo45127/runcher/releases/ Runcher]: made by Frodo, same guy behind RPFM, the modding tool.&lt;br /&gt;
&lt;br /&gt;
These managers have something in common, which is offering a whole lot of options compared to George: making groups of mods, ease of opening them with RPFM or reaching their workshop page, backup and cloning options, cool stuff like that. '''''Personally''''', I'm currently using the second, PJ's, because it was the first of these to work for WH3 and I never had reasons to change back to KMM or try Runcher, but that is my personal choice and habit. Pick your favourite. Inevitably, this guide will also be written in a way that is influenced by this choice of mine; some things or options will be worded differently for the other MMs, be in different spots, or not be there. You get the drift though.&lt;br /&gt;
&lt;br /&gt;
== How to Load Order ==&lt;br /&gt;
[[File:Load order bad.png|thumb|BAD]]&lt;br /&gt;
All of these managers, including George, have functions to manually change mod listing and how mods are loaded, which speaks to the old habit of handling load order within other modding communities, so you’d be tempted to change it manually to make things work just right, right?&lt;br /&gt;
&lt;br /&gt;
'''''WRONG.'''''&lt;br /&gt;
&lt;br /&gt;
Ok, I’ll spare some time for this before we get into the actually useful tips, because this is one of the nastiest tropes in the context. The truth is that compatibility-minded TW modders already handle load order on their own as far as possible. Manually changing load order may do absolutely nothing, shift the problem somewhere else or break everything.&lt;br /&gt;
&lt;br /&gt;
Some context. There are six main possible categories of folders in a mod pack and this is how they handle load order, either through actual '''pack name''' (the file name as the .pack gets downloaded) or '''table name''' (internal bits you won't see unless you open the pack):&lt;br /&gt;
&lt;br /&gt;
* '''Db''': table name.&lt;br /&gt;
* '''Scripts''': pack name.&lt;br /&gt;
* '''Startpos''' (the big bad): pack name. CEO for 3K is similar.&lt;br /&gt;
* '''Text''': table name.&lt;br /&gt;
* '''UI''': pack name.&lt;br /&gt;
* '''Variants''': pack name.&lt;br /&gt;
&lt;br /&gt;
And that is if the modder doesn’t redirect content (e.g., telling database to use a different icon from a different file path). There are things like balance submods (mostly Db overrides) that are still completely in the hands of the modders and intentionally so. In essence, packs should be ordered alphabetically and let the inner bits do their thing.&lt;br /&gt;
&lt;br /&gt;
In other words, there are only two possible cases in which you may want to alter load order manually: UI and variants, basically if you want to use specific reskin B.pack in the midst of larger reskin A.pack, in which case you push B on top. But generally speaking this should be out of your mind or can be manually tweaked with a bit more care.&lt;br /&gt;
&lt;br /&gt;
''In conclusion, give Steam time to download/remove mods and keep load order in an alphabetical fashion (e.g. order by name and save profile), especially after adding new mods.''&lt;br /&gt;
&lt;br /&gt;
Which, incidentally, is this:&lt;br /&gt;
&lt;br /&gt;
! # $ % &amp;amp; ‘ ( ) + , – ; = @ 0-9 a-z [ ] ^ _ ` { } ~&lt;br /&gt;
&lt;br /&gt;
Where “!” wins over “a”.&lt;br /&gt;
&lt;br /&gt;
Sometimes, mod descriptions will tell you to manually alter load order to make that mod work over another, but quite frankly that is either unnecessary or the modder didn't do their homework to make sure that worked ''anyway'' (e.g., already making sure their pack and table names were right).&lt;br /&gt;
&lt;br /&gt;
== Common Troubleshooting ==&lt;br /&gt;
Ok, this is probably the reason you're here, ''something'' is wrong in your mod list and you need to find out what. &lt;br /&gt;
&lt;br /&gt;
In an efficient mod, at least half of the reported issues are down to user error or what is technically called launcher f***-up. We’re going to try and cut that amount down for the greater good.&lt;br /&gt;
&lt;br /&gt;
Let's get two things out of the way immediately:&lt;br /&gt;
&lt;br /&gt;
*'''When in doubt, redownload''': Steam Workshop is acceptable for many things but it does have some god-awful behaviours. One of these is getting you a version of the mod that is either 1) older than it should be or 2) straight up a corrupted and broken file. This means crashing when it's obviously not supposed to happen, or getting older, possibly broken, features. This is particularly painful around patch time, of course. And it is painfully common, so please, seriously, verify that this is not your case before rushing to a comment section to say &amp;quot;mod crash&amp;quot;. Your options are:&lt;br /&gt;
**'''Force download''' with a community manager (e.g., right click on the specific mod and click it, or PJ's can do it for all mods).&lt;br /&gt;
**Go to the mod's Steam page, unsuscribe and resuscribe after a pause, aka the unsub/resub cycle.&lt;br /&gt;
**Go to the game's content folder and physically delete the folder or pack.[[File:Steam workshop mod dates.jpg|thumb|If that last date doesn't match, clearly you got an old version]]&lt;br /&gt;
&lt;br /&gt;
NONE OF THESE is guaranteed to work, especially on a first attempt. Keep that in mind and keep trying when things are fishy, e.g. the &amp;quot;last updated&amp;quot; date on your mod manager is older than Update: DD/MM on its workshop page on the top right. &lt;br /&gt;
&lt;br /&gt;
Yes, this is tiresome, but trust me, '''if Steam is doing this to the mod, and it's very common that it does, we modders can't do anything for you'''. And if the wretched modder actually pushed an update that crashed the game, they'll know by the sheer amount of reports.&lt;br /&gt;
&lt;br /&gt;
So if a mod that clearly shouldn't be crashing (or having pre-patch features) but it keeps doing it for you, just keep forcing the update locally for your game. And maybe go pester Valve for a fix.&lt;br /&gt;
&lt;br /&gt;
== User good practices: ==&lt;br /&gt;
The following is a list of tips that you should observe in general when dealing with TW mods. &lt;br /&gt;
&lt;br /&gt;
''This list is of course not meant to insult anybody’s intelligence, but you’d be surprised at how many issues and massive wastes of time are due to neglect of these simple rules. Following them is in the user’s interest in order to find a solution sooner, and it will allow the modder more time for improvement rather than wasting their precious free time in unnecessary bug-hunts.''&lt;br /&gt;
# '''Read the mod description.''' Seriously, this alone would prevent 80% of comments on Steam pages. Even if a description looks long, do it, at least skim it to parse the important bits, it’s there for a reason. Some mods will also have FAQs or a list of known issues, incompatibilities and instructions. Read the comments before yours too if you have to post one. There’s an excellent chance the question you’re going to ask is already answered in in descriptions, FAQs and recent comments. Also, it's always good to know what the mod you grabbed actually do, so you know where stuff might be coming from.&lt;br /&gt;
# '''Don’t ignore the required items.''' The mod may show you a popup upon subscribing, disregarding that is almost always cue for disaster. This popup is ''not'' shown when subbing from a Steam collection (thanks Gaben), so actually check the mod’s page. PJ's MM will warn you about this if you haven't enabled important mods.&lt;br /&gt;
# '''Keep load order alphanumerical.''' We’ve been over that already. If you have new mods that have somehow popped at the tail of the list, just reset the mod list, e.g., click twice again on the &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt; column in George until it looks alphabetical.&lt;br /&gt;
# '''Troubleshoot yourself!''' The thing is, we don’t have time to help everybody, and in most cases the problem is local. Test if the issue happens when only that mod is enabled (plus any other that it requires); if you don't know what mod is doing the thing, bisect the mod list (e.g., load only half of it, PJ's MM can do it semi-automatically). We’ll get to best practices on this, don’t worry.&lt;br /&gt;
# '''Issue Context''': upon commenting about an issue, provide as much info as possible. Ok, you did everything right but that ugly bug is still there. That’s fine. The worst thing you could do at this point is comment “mod doesn’t work” because that means absolutely nothing. Modders aren’t usually telepaths, although we might be developing a sense of it under environmental pressure. Steam comments aren’t the best place for this, so use a discussion or the discord server/channel lurked by that given modder. If you still haven't figured out which mod is doing it and need help, use the #mod_user_troubleshooting channel in the [https://discord.gg/moddingden Modding Den].&lt;br /&gt;
#* Context: when and how the thing happened. E.g. during the interturn after X’s turn, or clicking this button, whether it was mortal empires campaign or not, multiplayer, custom battle or campaign battle.&lt;br /&gt;
#* Mod list: if asked, link a collection or post a screenshot of the mod list (possibly not in George). For example, the big thing is not being naïve enough that the overhaul in your list can’t affect other mods. For some reason, sometimes it feels like pulling teeth to know what else is there. However, if your mod list is longer than, say, 40 items, don't expect people to miraculously figure out what's going on while just reading through 200 mod names.&lt;br /&gt;
#* Screenshot: always helps for clarity and visual context. &lt;br /&gt;
#* Save game: if requested, you can find your save game in (example) C:\Users\%USER%\AppData\Roaming\The Creative Assembly\Warhammer2\save_games. Remember the mod list, because the modder may not be able to load without it.&lt;br /&gt;
#* Results of your own troubleshooting: for example it’s good to know it happens with that one mod only. Relatedly, if you posted about an issue and later find the cause, let us know.&lt;br /&gt;
# '''&amp;quot;It doesn't crash so it works&amp;quot;'''. Don't assume your mod list is working just because it's not currently blowing up your computer or it didn't murder your cat. A crash is only the most visible of symptoms, it's like assuming a coal miner is perfectly fine just because they haven't dropped dead yet. You may have all kinds of issues in your 400-mods list ranging from fucked models to script breaks. Did I mention don't use 400 mods? Yeah nah, probably don't.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: Trimming the Mod List ==&lt;br /&gt;
There is no such thing as a mod cap in WH3, which is another common trope. It’s up to you to keep your mod list functional, and '''the more mods you run the more likely you are to encounter issues, or just to see maintenance time increase for you'''. Making your mod list work is up to how careful you are. '''Remember, just because your list doesn’t produce an instant crash you can’t be sure there aren’t less visible issues''', e.g. script breaks.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, don’t be cocky with your list of 250 mods. It’s all fun and games until everything works perfectly (and with those numbers chances are it doesn’t already, you just can’t see it), at which point there’s a lot of stuff to check. Even if 300 out of 350 are reskins you would entrust with your house keys, it all adds to the volume of annoyance if something goes wrong. For example, maybe don't enable mods that affect stuff you will NEVER see as a player for a given campaign.&lt;br /&gt;
&lt;br /&gt;
If you’re not experienced yet (and don’t assume you are just because you played Skyrim, this is different), use the mod list of someone that has very carefully been curating it, and check that it looks ok with the help of the modders themselves. For example, start by a modder’s own collection on Steam, they often have one.&lt;br /&gt;
&lt;br /&gt;
=== Finding the culprit ===&lt;br /&gt;
The usual problem with large mod lists is this: bad, I got a crash; worse, which one of the N mods I have is the culprit?&lt;br /&gt;
&lt;br /&gt;
==== Generic pointers: ====&lt;br /&gt;
&lt;br /&gt;
* Pure Text, Variant, and simple icon replacement mods will hardly ever be able to cause a crash for the user (assuming the modder ever tested their changes). &lt;br /&gt;
** It's possible for text to have some specific and crashy missing references, and for UI mods to have more complex TWUI files for panel structure and interfaces, and those can cause problems. Again, if translation mods tell you to change load order, those might be doing something very risky and frankly daft. &lt;br /&gt;
** If variants crash, such as trying to open a character's panel and getting a CTD because it's trying to load its 3d full portrait, try fiddling with your graphic settings and report back to the modder.&lt;br /&gt;
* Momentarily sort by date on the MM to find the most recent updates, if you didn’t add additional mods those ''may'' (just may) be responsible.&lt;br /&gt;
* If you had the issue during a campaign, do not remove mods that have custom items, units or buildings because you’re just going to crash harder if those are around in the campaign map.&lt;br /&gt;
* Watch out for movie packs. These are packs with a specific setting that long story short used to be required for some things but it may cause them to automatically fire despite being disabled. In WH3, these are really only necessary (as of may '24) for new audio content. If you’re inexplicably crashing even with no mods on, you might have a movie pack with crashy data in it and the modder might need screaming at.&lt;br /&gt;
&lt;br /&gt;
==== Bisect and Conquer: ====&lt;br /&gt;
[[File:Bisect wh3mm.jpg|thumb|Within PJ's WH3MM, within Other Options]]&lt;br /&gt;
Especially when dealing with big mod lists, the quickest method is to enable half of it. If you crash, that’s the troublesome half. Halve again to tighten the noose.&lt;br /&gt;
&lt;br /&gt;
Keep in mind mod requirements while you do this.&lt;br /&gt;
&lt;br /&gt;
If you want to check on a particular mod, disable everything and load the bare minimum to make that mod work, in other words mod+whatever required mods that comes with. And up from there, adding one or small groups of mods at a time until you can reproduce the issue.&lt;br /&gt;
&lt;br /&gt;
It’s patient work but the modder will appreciate it, and it takes less than panicking for hours in a comment section. Assume that a modder won’t troubleshoot your mod list of 150 packs because you say it’s their mod doing it, unless they have proof because you tested without anything else plus requirements.&lt;br /&gt;
&lt;br /&gt;
Remember: a happy modder is a happy user.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: Scripts ==&lt;br /&gt;
Scripts are being increasingly used by mods. While most scripters are getting smarter by the day to maintain compatibility, some require a framework or some mods will just struggle to work when there are too many mods around.&lt;br /&gt;
&lt;br /&gt;
You may encounter symptoms of broken scripts, due to botched downloads, bad compatibility or just plain unforeseen issues because we can just mess stuff up sometimes. Script glitches may end up being tricky to root out.&lt;br /&gt;
&lt;br /&gt;
A few examples of broken scripts:&lt;br /&gt;
&lt;br /&gt;
* Starting lords that should be custom are not custom, or don’t spawn, or don’t have the correct army or settlement. (in some cases, this is intentionally delayed to turn 2 for performance reasons)&lt;br /&gt;
* Sword of Khaine button is unchained right off.&lt;br /&gt;
* Chaos and all Rogue armies may spawn immediately.&lt;br /&gt;
* Campaign camera on a fresh campaign starts zoomed-out and doesn’t pan in.&lt;br /&gt;
* Chivalry starts at 0.&lt;br /&gt;
* One of the worst, characters do not gain XP (this may sometimes happen in full vanilla too, requires repair).&lt;br /&gt;
&lt;br /&gt;
==== Scropt broken, what do? ====&lt;br /&gt;
Remember, it's always important to trim your mod list to determine the culprit/s. With scripts, there may be specific interactions that cause problems, such as trying to do thing A to thing B but another mod has already removed or changed B irreparably for that to work. &lt;br /&gt;
&lt;br /&gt;
When/if you report the issue to modders, remember to provide as much info as humanly possible because finding a script break can turn ugly and complicated.&lt;br /&gt;
&lt;br /&gt;
Particularly useful to help with scripting issues: please enable [https://steamcommunity.com/sharedfiles/filedetails/?id=1271877744 this debugger] (or enable the option in PJ's MM), reproduce the bug and send the resulting log, which will be a lenghty txt generated in ''Steam\steamapps\common\Total War WARHAMMER II''. Specific scripty mods may come with additional instructions in their mod descriptions/faqs.&lt;br /&gt;
&lt;br /&gt;
Do not keep the script logger enabled past this necessity, since it will noticeably slow down your game.&lt;br /&gt;
&lt;br /&gt;
One of the most frequent issues at the moment is a performance-related clog-up at the start of a campaign. This basically means that too many scripts are trying to fit into that time frame to do their stuff (legendary lords, changing armies, this kinda stuff) and results in some of them not working. This is where size of the mod list, in regards to any mod with a first-tick script, becomes serious.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: [https://steamcommunity.com/sharedfiles/filedetails/?id=1354363596 Mod Configuration Tool] ==&lt;br /&gt;
This other framework is used to provide settings for compatible mods, i.e. to tweak some details at your heart’s content. Usually a good thing to keep it around because there’s quite a few mods supporting it, or that may do it in the future. For example, you may use it to configure some scripts to fire in a performance mode to reduce impact on campaign start. &lt;br /&gt;
== APPENDIX: WH3, crashing on clicking Skirmish ==&lt;br /&gt;
The most likely cause for this right now is that you saved a character (that new fancy function in WH3 to play campaign characters into skirmishes) but it was originated or affected by a mod that you have since then removed. Kaboom. The other symptom is going kaboom when trying to recruit any hero or lord in campaign.&lt;br /&gt;
&lt;br /&gt;
Go in &amp;lt;code&amp;gt;C:\Users\user\AppData\Roaming\The Creative Assembly\Warhammer3\saved_characters&amp;lt;/code&amp;gt; (or search %appdata% in windows search, then continue to those folders) and delete them.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: the Powershell rummage ==&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Troubleshooting&amp;diff=1283</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Troubleshooting&amp;diff=1283"/>
		<updated>2024-07-29T11:03:51Z</updated>

		<summary type="html">&lt;p&gt;Rhox: /* Generic pointers: */ The case is different in Wh3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a troubleshooting guide for mod users in TW: Warhammer 3. There will be different details and more or less big variations, beginning with what mod managers you could use, but generic pointers should be valid for all recent TW games.&lt;br /&gt;
&lt;br /&gt;
– Your neighbourhood Cataph&lt;br /&gt;
&lt;br /&gt;
''last updated in may 2024''&lt;br /&gt;
&lt;br /&gt;
== Managing Mods ==&lt;br /&gt;
So, you have subscribed to mods on the workshop, I say, as I lift one foot to rest on a stool and one arm on that knee for stereotypical posture. By default, you'll obviously be using CA’s mod manager (hereby called George by emulating CA's name-giving tradition) from the game's launcher to enable, remove or whatever the mods you have subscribed to. &lt;br /&gt;
&lt;br /&gt;
However, while George got some upgrades in the past years and has resolved some of its most painful problem, it's still fairly limited in what it does. There is a recommendation at this point of grabbing a community-made mod managers, and oh boy we're so lucky we even have a selection. I cannot in good conscience offer pros/cons of each as I didn't make that kind of comparison within WH3.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Kaedrin/warhammer-mod-manager/releases/ Kaedrin's]: first of this lot, works across multiple titles.&lt;br /&gt;
* [https://github.com/Shazbot/WH3-Mod-Manager/releases/ PropJoes's, aka WH3MM].&lt;br /&gt;
* [https://github.com/Frodo45127/runcher/releases/ Runcher]: made by Frodo, same guy behind RPFM, the modding tool.&lt;br /&gt;
&lt;br /&gt;
These managers have something in common, which is offering a whole lot of options compared to George: making groups of mods, ease of opening them with RPFM or reaching their workshop page, backup and cloning options, cool stuff like that. '''''Personally''''', I'm currently using the second, PJ's, because it was the first of these to work for WH3 and I never had reasons to change back to KMM or try Runcher, but that is my personal choice and habit. Pick your favourite. Inevitably, this guide will also be written in a way that is influenced by this choice of mine; some things or options will be worded differently for the other MMs, be in different spots, or not be there. You get the drift though.&lt;br /&gt;
&lt;br /&gt;
== How to Load Order ==&lt;br /&gt;
[[File:Load order bad.png|thumb|BAD]]&lt;br /&gt;
All of these managers, including George, have functions to manually change mod listing and how mods are loaded, which speaks to the old habit of handling load order within other modding communities, so you’d be tempted to change it manually to make things work just right, right?&lt;br /&gt;
&lt;br /&gt;
'''''WRONG.'''''&lt;br /&gt;
&lt;br /&gt;
Ok, I’ll spare some time for this before we get into the actually useful tips, because this is one of the nastiest tropes in the context. The truth is that compatibility-minded TW modders already handle load order on their own as far as possible. Manually changing load order may do absolutely nothing, shift the problem somewhere else or break everything.&lt;br /&gt;
&lt;br /&gt;
Some context. There are six main possible categories of folders in a mod pack and this is how they handle load order, either through actual '''pack name''' (the file name as the .pack gets downloaded) or '''table name''' (internal bits you won't see unless you open the pack):&lt;br /&gt;
&lt;br /&gt;
* '''Db''': table name.&lt;br /&gt;
* '''Scripts''': pack name.&lt;br /&gt;
* '''Startpos''' (the big bad): pack name. CEO for 3K is similar.&lt;br /&gt;
* '''Text''': table name.&lt;br /&gt;
* '''UI''': pack name.&lt;br /&gt;
* '''Variants''': pack name.&lt;br /&gt;
&lt;br /&gt;
And that is if the modder doesn’t redirect content (e.g., telling database to use a different icon from a different file path). There are things like balance submods (mostly Db overrides) that are still completely in the hands of the modders and intentionally so. In essence, packs should be ordered alphabetically and let the inner bits do their thing.&lt;br /&gt;
&lt;br /&gt;
In other words, there are only two possible cases in which you may want to alter load order manually: UI and variants, basically if you want to use specific reskin B.pack in the midst of larger reskin A.pack, in which case you push B on top. But generally speaking this should be out of your mind or can be manually tweaked with a bit more care.&lt;br /&gt;
&lt;br /&gt;
''In conclusion, give Steam time to download/remove mods and keep load order in an alphabetical fashion (e.g. order by name and save profile), especially after adding new mods.''&lt;br /&gt;
&lt;br /&gt;
Which, incidentally, is this:&lt;br /&gt;
&lt;br /&gt;
! # $ % &amp;amp; ‘ ( ) + , – ; = @ 0-9 a-z [ ] ^ _ ` { } ~&lt;br /&gt;
&lt;br /&gt;
Where “!” wins over “a”.&lt;br /&gt;
&lt;br /&gt;
Sometimes, mod descriptions will tell you to manually alter load order to make that mod work over another, but quite frankly that is either unnecessary or the modder didn't do their homework to make sure that worked ''anyway'' (e.g., already making sure their pack and table names were right).&lt;br /&gt;
&lt;br /&gt;
== Common Troubleshooting ==&lt;br /&gt;
Ok, this is probably the reason you're here, ''something'' is wrong in your mod list and you need to find out what. &lt;br /&gt;
&lt;br /&gt;
In an efficient mod, at least half of the reported issues are down to user error or what is technically called launcher f***-up. We’re going to try and cut that amount down for the greater good.&lt;br /&gt;
&lt;br /&gt;
Let's get two things out of the way immediately:&lt;br /&gt;
&lt;br /&gt;
*'''When in doubt, redownload''': Steam Workshop is acceptable for many things but it does have some god-awful behaviours. One of these is getting you a version of the mod that is either 1) older than it should be or 2) straight up a corrupted and broken file. This means crashing when it's obviously not supposed to happen, or getting older, possibly broken, features. This is particularly painful around patch time, of course. And it is painfully common, so please, seriously, verify that this is not your case before rushing to a comment section to say &amp;quot;mod crash&amp;quot;. Your options are:&lt;br /&gt;
**'''Force download''' with a community manager (e.g., right click on the specific mod and click it, or PJ's can do it for all mods).&lt;br /&gt;
**Go to the mod's Steam page, unsuscribe and resuscribe after a pause, aka the unsub/resub cycle.&lt;br /&gt;
**Go to the game's content folder and physically delete the folder or pack.[[File:Steam workshop mod dates.jpg|thumb|If that last date doesn't match, clearly you got an old version]]&lt;br /&gt;
&lt;br /&gt;
NONE OF THESE is guaranteed to work, especially on a first attempt. Keep that in mind and keep trying when things are fishy, e.g. the &amp;quot;last updated&amp;quot; date on your mod manager is older than Update: DD/MM on its workshop page on the top right. &lt;br /&gt;
&lt;br /&gt;
Yes, this is tiresome, but trust me, '''if Steam is doing this to the mod, and it's very common that it does, we modders can't do anything for you'''. And if the wretched modder actually pushed an update that crashed the game, they'll know by the sheer amount of reports.&lt;br /&gt;
&lt;br /&gt;
So if a mod that clearly shouldn't be crashing (or having pre-patch features) but it keeps doing it for you, just keep forcing the update locally for your game. And maybe go pester Valve for a fix.&lt;br /&gt;
&lt;br /&gt;
== User good practices: ==&lt;br /&gt;
The following is a list of tips that you should observe in general when dealing with TW mods. &lt;br /&gt;
&lt;br /&gt;
''This list is of course not meant to insult anybody’s intelligence, but you’d be surprised at how many issues and massive wastes of time are due to neglect of these simple rules. Following them is in the user’s interest in order to find a solution sooner, and it will allow the modder more time for improvement rather than wasting their precious free time in unnecessary bug-hunts.''&lt;br /&gt;
# '''Read the mod description.''' Seriously, this alone would prevent 80% of comments on Steam pages. Even if a description looks long, do it, at least skim it to parse the important bits, it’s there for a reason. Some mods will also have FAQs or a list of known issues, incompatibilities and instructions. Read the comments before yours too if you have to post one. There’s an excellent chance the question you’re going to ask is already answered in in descriptions, FAQs and recent comments. Also, it's always good to know what the mod you grabbed actually do, so you know where stuff might be coming from.&lt;br /&gt;
# '''Don’t ignore the required items.''' The mod may show you a popup upon subscribing, disregarding that is almost always cue for disaster. This popup is ''not'' shown when subbing from a Steam collection (thanks Gaben), so actually check the mod’s page. PJ's MM will warn you about this if you haven't enabled important mods.&lt;br /&gt;
# '''Keep load order alphanumerical.''' We’ve been over that already. If you have new mods that have somehow popped at the tail of the list, just reset the mod list, e.g., click twice again on the &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt; column in George until it looks alphabetical.&lt;br /&gt;
# '''Troubleshoot yourself!''' The thing is, we don’t have time to help everybody, and in most cases the problem is local. Test if the issue happens when only that mod is enabled (plus any other that it requires); if you don't know what mod is doing the thing, bisect the mod list (e.g., load only half of it, PJ's MM can do it semi-automatically). We’ll get to best practices on this, don’t worry.&lt;br /&gt;
# '''Issue Context''': upon commenting about an issue, provide as much info as possible. Ok, you did everything right but that ugly bug is still there. That’s fine. The worst thing you could do at this point is comment “mod doesn’t work” because that means absolutely nothing. Modders aren’t usually telepaths, although we might be developing a sense of it under environmental pressure. Steam comments aren’t the best place for this, so use a discussion or the discord server/channel lurked by that given modder. If you still haven't figured out which mod is doing it and need help, use the #mod_user_troubleshooting channel in the [https://discord.gg/moddingden Modding Den].&lt;br /&gt;
#* Context: when and how the thing happened. E.g. during the interturn after X’s turn, or clicking this button, whether it was mortal empires campaign or not, multiplayer, custom battle or campaign battle.&lt;br /&gt;
#* Mod list: if asked, link a collection or post a screenshot of the mod list (possibly not in George). For example, the big thing is not being naïve enough that the overhaul in your list can’t affect other mods. For some reason, sometimes it feels like pulling teeth to know what else is there. However, if your mod list is longer than, say, 40 items, don't expect people to miraculously figure out what's going on while just reading through 200 mod names.&lt;br /&gt;
#* Screenshot: always helps for clarity and visual context. &lt;br /&gt;
#* Save game: if requested, you can find your save game in (example) C:\Users\%USER%\AppData\Roaming\The Creative Assembly\Warhammer2\save_games. Remember the mod list, because the modder may not be able to load without it.&lt;br /&gt;
#* Results of your own troubleshooting: for example it’s good to know it happens with that one mod only. Relatedly, if you posted about an issue and later find the cause, let us know.&lt;br /&gt;
# '''&amp;quot;It doesn't crash so it works&amp;quot;'''. Don't assume your mod list is working just because it's not currently blowing up your computer or it didn't murder your cat. A crash is only the most visible of symptoms, it's like assuming a coal miner is perfectly fine just because they haven't dropped dead yet. You may have all kinds of issues in your 400-mods list ranging from fucked models to script breaks. Did I mention don't use 400 mods? Yeah nah, probably don't.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: Trimming the Mod List ==&lt;br /&gt;
There is no such thing as a mod cap in WH3, which is another common trope. It’s up to you to keep your mod list functional, and '''the more mods you run the more likely you are to encounter issues, or just to see maintenance time increase for you'''. Making your mod list work is up to how careful you are. '''Remember, just because your list doesn’t produce an instant crash you can’t be sure there aren’t less visible issues''', e.g. script breaks.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, don’t be cocky with your list of 250 mods. It’s all fun and games until everything works perfectly (and with those numbers chances are it doesn’t already, you just can’t see it), at which point there’s a lot of stuff to check. Even if 300 out of 350 are reskins you would entrust with your house keys, it all adds to the volume of annoyance if something goes wrong. For example, maybe don't enable mods that affect stuff you will NEVER see as a player for a given campaign.&lt;br /&gt;
&lt;br /&gt;
If you’re not experienced yet (and don’t assume you are just because you played Skyrim, this is different), use the mod list of someone that has very carefully been curating it, and check that it looks ok with the help of the modders themselves. For example, start by a modder’s own collection on Steam, they often have one.&lt;br /&gt;
&lt;br /&gt;
=== Finding the culprit ===&lt;br /&gt;
The usual problem with large mod lists is this: bad, I got a crash; worse, which one of the N mods I have is the culprit?&lt;br /&gt;
&lt;br /&gt;
==== Generic pointers: ====&lt;br /&gt;
&lt;br /&gt;
* Pure Text, Variant and UI mods CAN cause CTD in Wh3, so don't cast them away from the candidate.&lt;br /&gt;
** Text: If it's a submod, it can be caused by missing an entry, or by using the wrong {tr:}&lt;br /&gt;
** UI: TWUI can cause CTD in various ways. Also, several of the UI mods use a script to show them as the users like&lt;br /&gt;
** Variant: Every VMD can cause CTD&lt;br /&gt;
* Momentarily sort by date on the MM to find the most recent updates, if you didn’t add additional mods those ''may'' (just may) be responsible.&lt;br /&gt;
* If you had the issue during a campaign, do not remove mods that have custom items, units or buildings because you’re just going to crash harder if those are around in the campaign map.&lt;br /&gt;
* Watch out for movie packs. These are packs with a specific setting that long story short used to be required for some things but it may cause them to automatically fire despite being disabled. In WH3, these are really only necessary (as of may '24) for new audio content. If you’re inexplicably crashing even with no mods on, you might have a movie pack with crashy data in it and the modder might need screaming at.&lt;br /&gt;
&lt;br /&gt;
==== Bisect and Conquer: ====&lt;br /&gt;
[[File:Bisect wh3mm.jpg|thumb|Within PJ's WH3MM, within Other Options]]&lt;br /&gt;
Especially when dealing with big mod lists, the quickest method is to enable half of it. If you crash, that’s the troublesome half. Halve again to tighten the noose.&lt;br /&gt;
&lt;br /&gt;
Keep in mind mod requirements while you do this.&lt;br /&gt;
&lt;br /&gt;
If you want to check on a particular mod, disable everything and load the bare minimum to make that mod work, in other words mod+whatever required mods that comes with. And up from there, adding one or small groups of mods at a time until you can reproduce the issue.&lt;br /&gt;
&lt;br /&gt;
It’s patient work but the modder will appreciate it, and it takes less than panicking for hours in a comment section. Assume that a modder won’t troubleshoot your mod list of 150 packs because you say it’s their mod doing it, unless they have proof because you tested without anything else plus requirements.&lt;br /&gt;
&lt;br /&gt;
Remember: a happy modder is a happy user.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: Scripts ==&lt;br /&gt;
Scripts are being increasingly used by mods. While most scripters are getting smarter by the day to maintain compatibility, some require a framework or some mods will just struggle to work when there are too many mods around.&lt;br /&gt;
&lt;br /&gt;
You may encounter symptoms of broken scripts, due to botched downloads, bad compatibility or just plain unforeseen issues because we can just mess stuff up sometimes. Script glitches may end up being tricky to root out.&lt;br /&gt;
&lt;br /&gt;
A few examples of broken scripts:&lt;br /&gt;
&lt;br /&gt;
* Starting lords that should be custom are not custom, or don’t spawn, or don’t have the correct army or settlement. (in some cases, this is intentionally delayed to turn 2 for performance reasons)&lt;br /&gt;
* Sword of Khaine button is unchained right off.&lt;br /&gt;
* Chaos and all Rogue armies may spawn immediately.&lt;br /&gt;
* Campaign camera on a fresh campaign starts zoomed-out and doesn’t pan in.&lt;br /&gt;
* Chivalry starts at 0.&lt;br /&gt;
* One of the worst, characters do not gain XP (this may sometimes happen in full vanilla too, requires repair).&lt;br /&gt;
&lt;br /&gt;
==== Scropt broken, what do? ====&lt;br /&gt;
Remember, it's always important to trim your mod list to determine the culprit/s. With scripts, there may be specific interactions that cause problems, such as trying to do thing A to thing B but another mod has already removed or changed B irreparably for that to work. &lt;br /&gt;
&lt;br /&gt;
When/if you report the issue to modders, remember to provide as much info as humanly possible because finding a script break can turn ugly and complicated.&lt;br /&gt;
&lt;br /&gt;
Particularly useful to help with scripting issues: please enable [https://steamcommunity.com/sharedfiles/filedetails/?id=1271877744 this debugger] (or enable the option in PJ's MM), reproduce the bug and send the resulting log, which will be a lenghty txt generated in ''Steam\steamapps\common\Total War WARHAMMER II''. Specific scripty mods may come with additional instructions in their mod descriptions/faqs.&lt;br /&gt;
&lt;br /&gt;
Do not keep the script logger enabled past this necessity, since it will noticeably slow down your game.&lt;br /&gt;
&lt;br /&gt;
One of the most frequent issues at the moment is a performance-related clog-up at the start of a campaign. This basically means that too many scripts are trying to fit into that time frame to do their stuff (legendary lords, changing armies, this kinda stuff) and results in some of them not working. This is where size of the mod list, in regards to any mod with a first-tick script, becomes serious.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: [https://steamcommunity.com/sharedfiles/filedetails/?id=1354363596 Mod Configuration Tool] ==&lt;br /&gt;
This other framework is used to provide settings for compatible mods, i.e. to tweak some details at your heart’s content. Usually a good thing to keep it around because there’s quite a few mods supporting it, or that may do it in the future. For example, you may use it to configure some scripts to fire in a performance mode to reduce impact on campaign start. &lt;br /&gt;
== APPENDIX: WH3, crashing on clicking Skirmish ==&lt;br /&gt;
The most likely cause for this right now is that you saved a character (that new fancy function in WH3 to play campaign characters into skirmishes) but it was originated or affected by a mod that you have since then removed. Kaboom. The other symptom is going kaboom when trying to recruit any hero or lord in campaign.&lt;br /&gt;
&lt;br /&gt;
Go in &amp;lt;code&amp;gt;C:\Users\user\AppData\Roaming\The Creative Assembly\Warhammer3\saved_characters&amp;lt;/code&amp;gt; (or search %appdata% in windows search, then continue to those folders) and delete them.&lt;br /&gt;
&lt;br /&gt;
== APPENDIX: the Powershell rummage ==&lt;br /&gt;
TBC&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1282</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1282"/>
		<updated>2024-07-09T10:29:28Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Added ones that was added in the official document&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1281</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1281"/>
		<updated>2024-07-09T10:21:25Z</updated>

		<summary type="html">&lt;p&gt;Rhox: another function error&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1280</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1280"/>
		<updated>2024-07-07T04:45:43Z</updated>

		<summary type="html">&lt;p&gt;Rhox: plague thing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
&lt;br /&gt;
== try_get_agent_plague_components() ==&lt;br /&gt;
Also not a function and is callable from CHARACTER_SCRIPT_INTERFACE. Mostly used for plague checking&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1279</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1279"/>
		<updated>2024-07-07T03:47:26Z</updated>

		<summary type="html">&lt;p&gt;Rhox: plague&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean set_to_blessed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1278</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1278"/>
		<updated>2024-07-07T03:40:09Z</updated>

		<summary type="html">&lt;p&gt;Rhox: I said faction instead of province. Yeah I'm stupid&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_province_mercenary_pool ==&lt;br /&gt;
cm:add_unit_to_province_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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Building_units_allowed_tables&amp;diff=1274</id>
		<title>Building units allowed tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Building_units_allowed_tables&amp;diff=1274"/>
		<updated>2024-07-06T09:34:27Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Enabled.png|thumb|This mod disables recruitment of wh_dlc07_brt_inf_spearmen_at_arms_1 from barracks only for wh_main_brt_bordeleaux while other Bretonnia factions can still recruit them]]&lt;br /&gt;
The &amp;quot;Enabled&amp;quot; column is somewhat misleading, but it does its work. But only in limited situation&lt;br /&gt;
&lt;br /&gt;
* There must be the same building-unit entry in another mod or vanilla. If it doesn't, the &amp;quot;enabled&amp;quot; column doesn't do anything and it always enables unit recruitment.&lt;br /&gt;
* The faction column must be filled in. &lt;br /&gt;
* Finally, the &amp;quot;enabled&amp;quot; column needs to be unticked&lt;br /&gt;
&lt;br /&gt;
In this situation, this enabled unticked row will disable vanilla or other mod's building recruitment for the faction you've filled in the row. If you filled in the wh_main_brt_bordeleaux for the faction column, and if you filled in all the other columns correctly, then all the other Bretonnia has access to this building unit recruitment while wh_main_brt_bordeleaux does not. &lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Enabled.png&amp;diff=1273</id>
		<title>File:Enabled.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Enabled.png&amp;diff=1273"/>
		<updated>2024-07-06T09:33:21Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This disables recruitment&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Building_units_allowed_tables&amp;diff=1272</id>
		<title>Building units allowed tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Building_units_allowed_tables&amp;diff=1272"/>
		<updated>2024-07-06T09:24:36Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Enabled column&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;quot;Enabled&amp;quot; column is somewhat misleading, but it does its work. But only in limited situation&lt;br /&gt;
&lt;br /&gt;
* There must be the same building-unit entry in another mod or vanilla. If it doesn't, the &amp;quot;enabled&amp;quot; column doesn't do anything and it always enables unit recruitment.&lt;br /&gt;
* The faction column must be filled in. &lt;br /&gt;
* Finally, the &amp;quot;enabled&amp;quot; column needs to be unticked&lt;br /&gt;
&lt;br /&gt;
In this situation, this enabled unticked row will disable vanilla or other mod's building recruitment for the faction you've filled in the row. If you filled in the wh_main_brt_bordeleaux for the faction column, and if you filled in all the other columns correctly, then all the other Bretonnia has access to this building unit recruitment while wh_main_brt_bordeleaux does not. &lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1268</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1268"/>
		<updated>2024-06-23T07:54:43Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with the community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the users use only one startpos mod, Mixer. Technically, IEE and TOW are also startpos mods. But they're made to have each entry the same as Mixer and Chaos Robie's stuff are appended manually.  &lt;br /&gt;
&lt;br /&gt;
Due to this characteristic, &lt;br /&gt;
Modders have made several works around for many startpos-only features, some parts are still startpos bound and need Mixer's work though. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture. This would also mean the culture you added won't work due to this. Even if your faction does not have heroes, there is also the tech issue. &lt;br /&gt;
* Slot types used for Landmarks: Same as above, Mixu makes slots for each region. &lt;br /&gt;
* Potential for each faction: Same. &lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use the Mixer faction requests thread if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete. Also, Mixu prefers batch work rather than getting small requests multiple times&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. &lt;br /&gt;
** '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, you need startpos. You don't normally need it unless you're going to make a quest battle for the leader. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
* Horde marker in the diplomacy panel: It's related to the feature forest, and the script below does not change this. Theoretically, you can change it with the script to change the icon and tooltip. (But I haven't tried)&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that use this function&lt;br /&gt;
* Settings like starting region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the vanilla techs you want to remove access from your faction. Otherwise, AI can research it plus will create research available alarm to the player when they have researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Use the faction column in the node tables to override the vanilla one. Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to cover all the vanilla tech nodes. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech key. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the node the user has made. If you send all the vanilla nodes to a place with this method to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node sets like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Need some script work but also works. Do note that it can cause problems if another mod adds a tab of its own, but you can create compatibility if you want to.&lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, but you can use other ways.&lt;br /&gt;
** You can use the cm:add_or_remove_faction_features() function in the script to remove or add features from a certain faction&lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables if you want to change accessible features of all the factions of that feature forest&lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1267</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1267"/>
		<updated>2024-06-23T07:29:20Z</updated>

		<summary type="html">&lt;p&gt;Rhox: feature forest&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with the community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the users use only one startpos mod, Mixer. Technically, IEE and TOW are also startpos mods. But they're made to have each entry the same as Mixer and Chaos Robie's stuff are appended manually.  &lt;br /&gt;
&lt;br /&gt;
Due to this characteristic, &lt;br /&gt;
Modders have made several works around for many startpos-only features, some parts are still startpos bound and need Mixer's work though. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture. This would also mean the culture you added won't work due to this. Even if your faction does not have heroes, there is also the tech issue. &lt;br /&gt;
* Slot types used for Landmarks: Same as above, Mixu makes slots for each region. &lt;br /&gt;
* Potential for each faction: Same. &lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use the Mixer faction requests thread if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete. Also, Mixu prefers batch work rather than getting small requests multiple times&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. &lt;br /&gt;
** '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, you need startpos. You don't normally need it unless you're going to make a quest battle for the leader. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that use this function&lt;br /&gt;
* Settings like starting region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the vanilla techs you want to remove access from your faction. Otherwise, AI can research it plus will create research available alarm to the player when they have researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Use the faction column in the node tables to override the vanilla one. Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to cover all the vanilla tech nodes. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech key. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the node the user has made. If you send all the vanilla nodes to a place with this method to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node sets like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Need some script work but also works. Do note that it can cause problems if another mod adds a tab of its own, but you can create compatibility if you want to.&lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, but you can use other ways.&lt;br /&gt;
** You can use the cm:add_or_remove_faction_features() function in the script to remove or add features from a certain faction&lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables if you want to change accessible features of all the factions of that feature forest&lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1266</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1266"/>
		<updated>2024-06-23T07:12:26Z</updated>

		<summary type="html">&lt;p&gt;Rhox: feature forest&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with the community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the users use only one startpos mod, Mixer. Technically, IEE and TOW are also startpos mods. But they're made to have each entry the same as Mixer and Chaos Robie's stuff are appended manually.  &lt;br /&gt;
&lt;br /&gt;
Due to this characteristic, &lt;br /&gt;
Modders have made several works around for many startpos-only features, some parts are still startpos bound and need Mixer's work though. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture. This would also mean the culture you added won't work due to this. Even if your faction does not have heroes, there is also the tech issue. &lt;br /&gt;
* Slot types used for Landmarks: Same as above, Mixu makes slots for each region. &lt;br /&gt;
* Potential for each faction: Same. &lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use the Mixer faction requests thread if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete. Also, Mixu prefers batch work rather than getting small requests multiple times. &lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, but you can use other ways.  &lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables, and while this is not startpos it will affect every other faction that has this feature forest, so be careful when you use it&lt;br /&gt;
** You can also use the cm:add_or_remove_faction_features() function in the script to remove or add features&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. &lt;br /&gt;
** '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, you need startpos. You don't normally need it unless you're going to make a quest battle for the leader. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that use this function&lt;br /&gt;
* Settings like starting region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the vanilla techs you want to remove access from your faction. Otherwise, AI can research it plus will create research available alarm to the player when they have researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Use the faction column in the node tables to override the vanilla one. Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to cover all the vanilla tech nodes. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech key. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the node the user has made. If you send all the vanilla nodes to a place with this method to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node sets like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Need some script work but also works. Do note that it can cause problems if another mod adds a tab of its own, but you can create compatibility if you want to.&lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1265</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1265"/>
		<updated>2024-06-10T18:45:00Z</updated>

		<summary type="html">&lt;p&gt;Rhox: faction potential&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_faction_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
 &lt;br /&gt;
== cm:faction_set_total_potential_override_value ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_total_potential_override_value(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), true, 500) This will forcibly set the Daemon Prince's faction potential to 500  &lt;br /&gt;
&lt;br /&gt;
== cm:faction_set_potential_modifier ==&lt;br /&gt;
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  &lt;br /&gt;
 &lt;br /&gt;
ex: cm:faction_set_potential_modifier(cm:get_faction(&amp;quot;wh3_main_dae_daemon_prince&amp;quot;), -100) This will calculate the Daemon Prince's faction potential as normal (probably 200), and then subtract 100 from it to reach 100 total. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1264</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1264"/>
		<updated>2024-06-05T10:50:33Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_faction_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
Returns table ''embedded_character_subtypes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is the game over&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1263</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1263"/>
		<updated>2024-06-05T07:34:34Z</updated>

		<summary type="html">&lt;p&gt;Rhox: additions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_faction_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_technology ==&lt;br /&gt;
cm:instantly_research_technology(${1:string faction key}, ${2:string technology key}, ${3:boolean notify event feed})&lt;br /&gt;
&lt;br /&gt;
Instantly completes research for the specified technology for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_research_all_technologies ==&lt;br /&gt;
cm:instantly_research_all_technologies(${1:string faction key})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly completes research on all technologies for the specified faction&lt;br /&gt;
&lt;br /&gt;
== cm:instantly_clear_all_technologies ==&lt;br /&gt;
cm:instantly_clear_all_technologies(${1:string faction key}) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instantly resets all technologies for the specified faction to an unresearched state.&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
&lt;br /&gt;
== FactionDeath ==&lt;br /&gt;
While not function, and is in the document, I'll include it here since Chadvandy does not have it yet. &lt;br /&gt;
&lt;br /&gt;
This listener listens for the faction death and supports these in the contexts&lt;br /&gt;
&lt;br /&gt;
- killer(): Faction that killed this faction&lt;br /&gt;
&lt;br /&gt;
- faction(): Faction that died&lt;br /&gt;
&lt;br /&gt;
- is_game_over(): Is game over&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1262</id>
		<title>Functions without document</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Functions_without_document&amp;diff=1262"/>
		<updated>2024-06-05T07:29:18Z</updated>

		<summary type="html">&lt;p&gt;Rhox: functions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will include information about functions without a document, or the document has the wrong information.&lt;br /&gt;
&lt;br /&gt;
== cm:add_unit_to_faction_mercenary_pool ==&lt;br /&gt;
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'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== cm:pending_battle_cache_get_attacker_embedded_character_subtypes &amp;amp; cm:pending_battle_cache_get_defender_embedded_character_subtypes ==&lt;br /&gt;
cm:pending_battle_cache_get_defender_embedded_character_subtypes(number ''index_of_defender'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similar to cm:pending_battle_cache_get_defender_subtype(), but you can get embedding heroes subtypes also.&lt;br /&gt;
&lt;br /&gt;
== cm:is_agent_transformation_available ==&lt;br /&gt;
cm:is_agent_transformation_available(string ''agent_subtype_key'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== cm:military_force_add_temporary_stance ==&lt;br /&gt;
cm:military_force_add_temporary_stance(number ''mf_cqi'',string ''stance'', number ''turn'')&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== cm:set_plague_component_state ==&lt;br /&gt;
cm:set_plague_component_state(faction_script_interface ''faction'', string ''component'', string ''state'', boolean ?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Used to handle ToD's new plague system. While they're not in the document, vanilla uses it, so check there.&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Agent_subtypes_tables&amp;diff=1250</id>
		<title>Agent subtypes tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Agent_subtypes_tables&amp;diff=1250"/>
		<updated>2024-05-28T15:58:03Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[File:Lore.png|thumb]]&amp;quot;Magic Lore&amp;quot;: This column creates multiple buttons on the left side. While this is expected, there is one thing you should be cautious about it if you use it with the &amp;quot;legendary_lords&amp;quot; recruitment category. When this agent_subtype is in the recruitable lord pool due to wound or respec, this agent_subtype will block all other LL in the pool from visibility.&lt;br /&gt;
&lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Agent_subtypes_tables&amp;diff=1249</id>
		<title>Agent subtypes tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Agent_subtypes_tables&amp;diff=1249"/>
		<updated>2024-05-28T15:55:48Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Created page with &amp;quot;* thumb&amp;quot;Magic Lore&amp;quot;: This column creates multiple buttons on the left side. While this is expected, there is one thing you should be cautious while using it. If you use it with the &amp;quot;legendary_lords&amp;quot; recruitment category, this agent_subtype will block all other LL in the pool from visibility.  Category:DB Table&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[File:Lore.png|thumb]]&amp;quot;Magic Lore&amp;quot;: This column creates multiple buttons on the left side. While this is expected, there is one thing you should be cautious while using it. If you use it with the &amp;quot;legendary_lords&amp;quot; recruitment category, this agent_subtype will block all other LL in the pool from visibility.&lt;br /&gt;
&lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Lore.png&amp;diff=1248</id>
		<title>File:Lore.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Lore.png&amp;diff=1248"/>
		<updated>2024-05-28T15:54:01Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lore button on recruit agent&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1247</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1247"/>
		<updated>2024-05-21T11:36:54Z</updated>

		<summary type="html">&lt;p&gt;Rhox: English&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with the community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the users use only one startpos mod, Mixer. Technically, IEE and TOW are also startpos mods. But they're made to have each entry the same as Mixer and Chaos Robie's stuff are appended manually.  &lt;br /&gt;
&lt;br /&gt;
Due to this characteristic, &lt;br /&gt;
Modders have made several works around for many startpos-only features, some parts are still startpos bound and need Mixer's work though. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture. This would also mean the culture you added won't work due to this. Even if your faction does not have heroes, there is also the tech issue. &lt;br /&gt;
* Slot types used for Landmarks: Same as above, Mixu makes slots for each region. &lt;br /&gt;
* Potential for each faction: Same. &lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use the Mixer faction requests thread if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete. Also, Mixu prefers batch work rather than getting small requests multiple times. &lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, you'll need it. &lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables, and while this is not startpos it will affect every other faction that has this feature forest, so be careful when you use it&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. &lt;br /&gt;
** '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, you need startpos. You don't normally need it unless you're going to make a quest battle for the leader. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that use this function&lt;br /&gt;
* Settings like starting region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the vanilla techs you want to remove access from your faction. Otherwise, AI can research it plus will create research available alarm to the player when they have researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Use the faction column in the node tables to override the vanilla one. Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to cover all the vanilla tech nodes. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech key. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the node the user has made. If you send all the vanilla nodes to a place with this method to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node sets like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Need some script work but also works. Do note that it can cause problems if another mod adds a tab of its own, but you can create compatibility if you want to.&lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Startpos&amp;diff=1246</id>
		<title>Startpos</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Startpos&amp;diff=1246"/>
		<updated>2024-05-21T07:37:38Z</updated>

		<summary type="html">&lt;p&gt;Rhox: startpos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Disclaimer: Some of the opinions are solitary of Rhox's and might not align with community's)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Startpos is turn 0 save of the campaign. The key point is, that '''there can be only one startpos'''. Thus, appending or removing via another mod isn't possible. That's why most of the mods use only one startpos mod. Mixer. There are also IEE and TOW, and they're made to have each entry the same as Mixer and append some of the Chaos Robie's stuff. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Modders have made several works around for many startpos-only features, but some parts are still startpos bound and need Mixer's work. &lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can't be replicated ===&lt;br /&gt;
&lt;br /&gt;
* Cultures available agent_types: Mixer has added every possible case for every known culture and Mixer added culture&lt;br /&gt;
* Slot types used for Landmarks: Same as above&lt;br /&gt;
* Factions: Both playable and spawnable need startpos work. Making it playable requires more work than just spawnable ones. Use Mixer faction requests if you need them. Every playable entry increases the loading time so my advice is to practice with any mixer faction in it, then request when the work is complete&lt;br /&gt;
* Feature Forest: You don't normally use it, but if you're making a full horde faction (factions that can't occupy settlements) into a normal faction, or turning a full horde faction into a normal faction, you'll need it. &lt;br /&gt;
** You can add more into feature into feature_set_to_faction_features_tables, and while this is not startpos it will affect every other faction that has this feature forest, so be careful when you use it&lt;br /&gt;
* Diplomacy: For non-aggression and military access only. Others can be replicated via scripts. '''&amp;lt;code&amp;gt;cm:force_grant_military_access&amp;lt;/code&amp;gt;''' has some serious quirks and military access given by this can't be canceled in the UI&lt;br /&gt;
* Regions held by a faction in the faction selection window: It needs startpos work but it's minor so I would say just ignore it&lt;br /&gt;
* Faction leader CQI: If you need your leader to have a certain CQI, it needs startpos. You don't normally need it, but it might get problematic if you're making a quest battle for it. However, you can use a script to fool the users. Check Wh2 OvN's Halfing scripts&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that the script can theoretically replace but no one has done it yet ===&lt;br /&gt;
&lt;br /&gt;
* Offices: Because it's just an effect bundle given to a character and not so exciting for many of the makers. If you happen to make one, consider sending it to Mixu&lt;br /&gt;
&lt;br /&gt;
=== Startpos things that can be replaced with script and DB way ===&lt;br /&gt;
&lt;br /&gt;
* Faction RoR (mercenaries): Setup mercenary DB and call '''&amp;lt;code&amp;gt;cm:add_unit_to_faction_mercenary_pool()&amp;lt;/code&amp;gt;'''function at first tick callback new&lt;br /&gt;
* Province mercenaries (raise dead and warbands): Similar but the function in the document is wrong so check other mods that do it&lt;br /&gt;
* Settings like region, leader, items, units, buildings, and such: Check other faction mods, Most of the things can be replicated with the script. &lt;br /&gt;
** Faction starting position pin: Use frontend_faction_leaders_tables and alter the 'Override Force Location X &amp;amp; Y' column.&lt;br /&gt;
* Tech node Set: While the tech node set is startpos, you can use some workaround. Do note that all the methods below need script work to lock all the initial techs, otherwise, AI can research it, and will create research available alarm when the player has researched all available techs shown in the UI&lt;br /&gt;
** Overriding some of the nodes with faction-specific nodes: Even CA uses this method for some of the factions. But it can only do overrides and the tech tree's shape needs to be the shape same as the vanilla one. &lt;br /&gt;
** Sending all existing techs to a place where users can't see: While you might not know it, every tech node set can have only one tech. This means if you make a new faction-specific tech node that has a vanilla tech key, that faction will not have access to the vanilla tech node and will have access to the one the user has made. If you send all of these nodes to a place where users can't see them, now you can create a new tech node set of your own. Check out OvN Dread King if you need an example. Note that it doesn't work for center-starting tech node set like Chaos Warriors&lt;br /&gt;
** Make a new tech tab and hide the previous one: Also works, but it can cause problems if another mod adds a tab of their own, but you can create compatibility if you want to. &lt;br /&gt;
* Norsca vassal thing, and empire giving region thing (start_pos_entity_association_faction_regions_tables): Depends on what you're using it for, but since it's used in occupation options, you can use a script to hide certain things when the conditions don't match&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Character_skill_nodes_tables&amp;diff=1245</id>
		<title>Character skill nodes tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Character_skill_nodes_tables&amp;diff=1245"/>
		<updated>2024-05-19T15:39:04Z</updated>

		<summary type="html">&lt;p&gt;Rhox: category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Tier doesn't work if it is bigger than the ones defined in character_experience_skill_tiers. So normally, set the value lower than 48&lt;br /&gt;
* If you want a campaign, subculture, and faction-specific skill node key, define it here. Columns in character_skill_node_sets_tables won't work&lt;br /&gt;
* If a character gains an additional skill node via the upper method via confederation, it needs an additional first tick to gain access to it. Same for the startpos character's innate skills&lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Cooking_ingredients_tables&amp;diff=1244</id>
		<title>Cooking ingredients tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Cooking_ingredients_tables&amp;diff=1244"/>
		<updated>2024-05-19T15:38:42Z</updated>

		<summary type="html">&lt;p&gt;Rhox: category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* The game will CTD if the &amp;quot;Vo Trigger&amp;quot; column is left blank. If you want the game to be silent, add some unrelated string. like &amp;quot;empty&amp;quot;&lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1243</id>
		<title>Units custom battle permissions tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1243"/>
		<updated>2024-05-19T15:38:18Z</updated>

		<summary type="html">&lt;p&gt;Rhox: category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;At first glance, this DB looks like it is only for the custom battle, but actually, several campaign things will be affected by this DB&lt;br /&gt;
[[File:Hero recruitment.png|thumb|Hero's unit card in the building browser is not determined by porthole.bin nor unit_variants but custom battle]]&lt;br /&gt;
&lt;br /&gt;
* Hero recruitment portrait: The hero unit card shown in the building browser is determined by this DB&lt;br /&gt;
* Affected Unit Preview: Starting from Chaos Dwarf DLC, every effect shows the affected unit set in their tooltip. Among the affected unit_set, the ones that the faction does not have access to via military group or exclusive permission do not show normally. (You can also disable the unit or unit_set from all previews, but that's another DB) But there is another quirk in this preview. '''If any of the factions with that culture has access to a certain unit in the CB, that unit will be shown in the affected unit set preview no matter the military group or exclusive permission.''' So if you want to limit certain units to a certain faction, best to leave it out from CB, or make a CB-only cultured faction.&lt;br /&gt;
* [[File:Changeling.png|thumb|In this Changeling unit category, you'll see Grudgebringer. This doesn't make sense at first glance as Grudgebringer is just a faction with Empire culture. This is because Changeling's category is decided by a custom battle, and hence showing custom battle only cultures]]Changeling: Changeling has access to certain agent_subtypes in their shapeshifting via another table. However, how the game categorizes what category agent_subtype belongs to is done via this DB. That is why CB-only only cultures are showing up as categories for Changeling.&lt;br /&gt;
[[Category:DB Table]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1242</id>
		<title>Units custom battle permissions tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1242"/>
		<updated>2024-05-19T15:37:10Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;At first glance, this DB looks like it is only for the custom battle, but actually, several campaign things will be affected by this DB&lt;br /&gt;
[[File:Hero recruitment.png|thumb|Hero's unit card in the building browser is not determined by porthole.bin nor unit_variants but custom battle]]&lt;br /&gt;
&lt;br /&gt;
* Hero recruitment portrait: The hero unit card shown in the building browser is determined by this DB&lt;br /&gt;
* Affected Unit Preview: Starting from Chaos Dwarf DLC, every effect shows the affected unit set in their tooltip. Among the affected unit_set, the ones that the faction does not have access to via military group or exclusive permission do not show normally. (You can also disable the unit or unit_set from all previews, but that's another DB) But there is another quirk in this preview. '''If any of the factions with that culture has access to a certain unit in the CB, that unit will be shown in the affected unit set preview no matter the military group or exclusive permission.''' So if you want to limit certain units to a certain faction, best to leave it out from CB, or make a CB-only cultured faction.&lt;br /&gt;
* [[File:Changeling.png|thumb|In this Changeling unit category, you'll see Grudgebringer. This doesn't make sense at first glance as Grudgebringer is just a faction with Empire culture. This is because Changeling's category is decided by a custom battle, and hence showing custom battle only cultures]]Changeling: Changeling has access to certain agent_subtypes in their shapeshifting via another table. However, how the game categorizes what category agent_subtype belongs to is done via this DB. That is why CB-only only cultures are showing up as categories for Changeling.&lt;br /&gt;
[[Category:DB]]&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1241</id>
		<title>Units custom battle permissions tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1241"/>
		<updated>2024-05-19T14:57:18Z</updated>

		<summary type="html">&lt;p&gt;Rhox: images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;At first glance, this DB looks like it is only for the custom battle, but actually, several campaign things will be affected by this DB&lt;br /&gt;
[[File:Hero recruitment.png|thumb|Hero's unit card in the building browser is not determined by porthole.bin nor unit_variants but custom battle]]&lt;br /&gt;
&lt;br /&gt;
* Hero recruitment portrait: The hero unit card shown in the building browser is determined by this DB&lt;br /&gt;
* Affected Unit Preview: Starting from Chaos Dwarf DLC, every effect shows the affected unit set in their tooltip. Among the affected unit_set, the ones that the faction does not have access to via military group or exclusive permission do not show normally. (You can also disable the unit or unit_set from all previews, but that's another DB) But there is another quirk in this preview. '''If any of the factions with that culture has access to a certain unit in the CB, that unit will be shown in the affected unit set preview no matter the military group or exclusive permission.''' So if you want to limit certain units to a certain faction, best to leave it out from CB, or make a CB-only cultured faction.&lt;br /&gt;
* [[File:Changeling.png|thumb|In this Changeling unit category, you'll see Grudgebringer. This doesn't make sense at first glance as Grudgebringer is just a faction with Empire culture. This is because Changeling's category is decided by a custom battle, and hence showing custom battle only cultures]]Changeling: Changeling has access to certain agent_subtypes in their shapeshifting via another table. However, how the game categorizes what category agent_subtype belongs to is done via this DB. That is why CB-only only cultures are showing up as categories for Changeling.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Changeling.png&amp;diff=1240</id>
		<title>File:Changeling.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Changeling.png&amp;diff=1240"/>
		<updated>2024-05-19T14:55:24Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Changeling panel example&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Hero_recruitment.png&amp;diff=1239</id>
		<title>File:Hero recruitment.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Hero_recruitment.png&amp;diff=1239"/>
		<updated>2024-05-19T14:53:48Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hero's unit card you see in the building recruitment is not determined by porthole.bin or unit_variants, but a custom battle&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Unique_ID&amp;diff=1238</id>
		<title>Unique ID</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Unique_ID&amp;diff=1238"/>
		<updated>2024-05-19T06:27:02Z</updated>

		<summary type="html">&lt;p&gt;Rhox: some more info about it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== What is a Unique ID? ===&lt;br /&gt;
Unique IDs are found throughout the database in various tables and these act as numeric identifiers that must be unique from each other in order to not cause compatibility issues within the game's tables as well as mods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It needs to be smaller than 2,147,483,647 (size of int). You can use Modding Den Discord's &lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;/modding random_number num: NUMBER&amp;lt;/blockquote&amp;gt;to generate the random numbers&lt;br /&gt;
&lt;br /&gt;
==== Warhammer III Tables with Unique ID's ====&lt;br /&gt;
db/armed_citizenry_units_to_unit_groups_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/army_special_abilities_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/battle_set_piece_armies_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/building_chain_availabilities_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/building_level_armed_citizenry_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/building_units_allowed_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/campaign_agent_subtype_factorial_effect_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/campaign_building_level_factorial_effect_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/campaign_character_arts_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/campaign_post_battle_captive_options_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_dilemma_option_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_dilemma_payloads_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_incident_option_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_incident_payloads_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_mission_option_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/cdir_events_mission_payloads_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/culture_settlement_occupation_options_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/faction_set_items_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/main_units_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/mercenary_pool_to_groups_junctions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/names_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/ritual_payload_spawn_mercenaries_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/slot_set_items_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/technologies_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/unit_special_abilities_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/units_custom_battle_types_to_factions_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/units_custom_battle_types_tables&lt;br /&gt;
&amp;lt;br&amp;gt;db/warscape_animated_lod_tables&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1237</id>
		<title>Units custom battle permissions tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Units_custom_battle_permissions_tables&amp;diff=1237"/>
		<updated>2024-05-19T06:24:07Z</updated>

		<summary type="html">&lt;p&gt;Rhox: custom battle quirk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;At first glance, this DB looks like it is only for the custom battle, but actually, several campaign things will be affected by this DB&lt;br /&gt;
&lt;br /&gt;
* Hero recruitment portrait: The hero unit card shown in the building browser is determined by this DB&lt;br /&gt;
* Affected Unit Preview: Starting from Chaos Dwarf DLC, every effect shows the affected unit set in their tooltip. Among the affected unit_set, the ones that the faction does not have access to via military group or exclusive permission do not show normally. (You can also disable the unit or unit_set from all previews, but that's another DB) But there is another quirk in this preview. '''If any of the factions with that culture has access to a certain unit in the CB, that unit will be shown in the affected unit set preview no matter the military group or exclusive permission.''' So if you want to limit certain units to a certain faction, best to leave it out from CB, or make a CB-only cultured faction. &lt;br /&gt;
* Changeling: Changeling has access to certain agent_subtypes in their shapeshifting via another table. However, how the game categorizes what category agent_subtype belongs to is done via this DB. That is why CB-only only cultures are showing up as categories for Changeling.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Cooking_ingredients_tables&amp;diff=1236</id>
		<title>Cooking ingredients tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Cooking_ingredients_tables&amp;diff=1236"/>
		<updated>2024-05-15T03:08:18Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Created page with &amp;quot;* The game will CTD if the &amp;quot;Vo Trigger&amp;quot; column is left blank. If you want the game to be silent, add some unrelated string. like &amp;quot;empty&amp;quot;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* The game will CTD if the &amp;quot;Vo Trigger&amp;quot; column is left blank. If you want the game to be silent, add some unrelated string. like &amp;quot;empty&amp;quot;&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Character_skill_nodes_tables&amp;diff=1235</id>
		<title>Character skill nodes tables</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Character_skill_nodes_tables&amp;diff=1235"/>
		<updated>2024-05-15T03:03:41Z</updated>

		<summary type="html">&lt;p&gt;Rhox: DB page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Tier doesn't work if it is bigger than the ones defined in character_experience_skill_tiers. So normally, set the value lower than 48&lt;br /&gt;
* If you want a campaign, subculture, and faction-specific skill node key, define it here. Columns in character_skill_node_sets_tables won't work&lt;br /&gt;
* If a character gains an additional skill node via the upper method via confederation, it needs an additional first tick to gain access to it. Same for the startpos character's innate skills&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1007</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=1007"/>
		<updated>2023-07-21T06:12:51Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have any ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.  &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should use cm:get_local_faction thing&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Apply this script to the mod, and start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created, even in the component viewer: Check the script, and whether your twui has the correct structure. If you've set up all correctly, check the callbacks of the TWUI components. Very rarely some of them have 'destroy callbacks' in them&lt;br /&gt;
# Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy &lt;br /&gt;
# Things are not showing properly: Check the DBs and references of the DBs in the twui are correct.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=741</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=741"/>
		<updated>2023-07-08T09:03:45Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have any ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.  &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now make write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should use cm:get_local_faction thing&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Now start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created, even in the component viewer: Check the script, and whether your twui has the correct structure. If you've set up all correctly, check the callbacks of the TWUI components. Very rarely some of them have 'destroy callbacks' in them&lt;br /&gt;
# Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy &lt;br /&gt;
# Things are not showing properly: Check the DBs and references of the DBs in the twui are correct.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=740</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=740"/>
		<updated>2023-07-08T04:46:13Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have any ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.  &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now make write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should use cm:get_local_faction thing&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Now start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created, even in the component viewer: Check the script, and whether your twui has the correct structure.&lt;br /&gt;
# Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy &lt;br /&gt;
# Things are not showing properly: Check the DBs and references of the DBs in the twui are correct&lt;br /&gt;
# Check callbacks of the TWUI components. Some of them have destroy callbacks in them.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=739</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=739"/>
		<updated>2023-07-08T03:09:33Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have no ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the GUID&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]  &lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.  &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now make write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should be local&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Now start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created: Check the script, and whether your twui has the correct structure.&lt;br /&gt;
# Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy &lt;br /&gt;
# Things are not showing properly: Check the DBs and references of the DBs in the twui are correct&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=738</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=738"/>
		<updated>2023-07-08T03:08:08Z</updated>

		<summary type="html">&lt;p&gt;Rhox: Finished&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
'''Do not try to use twui unless you're confident with your scripting.''' In many cases, you can't make the twui do what you want because we don't understand many of the twui callbacks (especially from the ones before the Wh3) and you have to use the script for that. So practice scripting, or get a team member who is good at it.&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, look at other tutorials if you don't have no ideas)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml or harmony.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the guide&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. Put the twui made this way into your pack.  &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now make write some script like the one below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name. It's just for showing UI so it should be local&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);--where your TWUI will reside&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Now start the game as Wurrzag and check whether it works. &lt;br /&gt;
[[File:Rhythm.png|center|thumb]] &lt;br /&gt;
Congratulations! You still have to set the script, and DB effect to really make it interesting, but the job on the twui side is done.  &lt;br /&gt;
&lt;br /&gt;
If it's not working, check the following things &lt;br /&gt;
&lt;br /&gt;
# The component is not created: Check the script, and whether your twui has the correct structure.&lt;br /&gt;
# Game CTDs: Check the hierarchy and whether your component has all the components listed in the hierarchy &lt;br /&gt;
# Things are not showing properly: Check the DBs and references of the DBs in the twui are correct&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Rhythm.png&amp;diff=737</id>
		<title>File:Rhythm.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Rhythm.png&amp;diff=737"/>
		<updated>2023-07-08T02:59:25Z</updated>

		<summary type="html">&lt;p&gt;Rhox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wurrzag has the rhythm.&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=736</id>
		<title>Porting other faction's UI feature</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Porting_other_faction%27s_UI_feature&amp;diff=736"/>
		<updated>2023-07-07T17:26:35Z</updated>

		<summary type="html">&lt;p&gt;Rhox: mid save&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial talks about how to create a custom twui based on other vanilla UI&lt;br /&gt;
&lt;br /&gt;
=== Synopsis ===&lt;br /&gt;
Let's say I want to create a new feature for Wurrzag based on his dancing. Huh, what does dancing have to do with Total War and how are we going to represent it? Maybe I should focus on the rhythm of the dancing and fitting the perfect harmony. And for that, we should Harmony feature used by Cathay. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I'm going to skip all the pooled resource parts, for that look at other tutorials)&lt;br /&gt;
&lt;br /&gt;
==== Getting Original Code ====&lt;br /&gt;
[[File:Harmony.png|center|thumb]]&lt;br /&gt;
First, you want to check the path and some component names by playing the Cathay and checking the path to the UI by using the component viewer. You can turn this feature on by checking the check box in the settings and pressing the ` button (the one on your upper left) in your keyboard &lt;br /&gt;
[[File:Twui.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On hud_campaign_resource_bar_wh3.twui.xml, you'll find the twui parts responsible for it. Now it's time to copy it and make our own. &lt;br /&gt;
&lt;br /&gt;
==== Making own twui ====&lt;br /&gt;
Now for Hierarchy, we want to copy 'Root' and all harmony-related parts. So the hierarchy part will look like below. &lt;br /&gt;
[[File:Harmony hierarchy.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
# Now for the component part, we want to copy every component mentioned in the hierarchy, including the root.&lt;br /&gt;
# After that, we want to change the pooled resource name and effect bundle name into what we have set.&lt;br /&gt;
# As a final step, we want to feed the hairy robot a twui we made to change the guide&lt;br /&gt;
&lt;br /&gt;
[[File:Guid regen.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
Congratulations, now you just finished your own twui. Now we have to show it to people via script. &lt;br /&gt;
&lt;br /&gt;
====Scripting====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now make your script and write some script like below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  cm:add_post_first_tick_callback(                                                                       &lt;br /&gt;
     function()&lt;br /&gt;
        if cm:get_local_faction_name(true) == &amp;quot;wh_main_grn_orcs_of_the_bloody_hand&amp;quot; then--put your faction name&lt;br /&gt;
            local parent_ui = find_uicomponent(core:get_ui_root(), &amp;quot;hud_campaign&amp;quot;, &amp;quot;resources_bar_holder&amp;quot;, &amp;quot;resources_bar&amp;quot;);&lt;br /&gt;
            local result = core:get_or_create_component(&amp;quot;rhox_dancer_harmony_holder&amp;quot;, &amp;quot;ui/campaign ui/rhox_dancer.twui.xml&amp;quot;, parent_ui) --put your path to the twui&lt;br /&gt;
            if not result then&lt;br /&gt;
                script_error(&amp;quot;Rhox dancer: &amp;quot;.. &amp;quot;ERROR: could not create harmony ui component? How can this be?&amp;quot;);&lt;br /&gt;
                return false;&lt;br /&gt;
            end;&lt;br /&gt;
        end&lt;br /&gt;
     end&lt;br /&gt;
  )&lt;br /&gt;
Now start the game as Wurrzag and check whether it works. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And you'll find out it's not working. Now we have to find out what is the problem. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Under construction)&lt;/div&gt;</summary>
		<author><name>Rhox</name></author>
	</entry>
</feed>