<?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=Not+All+is+Dust</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=Not+All+is+Dust"/>
	<link rel="alternate" type="text/html" href="https://tw-modding.com/wiki/Special:Contributions/Not_All_is_Dust"/>
	<updated>2026-04-06T18:56:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://tw-modding.com/index.php?title=UI:Build-a-Button_Workshop&amp;diff=1043</id>
		<title>UI:Build-a-Button Workshop</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=UI:Build-a-Button_Workshop&amp;diff=1043"/>
		<updated>2023-10-17T10:30:32Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: changed SetImage to SetImagePath&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lesson two! This time around, we build our button, select its text, give it some stuffing, and ship it off to our relatives for the holidays. We’re building a button!&lt;br /&gt;
&lt;br /&gt;
Before we get into the nitty-gritty, we have to back up into the nit-grit and talk about one more general concept – creating components.&lt;br /&gt;
&lt;br /&gt;
=== One More General Concept – Creating Components ===&lt;br /&gt;
In the previous lecture hall, we discussed finding in-game components, the root component, parentage/childhood, and printing out info. All of this was done with stuff that was already there. We’ll be actually creating a new component object in the game, and to do that we need to understand a few things.&lt;br /&gt;
&lt;br /&gt;
Every UIC in the game is built off of what’s called a “layout file”. Note: this is not to be confused with the “layout” component we saw in the previous lesson. We’ll be seeing it a lot. We can find layout files by loading all CA packs, going into the ui/templates/ folder, and just scrolling on through. All of the files there have no file extension – they’re all hexidecimal files, which define a bunch of details about UIC’s ''created'' with these layout files. Each layout file can be called a bunch of times – there’s no limit to how many &amp;lt;code&amp;gt;panel_title&amp;lt;/code&amp;gt; UICs there can be in the game, for instance.&lt;br /&gt;
&lt;br /&gt;
We won’t yet get into how to read these files and to see what each of them does – we’re going to use ye good ol’ guess-and-check method. Whenever you make a new UIC in-game, your only option is to create one off of these layout files that predefine the deets, which you can change later on.&lt;br /&gt;
&lt;br /&gt;
The command we use here is a method on UIC – it’s to create a direct child of a UIC. It goes like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;UIComponent(uic:CreateComponent(id_of_child, layout_file_path))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I’m going to now make-up a path-from-root UIC, but I’ll choose a real layout file path, so you get the idea:&lt;br /&gt;
 &amp;lt;code&amp;gt;local root = core:get_ui_root()&lt;br /&gt;
 local fake_uic = find_uicomponent(root, &amp;quot;fake_child&amp;quot;, &amp;quot;this_isnt_real_cant_you_tell&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 local child_uic = UIComponent(fake_uic:CreateComponent(&amp;quot;real_child&amp;quot;, &amp;quot;ui/templates/round_small_button&amp;quot;))&amp;lt;/code&amp;gt;&lt;br /&gt;
And what the above does is – it grabs the fake_uic, it creates a child UIC with the ID “real_child”, off the layout file “round_small_button”, and &amp;lt;code&amp;gt;child_uic&amp;lt;/code&amp;gt; is now equivalent to that game object for the child. Pretty cool.&lt;br /&gt;
&lt;br /&gt;
Before we go on, we’re going to use our skillz to figure out how to make a button on some existing row of buttons. Typically this is pretty easy. Find the row of buttons you want to add onto – say, the top right row of buttons with info and stuff, or the row of buttons on the bottom of the army docker – and then click one of those buttons. You’ll get the path-from-root for the ''button'' output – you just need to find the button’s parent, one step higher up the path, and use that as the parent of this new button.&lt;br /&gt;
&lt;br /&gt;
With this, I advise using the DevTool Console. Have the mini-console setup while the UICs you’re messing with are ''on screen and active''. Don’t call any UICs when they’re not on screen, because they might not exist. We’ll get into that later.&lt;br /&gt;
&lt;br /&gt;
Try to find the template button layout file that matches the other buttons with the parent. I’ll give you a hint – the names of the layout files are pretty descriptive!&lt;br /&gt;
&lt;br /&gt;
Return to me when you have a perfectly valid button that does nothing and says nothing!&lt;br /&gt;
&lt;br /&gt;
=== Actual Usage ===&lt;br /&gt;
At this point, you have a perfectly valid button that does nothing and says nothing. We’re going to first give it a tiny bit of spunk, and then we’ll make it actually do something upon being clicked. What it says and what it does is up to you, but I’m going to try and provide the tools needed to do both those things.&lt;br /&gt;
&lt;br /&gt;
First thing’s first, we want to change that image. We’re going to learn our second uic method here – SetImagePath(). It takes one arg (uh, for now) – the path to the image, INCLUDING the file extension. If we wanted to, say, give our &amp;lt;code&amp;gt;child_uic&amp;lt;/code&amp;gt; the below file, we’d write the following:&lt;br /&gt;
 &amp;lt;code&amp;gt;local root = core:get_ui_root()&lt;br /&gt;
 local fake_uic = find_uicomponent(root, &amp;quot;fake_child&amp;quot;, &amp;quot;this_isnt_real_cant_you_tell&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 local child_uic = UIComponent(fake_uic:CreateComponent(&amp;quot;real_child&amp;quot;, &amp;quot;ui/templates/round_small_button&amp;quot;))&lt;br /&gt;
 child_uic:SetImagePath(&amp;quot;ui/skins/default/advisor_beastmen_2d.png&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
[[File:Ui button 01.png|none|thumb|160x160px|Isn't he handsome?]]&lt;br /&gt;
You probably don’t want to use the above example. Find a pretty image to put on the button. Tip: find one with the prefix &amp;lt;code&amp;gt;icon_&amp;lt;/code&amp;gt;, those are all typically made for effect icons/buttons.&lt;br /&gt;
&lt;br /&gt;
After that, let’s give it a tooltip. The method here is &amp;lt;code&amp;gt;uic:SetTooltipText(tooltip_text, true)&amp;lt;/code&amp;gt;. For a quick example:&lt;br /&gt;
 &amp;lt;code&amp;gt;-- same code as above&lt;br /&gt;
 child_uic:SetTooltipText(&amp;quot;I'm a very happy button&amp;quot;, true)&amp;lt;/code&amp;gt;&lt;br /&gt;
Again, I’m not gonna tell you how to live your life, be creative and do some stuff. I will give you one tip though: using the character &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt; in this method allows you create a vanilla-like tooltip, that expands after hovering over the button for sometime. I recommend testing out that – as well as testing out some various loc tags. Test a UI tr, test UI tagged images, test colored text.&lt;br /&gt;
&lt;br /&gt;
And the last thing’s last – the ''actual usage''. (I just used the title of the movie in a scene, bonus points?)&lt;br /&gt;
&lt;br /&gt;
This part should remain relatively simple, though the actual nuts and bolts of usage will be left up to you. All we’re doing is establishing a listener for the button being clicked, and then we effect change.&lt;br /&gt;
 &amp;lt;code&amp;gt;-- same code as above pt.2&lt;br /&gt;
 core:add_listener(&lt;br /&gt;
     &amp;quot;MyButtonListener&amp;quot;,&lt;br /&gt;
     &amp;quot;ComponentLClickUp&amp;quot;,&lt;br /&gt;
     function(context)&lt;br /&gt;
         return child_uic == UIComponent(context.component)&lt;br /&gt;
     end,&lt;br /&gt;
     function(context)&lt;br /&gt;
         out(&amp;quot;It Worked!&amp;quot;)&lt;br /&gt;
     end,&lt;br /&gt;
     true&lt;br /&gt;
 )&amp;lt;/code&amp;gt;&lt;br /&gt;
Every time the button is pressed, I would find a new line in my script log saying “It Worked!”. How quaint.&lt;br /&gt;
&lt;br /&gt;
I’ll take the time now to cover this. There are a few UIC listeners – we’ll probably cover most before long. All of them have the same two bits of data you can access – &amp;lt;code&amp;gt;context.component&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;context.string&amp;lt;/code&amp;gt;. The former can be used as in the listener to grab the UIC game object (I’m checking to see if the button pressed is the &amp;lt;code&amp;gt;child_uic&amp;lt;/code&amp;gt; that we made above), while the latter can be used to check the ID of the UIC game object, quickly. In this instance, I could also write a conditional that looks like the following:&lt;br /&gt;
     &amp;lt;code&amp;gt;function(context)&lt;br /&gt;
         return context.string == &amp;quot;real_child&amp;quot;&lt;br /&gt;
     end,&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Your Turn ===&lt;br /&gt;
At this point, you’re off to the wild. Attempt creating a brand new button, giving it a new image, giving it an expandable tooltip, and making the button do something when you press it. Keep the “thing it does” relatively simple – output text, pan the camera, move a character. Just make sure the thing it does isn’t anything UI related, just cause game change for now.&lt;br /&gt;
&lt;br /&gt;
Next up, we’re gonna get into a few more upgrades for our button – including giving that button varied tooltips and making it inactive, based on criteria!&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=727</id>
		<title>Tutorial:Shared Unit Caps</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=727"/>
		<updated>2023-07-07T01:04:03Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This page is specifically on what shared unit caps are, how they are set up, what they are used for, and how they interact with normal unit caps.&lt;br /&gt;
&lt;br /&gt;
Shared unit caps where introduced with the Forge of the Chaos Dwarfs DLC. They make it so the player needs to choose between one unit when using caps. &lt;br /&gt;
Example: Both the Infernal Guard and Infernal Guard (Great Weapons) share the same cap so after unlocking one additional cap the player must choose between recruiting one unit or the other.&lt;br /&gt;
&lt;br /&gt;
This mechanic allows for more diversity of units with different weapons without bloating a roster and still make the caps restrictive and not have undesirable available units.&lt;br /&gt;
Example: The Beastmen have caps, but because they don't have shared caps, the way they are unlocked can either feel too restrictive or not enough. The three minotaur units cap has to be increased separately making them to restrictive and the three centigor units when increased are all increased by one making it likely there are undesirable centigors.&lt;br /&gt;
&lt;br /&gt;
== Tables Required: ==&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
&lt;br /&gt;
== Detailed Explanation: ==&lt;br /&gt;
======db/unit_lists_tables======&lt;br /&gt;
Create a unit list key, it is a unique key that will be used to represent all the units that will get the cap.&lt;br /&gt;
&lt;br /&gt;
======db/unit_to_unit_list_junctions_tables======&lt;br /&gt;
Where you connect the or more than one main unit key to the unit list key.&lt;br /&gt;
&lt;br /&gt;
======db/unit_allowances_tables======&lt;br /&gt;
This table has 3 fields:&lt;br /&gt;
*'''Unit List''' is where the unit list key will be.&lt;br /&gt;
*'''Point Cap''' the number that determines the starting cap amount, it can be &amp;quot;0&amp;quot;.&lt;br /&gt;
*'''Subculture''' serves to limit the capping of the unit to a specific subculture, if this field isn't filled all factions and cultures this unit is available will find that unit with a cap. &lt;br /&gt;
&lt;br /&gt;
======db/main_units_tables======&lt;br /&gt;
In main units there are two relevant fields about shared unit caps:&lt;br /&gt;
*'''Campaign Cap''' while normal caps have this field be &amp;quot;0&amp;quot; with shared caps this field  must be &amp;quot;-1&amp;quot;.&lt;br /&gt;
*'''Point Allowance Weight''' this number determines how much does one unit weight in the cap. This is used for some of the chaos dwarf trains because they have two carriages but can be used for if you want the player to have to choose between having fewer higher tier units or lots of low tier units.&lt;br /&gt;
&lt;br /&gt;
======db/effects_tables======&lt;br /&gt;
Interacting with the shared caps by adding or removing is done via effects. The most common way chaos dwarfs do this is by connecting the effect to a effect bundle and use scripting to change the cap of those units that bundle gives to the player. Because this uses effects it requires a localisation entry in a .loc file, usually the text is &amp;quot;Unit capacity: %+n\\nMinotaurs&amp;quot; with substituting minotaurs for the what represents all units in the cap.&lt;br /&gt;
*'''Effect''' Create a effect key, it is a unique key that will be used to represent the process of adding and removing from the cap.&lt;br /&gt;
*'''Icon''' and '''Icon Negative''' are usually &amp;quot;unit_capacity.png&amp;quot;.&lt;br /&gt;
*'''Priority''' is usually high 1 or 2 the lower the number the higher it will show up to the player when they look at the effect.&lt;br /&gt;
*'''Category''' is &amp;quot;campaign&amp;quot;.&lt;br /&gt;
*'''Is Positive Value Good''' set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
======db/effect_bonus_value_unit_list_junctions_tables======&lt;br /&gt;
This table connects the unit list key to the effect key. It has three fields:&lt;br /&gt;
*'''Bonus Value Id''' is &amp;quot;unit_allowance_point_cap_mod&amp;quot;.&lt;br /&gt;
*'''Unit List''' is the unit list key. One Unit list can be referenced by several effects.&lt;br /&gt;
*'''Effect''' is the effect key. One effect can have several unit lists.&lt;br /&gt;
&lt;br /&gt;
== Final Notes: ==&lt;br /&gt;
Shared caps overwrite the normal caps. Tried to do shared caps for both types of tomb guard and it overwrites the caps of vanilla. A new effect is still needed to be given to the same building.&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=726</id>
		<title>Tutorial:Shared Unit Caps</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=726"/>
		<updated>2023-07-07T00:58:55Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This page is specifically on what shared unit caps are, how they are set up, what they are used for, and how they interact with normal unit caps.&lt;br /&gt;
&lt;br /&gt;
Shared unit caps where introduced with the Forge of the Chaos Dwarfs DLC. They make it so the player needs to choose between one unit when using caps. &lt;br /&gt;
Example: Both the Infernal Guard and Infernal Guard (Great Weapons) share the same cap so after unlocking one additional cap the player must choose between recruiting one unit or the other.&lt;br /&gt;
&lt;br /&gt;
This mechanic allows for more diversity of units with different weapons without bloating a roster and still make the caps restrictive and not have undesirable available units.&lt;br /&gt;
Example: The Beastmen have caps, but because they don't have shared caps, the way they are unlocked can either feel too restrictive or not enough. The three minotaur units cap has to be increased separately making them to restrictive and the three centigor units when increased are all increased by one making it likely there are undesirable centigors.&lt;br /&gt;
&lt;br /&gt;
== Tables Required: ==&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
&lt;br /&gt;
== Detailed Explanation: ==&lt;br /&gt;
======db/unit_lists_tables======&lt;br /&gt;
Create a unit list key, it is a unique key that will be used to represent all the units that will get the cap&lt;br /&gt;
&lt;br /&gt;
======db/unit_to_unit_list_junctions_tables======&lt;br /&gt;
Where you connect the or more than one main unit key to the unit list key.&lt;br /&gt;
&lt;br /&gt;
======db/unit_allowances_tables======&lt;br /&gt;
This table has 3 fields&lt;br /&gt;
*'''Unit List''' is where the unit list key will be.&lt;br /&gt;
*'''Point Cap''' the number that determines the starting cap amount, it can be &amp;quot;0&amp;quot;.&lt;br /&gt;
*'''Subculture''' serves to limit the capping of the unit to a specific subculture, if this field isn't filled all factions and cultures this unit is available will find that unit with a cap. &lt;br /&gt;
&lt;br /&gt;
======db/main_units_tables======&lt;br /&gt;
In main units there are two relevant fields about shared unit caps&lt;br /&gt;
*'''Campaign Cap''' while normal caps have this field be &amp;quot;0&amp;quot; with shared caps this field  must be &amp;quot;-1&amp;quot;.&lt;br /&gt;
*'''Point Allowance Weight''' this number determines how much does one unit weight in the cap. This is used for some of the chaos dwarf trains because they have two carriages but can be used for if you want the player to have to choose between having fewer higher tier units or lots of low tier units.&lt;br /&gt;
&lt;br /&gt;
======db/effects_tables======&lt;br /&gt;
Interacting with the shared caps by adding or removing is done via effects. The most common way chaos dwarfs do this is by connecting the effect to a effect bundle and use scripting to change the cap of those units that bundle gives to the player. Because this uses effects it requires a localisation entry in a .loc file, usually the text is &amp;quot;Unit capacity: %+n\\nMinotaurs&amp;quot; with substituting minotaurs for the what represents all units in the cap.&lt;br /&gt;
*'''Effect''' Create a effect key, it is a unique key that will be used to represent the process of adding and removing from the cap.&lt;br /&gt;
*'''Icon''' and '''Icon Negative''' are usually &amp;quot;unit_capacity.png&amp;quot;.&lt;br /&gt;
*'''Priority''' is usually high 1 or 2 the lower the number the higher it will show up to the player when they look at the effect.&lt;br /&gt;
*'''Category''' is &amp;quot;campaign&amp;quot;.&lt;br /&gt;
*'''Is Positive Value Good''' set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
======db/effect_bonus_value_unit_list_junctions_tables======&lt;br /&gt;
This table connects the unit list key to the effect key. It has three fields&lt;br /&gt;
*'''Bonus Value Id''' is &amp;quot;unit_allowance_point_cap_mod&amp;quot;.&lt;br /&gt;
*'''Unit List''' is the unit list key. One Unit list can be referenced by several effects.&lt;br /&gt;
*'''Effect''' is the effect key. One effect can have several unit lists.&lt;br /&gt;
&lt;br /&gt;
== Final Notes: ==&lt;br /&gt;
Shared caps overwrite the normal caps. Tried to do shared caps for both types of tomb guard and it overwrites the caps of vanilla. A new effect is still needed to be given to the same building.&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=725</id>
		<title>Tutorial:Shared Unit Caps</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=725"/>
		<updated>2023-07-07T00:58:01Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This page is specifically on what shared unit caps are, how they are set up, what they are used for, and how they interact with normal unit caps.&lt;br /&gt;
&lt;br /&gt;
Shared unit caps where introduced with the Forge of the Chaos Dwarfs DLC. They make it so the player needs to choose between one unit when using caps. &lt;br /&gt;
Example: Both the Infernal Guard and Infernal Guard (Great Weapons) share the same cap so after unlocking one additional cap the player must choose between recruiting one unit or the other.&lt;br /&gt;
&lt;br /&gt;
This mechanic allows for more diversity of units with different weapons without bloating a roster and still make the caps restrictive and not have undesirable available units.&lt;br /&gt;
Example: The Beastmen have caps, but because they don't have shared caps, the way they are unlocked can either feel too restrictive or not enough. The three minotaur units cap has to be increased separately making them to restrictive and the three centigor units when increased are all increased by one making it likely there are undesirable centigors.&lt;br /&gt;
&lt;br /&gt;
== Tables Required: ==&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
&lt;br /&gt;
== Detailed Explanation: ==&lt;br /&gt;
======db/unit_lists_tables======&lt;br /&gt;
Create a unit list key, it is a unique key that will be used to represent all the units that will get the cap&lt;br /&gt;
&lt;br /&gt;
======db/unit_to_unit_list_junctions_tables======&lt;br /&gt;
Where you connect the or more than one main unit key to the unit list key.&lt;br /&gt;
&lt;br /&gt;
======db/unit_allowances_tables======&lt;br /&gt;
This table has 3 fields&lt;br /&gt;
#*'''Unit List''' is where the unit list key will be.&lt;br /&gt;
#*'''Point Cap''' the number that determines the starting cap amount, it can be &amp;quot;0&amp;quot;.&lt;br /&gt;
#*'''Subculture''' serves to limit the capping of the unit to a specific subculture, if this field isn't filled all factions and cultures this unit is available will find that unit with a cap. &lt;br /&gt;
&lt;br /&gt;
======db/main_units_tables======&lt;br /&gt;
In main units there are two relevant fields about shared unit caps&lt;br /&gt;
#*'''Campaign Cap''' while normal caps have this field be &amp;quot;0&amp;quot; with shared caps this field  must be &amp;quot;-1&amp;quot;.&lt;br /&gt;
#*'''Point Allowance Weight''' this number determines how much does one unit weight in the cap. This is used for some of the chaos dwarf trains because they have two carriages but can be used for if you want the player to have to choose between having fewer higher tier units or lots of low tier units.&lt;br /&gt;
&lt;br /&gt;
======db/effects_tables======&lt;br /&gt;
Interacting with the shared caps by adding or removing is done via effects. The most common way chaos dwarfs do this is by connecting the effect to a effect bundle and use scripting to change the cap of those units that bundle gives to the player. Because this uses effects it requires a localisation entry in a .loc file, usually the text is &amp;quot;Unit capacity: %+n\\nMinotaurs&amp;quot; with substituting minotaurs for the what represents all units in the cap.&lt;br /&gt;
#*'''Effect''' Create a effect key, it is a unique key that will be used to represent the process of adding and removing from the cap.&lt;br /&gt;
#*'''Icon''' and '''Icon Negative''' are usually &amp;quot;unit_capacity.png&amp;quot;.&lt;br /&gt;
#*'''Priority''' is usually high 1 or 2 the lower the number the higher it will show up to the player when they look at the effect.&lt;br /&gt;
#*'''Category''' is &amp;quot;campaign&amp;quot;.&lt;br /&gt;
#*'''Is Positive Value Good''' set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
======db/effect_bonus_value_unit_list_junctions_tables======&lt;br /&gt;
This table connects the unit list key to the effect key. It has three fields&lt;br /&gt;
#*'''Bonus Value Id''' is &amp;quot;unit_allowance_point_cap_mod&amp;quot;.&lt;br /&gt;
#*'''Unit List''' is the unit list key. One Unit list can be referenced by several effects.&lt;br /&gt;
#*'''Effect''' is the effect key. One effect can have several unit lists.&lt;br /&gt;
&lt;br /&gt;
== Final Notes: ==&lt;br /&gt;
Shared caps overwrite the normal caps. Tried to do shared caps for both types of tomb guard and it overwrites the caps of vanilla. A new effect is still needed to be given to the same building.&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=723</id>
		<title>Tutorial:Shared Unit Caps</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=723"/>
		<updated>2023-07-07T00:57:01Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This page is specifically on what shared unit caps are, how they are set up, what they are used for, and how they interact with normal unit caps.&lt;br /&gt;
&lt;br /&gt;
Shared unit caps where introduced with the Forge of the Chaos Dwarfs DLC. They make it so the player needs to choose between one unit when using caps. &lt;br /&gt;
Example: Both the Infernal Guard and Infernal Guard (Great Weapons) share the same cap so after unlocking one additional cap the player must choose between recruiting one unit or the other.&lt;br /&gt;
&lt;br /&gt;
This mechanic allows for more diversity of units with different weapons without bloating a roster and still make the caps restrictive and not have undesirable available units.&lt;br /&gt;
Example: The Beastmen have caps, but because they don't have shared caps, the way they are unlocked can either feel too restrictive or not enough. The three minotaur units cap has to be increased separately making them to restrictive and the three centigor units when increased are all increased by one making it likely there are undesirable centigors.&lt;br /&gt;
&lt;br /&gt;
== Tables Required: ==&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
&lt;br /&gt;
== Detailed Explanation: ==&lt;br /&gt;
======db/unit_lists_tables======&lt;br /&gt;
Create a unit list key, it is a unique key that will be used to represent all the units that will get the cap&lt;br /&gt;
&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
Where you connect the or more than one main unit key to the unit list key.&lt;br /&gt;
&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
This table has 3 fields&lt;br /&gt;
#*'''Unit List''' is where the unit list key will be.&lt;br /&gt;
#*'''Point Cap''' the number that determines the starting cap amount, it can be &amp;quot;0&amp;quot;.&lt;br /&gt;
#*'''Subculture''' serves to limit the capping of the unit to a specific subculture, if this field isn't filled all factions and cultures this unit is available will find that unit with a cap. &lt;br /&gt;
&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
In main units there are two relevant fields about shared unit caps&lt;br /&gt;
#*'''Campaign Cap''' while normal caps have this field be &amp;quot;0&amp;quot; with shared caps this field  must be &amp;quot;-1&amp;quot;.&lt;br /&gt;
#*'''Point Allowance Weight''' this number determines how much does one unit weight in the cap. This is used for some of the chaos dwarf trains because they have two carriages but can be used for if you want the player to have to choose between having fewer higher tier units or lots of low tier units.&lt;br /&gt;
&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
Interacting with the shared caps by adding or removing is done via effects. The most common way chaos dwarfs do this is by connecting the effect to a effect bundle and use scripting to change the cap of those units that bundle gives to the player. Because this uses effects it requires a localisation entry in a .loc file, usually the text is &amp;quot;Unit capacity: %+n\\nMinotaurs&amp;quot; with substituting minotaurs for the what represents all units in the cap.&lt;br /&gt;
##'''Effect''' Create a effect key, it is a unique key that will be used to represent the process of adding and removing from the cap.&lt;br /&gt;
##'''Icon''' and '''Icon Negative''' are usually &amp;quot;unit_capacity.png&amp;quot;.&lt;br /&gt;
##'''Priority''' is usually high 1 or 2 the lower the number the higher it will show up to the player when they look at the effect.&lt;br /&gt;
##'''Category''' is &amp;quot;campaign&amp;quot;.&lt;br /&gt;
##'''Is Positive Value Good''' set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
This table connects the unit list key to the effect key. It has three fields&lt;br /&gt;
##'''Bonus Value Id''' is &amp;quot;unit_allowance_point_cap_mod&amp;quot;.&lt;br /&gt;
##'''Unit List''' is the unit list key. One Unit list can be referenced by several effects.&lt;br /&gt;
##'''Effect''' is the effect key. One effect can have several unit lists.&lt;br /&gt;
&lt;br /&gt;
== Final Notes: ==&lt;br /&gt;
Shared caps overwrite the normal caps. Tried to do shared caps for both types of tomb guard and it overwrites the caps of vanilla. A new effect is still needed to be given to the same building.&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=722</id>
		<title>Tutorial:Shared Unit Caps</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Shared_Unit_Caps&amp;diff=722"/>
		<updated>2023-07-07T00:56:17Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: Explanation on Shared unit caps introduced with the Chaos Dwarfs.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This page is specifically on what shared unit caps are, how they are set up, what they are used for, and how they interact with normal unit caps.&lt;br /&gt;
&lt;br /&gt;
Shared unit caps where introduced with the Forge of the Chaos Dwarfs DLC. They make it so the player needs to choose between one unit when using caps. &lt;br /&gt;
Example: Both the Infernal Guard and Infernal Guard (Great Weapons) share the same cap so after unlocking one additional cap the player must choose between recruiting one unit or the other.&lt;br /&gt;
&lt;br /&gt;
This mechanic allows for more diversity of units with different weapons without bloating a roster and still make the caps restrictive and not have undesirable available units.&lt;br /&gt;
Example: The Beastmen have caps, but because they don't have shared caps, the way they are unlocked can either feel too restrictive or not enough. The three minotaur units cap has to be increased separately making them to restrictive and the three centigor units when increased are all increased by one making it likely there are undesirable centigors.&lt;br /&gt;
&lt;br /&gt;
== Tables Required: ==&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
&lt;br /&gt;
== Detailed Explanation: ==&lt;br /&gt;
#db/unit_lists_tables&lt;br /&gt;
Create a unit list key, it is a unique key that will be used to represent all the units that will get the cap&lt;br /&gt;
&lt;br /&gt;
#db/unit_to_unit_list_junctions_tables&lt;br /&gt;
Where you connect the or more than one main unit key to the unit list key.&lt;br /&gt;
&lt;br /&gt;
#db/unit_allowances_tables&lt;br /&gt;
This table has 3 fields&lt;br /&gt;
#*'''Unit List''' is where the unit list key will be.&lt;br /&gt;
#*'''Point Cap''' the number that determines the starting cap amount, it can be &amp;quot;0&amp;quot;.&lt;br /&gt;
#*'''Subculture''' serves to limit the capping of the unit to a specific subculture, if this field isn't filled all factions and cultures this unit is available will find that unit with a cap. &lt;br /&gt;
&lt;br /&gt;
#db/main_units_tables&lt;br /&gt;
In main units there are two relevant fields about shared unit caps&lt;br /&gt;
#*'''Campaign Cap''' while normal caps have this field be &amp;quot;0&amp;quot; with shared caps this field  must be &amp;quot;-1&amp;quot;.&lt;br /&gt;
#*'''Point Allowance Weight''' this number determines how much does one unit weight in the cap. This is used for some of the chaos dwarf trains because they have two carriages but can be used for if you want the player to have to choose between having fewer higher tier units or lots of low tier units.&lt;br /&gt;
&lt;br /&gt;
#db/effects_tables&lt;br /&gt;
Interacting with the shared caps by adding or removing is done via effects. The most common way chaos dwarfs do this is by connecting the effect to a effect bundle and use scripting to change the cap of those units that bundle gives to the player. Because this uses effects it requires a localisation entry in a .loc file, usually the text is &amp;quot;Unit capacity: %+n\\nMinotaurs&amp;quot; with substituting minotaurs for the what represents all units in the cap.&lt;br /&gt;
##'''Effect''' Create a effect key, it is a unique key that will be used to represent the process of adding and removing from the cap.&lt;br /&gt;
##'''Icon''' and '''Icon Negative''' are usually &amp;quot;unit_capacity.png&amp;quot;.&lt;br /&gt;
##'''Priority''' is usually high 1 or 2 the lower the number the higher it will show up to the player when they look at the effect.&lt;br /&gt;
##'''Category''' is &amp;quot;campaign&amp;quot;.&lt;br /&gt;
##'''Is Positive Value Good''' set to &amp;quot;true&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
#db/effect_bonus_value_unit_list_junctions_tables&lt;br /&gt;
This table connects the unit list key to the effect key. It has three fields&lt;br /&gt;
##'''Bonus Value Id''' is &amp;quot;unit_allowance_point_cap_mod&amp;quot;.&lt;br /&gt;
##'''Unit List''' is the unit list key. One Unit list can be referenced by several effects.&lt;br /&gt;
##'''Effect''' is the effect key. One effect can have several unit lists.&lt;br /&gt;
&lt;br /&gt;
== Final Notes: ==&lt;br /&gt;
Shared caps overwrite the normal caps. Tried to do shared caps for both types of tomb guard and it overwrites the caps of vanilla. A new effect is still needed to be given to the same building.&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Map_Making_for_WH3&amp;diff=577</id>
		<title>Tutorial:Map Making for WH3</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Map_Making_for_WH3&amp;diff=577"/>
		<updated>2023-03-03T15:33:52Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=====Originally written by WakaWaka300 and posted by All is Dust=====&lt;br /&gt;
&lt;br /&gt;
===Map Making in WH3===&lt;br /&gt;
CA said that and I quote &amp;quot;Terry is going to feel quite different. It's the full-fat version of the tools that we use in house. This should give you more power, but will also be more complicated with initial set ups.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So thankfully WakaWaka300 gave us some tutorials. You can fidn the original tutorials and extra files like examples and templates [https://drive.google.com/drive/folders/1HfSee67Xq9VG67O39v7vt2fE7CgwNfDD HERE].&lt;br /&gt;
&lt;br /&gt;
The tutorials in question are:&lt;br /&gt;
&lt;br /&gt;
==WH3 Map Optimisation Guide==&lt;br /&gt;
&lt;br /&gt;
===File Size Optimization===&lt;br /&gt;
As we continue to make more and more maps, I think one thing that will be critically important going forward is to manage file size. Looking at the file sizes of the working_data files that are generated by Terry, it quickly becomes apparent that the largest contributor to map file size is various procedural generation data. This consists of the trees, grass, pebbles, etc that are generated depending on the texture channel being used in a particular area. See below for an example of the file sizes present in my map “Road to Vaul’s Anvil”; files related to procedurally generated objects are highlighted.&lt;br /&gt;
&lt;br /&gt;
[[File:file5.png|thumb|link=Special:FilePath/File5.png]]&lt;br /&gt;
 &lt;br /&gt;
One thing that jumps out is that grass in particular takes up a lot of space because each grass blade’s position, rotation, etc are stored individually instead of being generated at the start of each battle. At the same time, I noticed that CA omits grass generation outside of the playable area in many of their maps (see Arnheim below as an example where the grass stops generating shortly beyond the white line)&lt;br /&gt;
 &lt;br /&gt;
[[File:battle4.png|thumb|link=Special:FilePath/Battle4.png]]&lt;br /&gt;
&lt;br /&gt;
From what I can tell, there is also an automatic system that deletes any small procedural objects, such as grass, from tiles in the outfield (outside the playable tile). However, for the space in between the playable area (white lines), and the outfield tiles, the grass here has to be removed manually. Don’t worry though, the process really isn’t that hard!&lt;br /&gt;
&lt;br /&gt;
To illustrate this process, I have made an example map:&lt;br /&gt;
&lt;br /&gt;
[[File:green3.png|thumb|link=Special:FilePath/Green3.png]]&lt;br /&gt;
&lt;br /&gt;
First, CA already has a pretty nifty tool for deleting any procedural objects in the form of procedural exclusion zones. These can be accessed via “entity creation &amp;gt; visual”. So just put them in such a way as to cover the whole tile area between the white lines and tile edge. It’s ok if you have multiple zones overlap. So here is an example of that:&lt;br /&gt;
 &lt;br /&gt;
[[File:green2.png|thumb|link=Special:FilePath/Green2.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, while it has done a good job of deleting all the extra grass, it has also deleted the trees in the various forests outside the playable area. Those are procedural trees after all! In order to fix this, we need to recreate those forests using the vegetation paint tool rather than allowing them to be procedurally generated using the forest terrain type.&lt;br /&gt;
&lt;br /&gt;
To assist with this, it may be easier to temporarily change the forest01 texture channel to something like white or snow to make it easier to see. But that’s up to you obviously. Next, you have to set up a list of trees to make the painted forest blend in with the normal one. You will probably have to fool around with this for while to make it look right.&lt;br /&gt;
See below for example of painted trees.&lt;br /&gt;
 &lt;br /&gt;
[[File:green1.png|thumb|link=Special:FilePath/Green1.png]]&lt;br /&gt;
&lt;br /&gt;
Afterwards, I simply change the texture type back to forest01 to get the trees in the middle back.&lt;br /&gt;
&lt;br /&gt;
[[File:green.png|thumb|link=Special:FilePath/Green.png]]&lt;br /&gt;
 &lt;br /&gt;
===FPS Optimization===&lt;br /&gt;
So I suppose there isn’t really much to say here. CA’s engine can indeed handle a lot of objects at once, so you don’t really have to worry about that. What will really bog the game down is putting in lots of VFX, especially transparency effects. Why does this cause issues? Because of overdraw.&lt;br /&gt;
 &lt;br /&gt;
[[File:Optimization.png|thumb|link=Special:FilePath/Optimization.png]]&lt;br /&gt;
&lt;br /&gt;
Overdraw (visualised here in red) is when the game engine gets bogged by essentially redrawing the same pixel multiple times due to transparency overlap. As a result, you can definitely use fog effects if you want to, but don’t spam them close together, and try not to scale them up in such a way that you could see one through another&lt;br /&gt;
&lt;br /&gt;
In case you’re wondering, this is (probably) why the cathay maps perform so badly in the base game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WH3 Domination Map Making Guide==&lt;br /&gt;
&lt;br /&gt;
===INITIAL FILE SETUP===&lt;br /&gt;
When you first open Terry, you will be greeted by the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_1.png|thumb|link=Special:FilePath/dmmg_1.png]]&lt;br /&gt;
&lt;br /&gt;
Lets get some terminology straight first:&lt;br /&gt;
1.	A “tile” is a section of terrain (of any size) that can be loaded as the playable map or as part of the outfield or vista&lt;br /&gt;
2.	A “tile map” is the outfield (background outside the playable area) that gets loaded in game whenever you boot up a map. As the name implies, a tile map is an arrangement of multiple tiles.&lt;br /&gt;
3.	A “prefab” is a collection of objects that can be loaded in and selected as one entity. It’s useful for making maps quickly as you will likely find with the CA-made prefabs. This guide will not touch on prefabs&lt;br /&gt;
&lt;br /&gt;
As of the initial writing of this guide, we don’t have any tile maps made by the community (or by CA) for use in WH3, but we do have all the WH2 tile maps (and most of them seem to work!). As such, I have uploaded them here for use in your maps.&lt;br /&gt;
&lt;br /&gt;
For the best compatibility with the existing WH2 tile maps, you should use 8x8 as your tile size. This “size” refers to the grid size of the green squares when you load up your tile.&lt;br /&gt;
&lt;br /&gt;
For climate, this controls the texture set used for your tile, and it should be pretty self-explanatory. This does not control the environment (lighting and atmospherics)&lt;br /&gt;
&lt;br /&gt;
The first time, save your map using “save as…”, which will pull up a dialog asking you to save a tile set and name. The name is not the display name for the map, and for the tile set you use, please save it as domination. Be sure to leave the box checked at the bottom.&lt;br /&gt;
 &lt;br /&gt;
[[File:dmmg_2.png|thumb|link=Special:FilePath/dmmg_2.png]]&lt;br /&gt;
&lt;br /&gt;
If you are importing a WH2 map, you need to change “ProjectTilewithVista” in the .terry file to “ProjectTile” by opening the file with notepad and changing it manually. In addition, when you load the map in, you will likely be greeted by a red hellscape. To get rid of this, you have to load a new environment file in “settings” at the bottom right.&lt;br /&gt;
&lt;br /&gt;
Whenever you reload a map, you may often be greeted by overly dark shadows. To fix this, regenerate light probes in settings (shown below).&lt;br /&gt;
&lt;br /&gt;
Insert the provided terry_buildings file into WH3’s data directory to add additional buildings into terry for your use.&lt;br /&gt;
&lt;br /&gt;
Finally, you should refrain from putting anything in your map below y=0 due to a water heights issue. If you do have stuff below y=0, then you will have to raise the tile map until no terrain is below y=0 in order to prevent floating unit icons.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_3.png|thumb|link=Special:FilePath/dmmg_3.png]]&lt;br /&gt;
&lt;br /&gt;
===SETTING UP INITIAL DEPLOYMENT&lt;br /&gt;
So we’ve skipped ahead a little since the act of texturing, placing objects, adjusting the height map, etc hasn’t changed much from previous iterations of terry and is very intuitive. This section will basically cover how to set up deployment zones. However, as best practice, you should also set up no-go zones around any impassable terrain and check the size of your map as you make it with the prop “ref_group_human”.&lt;br /&gt;
&lt;br /&gt;
For deployment zones, go to tools &amp;gt; entity creation (logical), and create one on each side. Next, go to the object tree on the left and click on each zone. In each, you will find an additive deployment zone region. This is the zone players will deploy in to start the game. Next change one of the zones to alliance ID 1 and it will turn red. Remember that blue is attackers and red is defenders (very intuitive, I know).&lt;br /&gt;
&lt;br /&gt;
With your initial deployment zones made, create another deployment zone region with tools &amp;gt; entity creation (logical). The option is only accessible if you have selected the corresponding deployment zone you want it to be associated with. This deployment zone region will be for vanguard deployment and will use the zone type “guerilla exclusion additive”.&lt;br /&gt;
&lt;br /&gt;
Basically, the way guerilla exclusion additive zones work in Terry is that it prevents the opposite alliance from deploying in that zone. In other words, the opposite team can vanguard deploy everywhere except for the enemy alliance’s guerilla exclusion zone. See below for an example of how my zones are set up. I have drawn over the zones to make them easier to see.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_4.png|thumb|link=Special:FilePath/dmmg_4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_5.png|thumb|link=Special:FilePath/dmmg_5.png]]&lt;br /&gt;
 &lt;br /&gt;
As you can see, there will be some overlap between guerilla exclusion zones in the middle. As a final note, you must ensure that players cannot vanguard deploy onto the domination points since that would allow them to capture them before the match starts.&lt;br /&gt;
&lt;br /&gt;
Finally, you can make a playable area using tools &amp;gt; entity creation (logical). This defines what space in the tile that players can actually move around in (aka, the “white lines”). I think it should be between 2x2 and 3x3 or so, but it’s highly variable depending on how big or what shape you want the map to be. &lt;br /&gt;
&lt;br /&gt;
===SECTION 3: SETTING UP DOMINATION CAPTURE POINTS===&lt;br /&gt;
To make capture points, go to tools &amp;gt; entity creation (logical) and create a capture point. You can make the point any shape, but I will use the rectangular shape as a reference. For type, use domination 1, 2, or 3 depending on which point you are making. For importance, you must use “score”. For size, I think anywhere between 80x80 to 180x180 can work depending on the map. See below for reference.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_5_1.png|thumb|link=Special:FilePath/dmmg_5_1.png]]&lt;br /&gt;
&lt;br /&gt;
===SETTING UP TELEPORT POINTS===&lt;br /&gt;
To make the points used to spawn units in, go to tools &amp;gt; entity creation (logical), and create an ai hint. Use the type “attacker (or defender) teleport reinforcement line” and create a single, short line with two points. Remember, attacker is the blue side and defender is the red side.&lt;br /&gt;
&lt;br /&gt;
The vanguard deployment lines are exactly the same, but make sure to check the box for vanguard deployment in the entity properties. See below as an example for one of the vanguard points.&lt;br /&gt;
&lt;br /&gt;
If you have issues with the teleport point not appearing in game, it is likely due to the line being too short. If it’s about 20 units long, that’s enough.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_6.png|thumb|link=Special:FilePath/dmmg_6.png]]&lt;br /&gt;
 &lt;br /&gt;
===SETTING UP THE TILE MAP===&lt;br /&gt;
At this point, you have to understand two different file locations where map files are stored. In your assembly kit folder (located within WH3 wherever you have that stored), you will find two folders, raw_data and working_data. Raw data is the files that the modding tools will work with to make maps, while working data is the stuff that the mod tools export which you will need to compile to make the final map file. Everything we need will be located within the terrain folders of each.&lt;br /&gt;
&lt;br /&gt;
When you are more-or-less done with the map, go to “tools &amp;gt; create battle for tile…”. This will create a tile map file associated with this map in raw_data&amp;gt;terrain&amp;gt;battles&amp;gt;yourmap. You will only need to do this once. This has generated a tile map for your tile, but we need to change it because the climate isn’t set up and there’s no outfield.&lt;br /&gt;
&lt;br /&gt;
This is where you either create your own tile map or use one of the WH2 ones (I would suggest the latter for now). Use the vistas I have provided with this guide to pull the tile_map.png and climate_map.png files from whatever vista you want into the tile map folder that was generated. The tile map tells the game which tiles from the tile db to generate in the outfield, and the climate map tells the game which textures to use. Climate map colors are located in the settings file of terrain&amp;gt;tiles&amp;gt;battle&amp;gt;_tile_database. Tile map colors and sizes are located in the tile database found in terry. See below for an example of the files needed in the tile map folder. The extra terry user file is only generated when you open the tile map in Terry.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_7.png|thumb|link=Special:FilePath/dmmg_7.png]]&lt;br /&gt;
&lt;br /&gt;
Next, you need to modify the explicit_tiles file to tell the game where the playable tile is located within the tile map. By default, it will probably be something like this:&lt;br /&gt;
&lt;br /&gt;
3,3,terrain/tiles/battle/lzd_hills_infield/chaqua_pit,0&lt;br /&gt;
&lt;br /&gt;
If you are using an 8x8 tile and one of the WH2 tile maps, your map will line up with the 8x8 black square in the middle. Open the tile map in a program like [https://www.gimp.org/ GIMP] to view the coordinates of the upper left corner of the black square. Change the first two numbers of the explicit_tiles file to these coordinates. See below for an example of the 28,28 coordinates for a 64x64 tile map.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_8.png|thumb|link=Special:FilePath/dmmg_8.png]]&lt;br /&gt;
 &lt;br /&gt;
Once you’re done with this open up the .terry file (the tile map) in Terry itself. This will initially load a tile map that is too small and isn’t using the right climate, but don’t panic! Changes to the tile map file will only show up in the editor once you have exported it, so do that now using file &amp;gt; process with BOB. To see if the tile map looks right, reload the tile map in Terry after you have exported it.&lt;br /&gt;
&lt;br /&gt;
===EXPORTING THE TILE===&lt;br /&gt;
Always export the tile AFTER exporting the tile map. Do this by using file &amp;gt; process with BOB. If you make changes to your tile, you only need to re-export the tile, not the tile map. As stated before, you never need to do “tools &amp;gt; create battle for tile…” more than once.&lt;br /&gt;
&lt;br /&gt;
Before you export, also ensure that legacy vegetation generation is turned off the in the map properties (bottom right)&lt;br /&gt;
&lt;br /&gt;
===COMPILING THE MAP IN RPFM===&lt;br /&gt;
Total war uses pack files to load mods into the user’s game. To make your pack file, you could use CA’s pack file manager, but most people think that the community-made [https://github.com/Frodo45127/rpfm/releases RPFM] is superior for this process. This tutorial will exclusively use RPFM.&lt;br /&gt;
&lt;br /&gt;
As an example for how this is set up, please download [https://steamcommunity.com/sharedfiles/filedetails/?id=2861441854 my map pack] and go to steamapps &amp;gt; workshop &amp;gt; content and then find the folder for WH3, then find my mod in that folder. There, you will find my mod’s pack file, which you can open in RPFM to see how to set this up.&lt;br /&gt;
&lt;br /&gt;
I will not describe in detail exactly how to use RPFM to do everything here, but I invite you to go to the modder’s den discord to ask questions about how the program works. Here is generally how a compiled map pack (with multiple maps) will look:&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_9.png|thumb|link=Special:FilePath/dmmg_9.png]]&lt;br /&gt;
&lt;br /&gt;
There are 4 main components:&lt;br /&gt;
1.	First add the map files by adding the entire working_data &amp;gt; terrain folder. Then delete the files for the assembly kit example map.&lt;br /&gt;
2.	Add a text db then add a line with “battles_localised_name_[map key]” followed by the display name. Tooltip is good.&lt;br /&gt;
3.	Add the folders for battle map images and add all of the in-game images that will display in the map selection screen. These images should be 3 times as wide as they are tall.&lt;br /&gt;
4.	Add a db with the battles_tables table. Most of it should be easy enough. For specification, use “copy path” to get the terrain &amp;gt; battles &amp;gt; yourmap folder for your map. You do need the extra slash at the end. Get the path for the environment file from the game files in the bottom left; it’s in the weathers folder.&lt;br /&gt;
&lt;br /&gt;
Finally, save your pack in WH3’s data folder located in the game’s base directory. Make a cover image to display in the workshop; it should be square, compressed, and should have the same name as the pack file.&lt;br /&gt;
&lt;br /&gt;
To assist in testing, you can use [https://steamcommunity.com/sharedfiles/filedetails/?id=2860443397 this] mod made by Klissan, which will allow you to load into domination maps without another player.&lt;br /&gt;
&lt;br /&gt;
GOOD LUCK, YOU’RE GONNA NEED IT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WH3 Map Making Beautification Guide==&lt;br /&gt;
[https://docs.google.com/presentation/d/1f8SPKHqGtLz5jOZo-qoJshu_SP8gJ242UdOjbJBHrus/edit#slide=id.g1af5a2e59f5_0_50 powerpoint on beutification]&lt;br /&gt;
&lt;br /&gt;
==WH3 Battle Map Capture Points Guide==&lt;br /&gt;
&lt;br /&gt;
===INTRO===&lt;br /&gt;
With the latest release of the Total Tavern map pack (Nov 2, 2022), we now have a rudimentary ability to add additional capturable objectives to domination maps other than the 3 main objectives. In particular, we are able to add points that give supplies as well as generic points that can be used for as a logical link to other capturable objectives.&lt;br /&gt;
&lt;br /&gt;
Assuming you already know how to make capture points, let’s look at all of the different parameters in a capture point:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_1.png|thumb|link=Special:FilePath/CP_1.png]]&lt;br /&gt;
&lt;br /&gt;
The most important parameters are the type and the importance. The type controls the symbol given to the capture point on the UI as well as the tooltip that appears when you mouse over it. The importance controls how many tickets the capture points gives, what currencies the points gives, and the time it takes to capture it.&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the importance of the capture point is its chief parameter. Unfortunately, due to database limitations, we cannot add new levels of importance for capture points, but we can add new capture point types. Therefore, when thinking about how to add different types of capture points, we can only work with 4 different levels of importance: Key Building A, Key Building, B, Major and Minor (these 4 were otherwise unused in domination).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===HOW TO ADD SUPPLY POINTS===&lt;br /&gt;
The biggest functionality that this map pack update provides is the ability to create points that generate supplies. This functionality is mainly controlled by the db/battle_secondary_currency_sources_links_tables (see pic below).&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_2.png|thumb|link=Special:FilePath/CP_2.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, each entry defines how a certain number of supplies are doled out as long as the “source type” condition is met. For example, for line 3, the game will give 3 supplies/second to a player as long as they control a major victory point, regardless of how many major victory points they control. Because of that, if you wanted to make two capture points in a map that each gave 1 supply/second, you would have to have them on two separate importance levels.&lt;br /&gt;
&lt;br /&gt;
As a result, this is how the importance levels shook out when I designed this mod:&lt;br /&gt;
●	Score - This was not changed at all since this is reserved for the domination points themselves&lt;br /&gt;
●	Minor - This will give neither supplies nor tickets. It is intended to be a point type used for side objectives like capturable towers or reinforcement points&lt;br /&gt;
●	Key Building A and B - I wanted the ability to make maps with two points that each give 1 supply/second, so both of these are reserved for that purpose&lt;br /&gt;
●	Major - Gives 3 supplies/second&lt;br /&gt;
&lt;br /&gt;
To communicate this to the player, I created 3 new capture point types. The picture below shows the .loc that generates the tooltips so you can see what they say:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_3.png|thumb|link=Special:FilePath/CP_3.png]]&lt;br /&gt;
&lt;br /&gt;
Therefore, there are a limited number of available configurations for supply points, and certain point types should only be used with certain point importances. To sum up, these are the only available configurations of supply points you can use on your maps:&lt;br /&gt;
&lt;br /&gt;
Option A:&lt;br /&gt;
1.	Supply point 1 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply Point 2 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building B (generates 1 sup/sec)&lt;br /&gt;
Option B:&lt;br /&gt;
1.	Supply Point 1 of 1&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
Option C:&lt;br /&gt;
1.	Supply point 1 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply Point 2 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
Option D:&lt;br /&gt;
1.	Supply point 1 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply point 2 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building B (generates 1 sup/sec)&lt;br /&gt;
3.	Supply Point 3 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===HOW TO ADD REINFORCEMENT CAPTURE POINTS===&lt;br /&gt;
Tower capture points are fairly self-explanatory in the sense that you can just add the required tower prefab and then link it to the CA-provided tower_only capture point zone. However, reinforcement zone capture points didn’t seem to be something that CA planned for, so it required the addition of another capture point zone type to communicate this functionality to the player.&lt;br /&gt;
&lt;br /&gt;
To be clear, when I’m talking about reinforcement zone capture points, I’m talking about stuff like my map, Crater of Decay, where you have an additional objective that, when captured, unlocks neutral zones where you can spawn units from.&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_4.png|thumb|link=Special:FilePath/CP_4.png]]&lt;br /&gt;
&lt;br /&gt;
Minor importance was reserved for this purpose since it will not give any supplies. As a result, all reinforcement zone capture points should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_5.png|thumb|link=Special:FilePath/CP_5.png]]&lt;br /&gt;
&lt;br /&gt;
Of course, reinforcement capture points also require the extra step of linking them to the points they give control over. To do this, simply go to the entity properties of those reinforcement points, and select the tt_dom_reinf_zone_point from the capture location drop-down menu. See example below for a capturable vanguard point.&lt;br /&gt;
&lt;br /&gt;
[[File:CP_6.png|thumb|link=Special:FilePath/CP_6.png]]&lt;br /&gt;
&lt;br /&gt;
One important thing to note is that despite the fact that the reinforcement spawn points are now capturable, they aren’t “neutral” in the sense that they are still linked to attacker and defender. For example, if the attacker captures the tt_dom_reinf_zone_point, they will not gain control of this defender teleport reinforcement line. Only the defender can do that and vice versa.&lt;br /&gt;
&lt;br /&gt;
===REQUIRED FILES AND HOW TO TEST===&lt;br /&gt;
Since modifications were made to the game to make all this stuff work, you will need to put these changes into your mod to do any testing. To facilitate this, I have created two pack files:&lt;br /&gt;
[https://drive.google.com/file/d/1hA_psc5m5fAEYKqzyaQPyuhui8POl71O/view?usp=share_link link]&lt;br /&gt;
[https://drive.google.com/file/d/1MFGgsxw9rFP2bVBWEjkbIOS4d78l0NVt/view?usp=share_link link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first link is a pack file that you should put in your game’s data folder. All this does is it adds the new capture point types as table entries so that you can select them when making maps.&lt;br /&gt;
&lt;br /&gt;
The second pack file is something that you should merge into your map mod’s pack file to get all of the other database changes that affect gameplay. To do this, right click the root of your pack file in RPFM and go to add &amp;gt; from pack file. Then navigate to the file from the second download link that says “merge me”.&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_7.png|thumb|link=Special:FilePath/CP_7.png]]&lt;br /&gt;
&lt;br /&gt;
After that, just double click the root of the other pack file, and it will bring everything in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How to Make Land Battle versions of Domination maps==&lt;br /&gt;
This will use the catchment system so that you don’t have to make multiple copies of the same map.&lt;br /&gt;
&lt;br /&gt;
First, put everything related specifically to the domination game mode into a file layer or logical layer. The difference between the two is that file layer saves the selection to a different layer file whereas logical layer will save it as a selection within the same layer file. Either will work.&lt;br /&gt;
&lt;br /&gt;
Next, change the BMD export type of the layer to catchment_01 (or whichever you want to use).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[File:lb_to_d_1.png|thumb|link=Special:FilePath/Lb_to_d_1.png]]&lt;br /&gt;
&lt;br /&gt;
Then export the tile and add it to your pack file as you normally would; exporting the tile map is not required if you have already done so before.&lt;br /&gt;
&lt;br /&gt;
In battles_tables in RPFM, you will have to make two separate rows for your map. I have copied the relevant columns from the two entries in my pack so you can see how it should be.&lt;br /&gt;
&lt;br /&gt;
KEY                            de_labor_camp_dom                                             de_labor_camp_lb&lt;br /&gt;
TYPE                               domination                                                      classic&lt;br /&gt;
SPECIFICATION      terrain/battles/test_domination_de_labor_camp/              terrain/battles/test_domination_de_labor_camp/		&lt;br /&gt;
SCREENSHOT PATH   ui/frontend ui/battle_map_images/bleakspire_wide.png       ui/frontend ui/battle_map_images/bleakspire_wide.png	&lt;br /&gt;
CATCHMENT NAME                     catchment_01&lt;br /&gt;
 &lt;br /&gt;
So basically, everything stays the same except you change the battle type, append something to the key to make it easy to recognize which is which (I chose “_dom” and “_lb”), and then load the appropriate catchment layer for dom.&lt;br /&gt;
&lt;br /&gt;
Once you’ve done that, you also need to update the text loc file which generates the display names since there are now two different keys.&lt;br /&gt;
&lt;br /&gt;
In this case, all I did was isolate the domination-specific features. However, this system is quite flexible. For example, you could have different initial deployment zones and white lines on the domination version of the map than the land battle version by having one set be on catchment_01 and the other on catchment_02.&lt;br /&gt;
&lt;br /&gt;
[[Category:Warhammer 3]]&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Map_Making_for_WH3&amp;diff=569</id>
		<title>Tutorial:Map Making for WH3</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Map_Making_for_WH3&amp;diff=569"/>
		<updated>2023-02-24T01:19:20Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: Created page with &amp;quot;=====Originally written by WakaWaka300 and posted by All is Dust=====  ===Map Making in WH3 ==== CA said that and I quote &amp;quot;Terry is going to feel quite different. It's the ful...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=====Originally written by WakaWaka300 and posted by All is Dust=====&lt;br /&gt;
&lt;br /&gt;
===Map Making in WH3 ====&lt;br /&gt;
CA said that and I quote &amp;quot;Terry is going to feel quite different. It's the full-fat version of the tools that we use in house. This should give you more power, but will also be more complicated with initial set ups.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So thankfully WakaWaka300 gave us some tutorials. You can fidn the original tutorials and extra files like examples and templates [https://drive.google.com/drive/folders/1HfSee67Xq9VG67O39v7vt2fE7CgwNfDD HERE].&lt;br /&gt;
&lt;br /&gt;
The tutorials in question are:&lt;br /&gt;
&lt;br /&gt;
==WH3 Map Optimisation Guide==&lt;br /&gt;
&lt;br /&gt;
===File Size Optimization===&lt;br /&gt;
As we continue to make more and more maps, I think one thing that will be critically important going forward is to manage file size. Looking at the file sizes of the working_data files that are generated by Terry, it quickly becomes apparent that the largest contributor to map file size is various procedural generation data. This consists of the trees, grass, pebbles, etc that are generated depending on the texture channel being used in a particular area. See below for an example of the file sizes present in my map “Road to Vaul’s Anvil”; files related to procedurally generated objects are highlighted.&lt;br /&gt;
&lt;br /&gt;
[[File:file5.png|thumb|link=Special:FilePath/File5.png]]&lt;br /&gt;
 &lt;br /&gt;
One thing that jumps out is that grass in particular takes up a lot of space because each grass blade’s position, rotation, etc are stored individually instead of being generated at the start of each battle. At the same time, I noticed that CA omits grass generation outside of the playable area in many of their maps (see Arnheim below as an example where the grass stops generating shortly beyond the white line)&lt;br /&gt;
 &lt;br /&gt;
[[File:battle4.png|thumb|link=Special:FilePath/Battle4.png]]&lt;br /&gt;
&lt;br /&gt;
From what I can tell, there is also an automatic system that deletes any small procedural objects, such as grass, from tiles in the outfield (outside the playable tile). However, for the space in between the playable area (white lines), and the outfield tiles, the grass here has to be removed manually. Don’t worry though, the process really isn’t that hard!&lt;br /&gt;
&lt;br /&gt;
To illustrate this process, I have made an example map:&lt;br /&gt;
&lt;br /&gt;
[[File:green3.png|thumb|link=Special:FilePath/Green3.png]]&lt;br /&gt;
&lt;br /&gt;
First, CA already has a pretty nifty tool for deleting any procedural objects in the form of procedural exclusion zones. These can be accessed via “entity creation &amp;gt; visual”. So just put them in such a way as to cover the whole tile area between the white lines and tile edge. It’s ok if you have multiple zones overlap. So here is an example of that:&lt;br /&gt;
 &lt;br /&gt;
[[File:green2.png|thumb|link=Special:FilePath/Green2.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, while it has done a good job of deleting all the extra grass, it has also deleted the trees in the various forests outside the playable area. Those are procedural trees after all! In order to fix this, we need to recreate those forests using the vegetation paint tool rather than allowing them to be procedurally generated using the forest terrain type.&lt;br /&gt;
&lt;br /&gt;
To assist with this, it may be easier to temporarily change the forest01 texture channel to something like white or snow to make it easier to see. But that’s up to you obviously. Next, you have to set up a list of trees to make the painted forest blend in with the normal one. You will probably have to fool around with this for while to make it look right.&lt;br /&gt;
See below for example of painted trees.&lt;br /&gt;
 &lt;br /&gt;
[[File:green1.png|thumb|link=Special:FilePath/Green1.png]]&lt;br /&gt;
&lt;br /&gt;
Afterwards, I simply change the texture type back to forest01 to get the trees in the middle back.&lt;br /&gt;
&lt;br /&gt;
[[File:green.png|thumb|link=Special:FilePath/Green.png]]&lt;br /&gt;
 &lt;br /&gt;
===FPS Optimization===&lt;br /&gt;
So I suppose there isn’t really much to say here. CA’s engine can indeed handle a lot of objects at once, so you don’t really have to worry about that. What will really bog the game down is putting in lots of VFX, especially transparency effects. Why does this cause issues? Because of overdraw.&lt;br /&gt;
 &lt;br /&gt;
[[File:Optimization.png|thumb|link=Special:FilePath/Optimization.png]]&lt;br /&gt;
&lt;br /&gt;
Overdraw (visualised here in red) is when the game engine gets bogged by essentially redrawing the same pixel multiple times due to transparency overlap. As a result, you can definitely use fog effects if you want to, but don’t spam them close together, and try not to scale them up in such a way that you could see one through another&lt;br /&gt;
&lt;br /&gt;
In case you’re wondering, this is (probably) why the cathay maps perform so badly in the base game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WH3 Domination Map Making Guide==&lt;br /&gt;
&lt;br /&gt;
===INITIAL FILE SETUP===&lt;br /&gt;
When you first open Terry, you will be greeted by the following screen:&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_1.png|thumb|link=Special:FilePath/dmmg_1.png]]&lt;br /&gt;
&lt;br /&gt;
Lets get some terminology straight first:&lt;br /&gt;
1.	A “tile” is a section of terrain (of any size) that can be loaded as the playable map or as part of the outfield or vista&lt;br /&gt;
2.	A “tile map” is the outfield (background outside the playable area) that gets loaded in game whenever you boot up a map. As the name implies, a tile map is an arrangement of multiple tiles.&lt;br /&gt;
3.	A “prefab” is a collection of objects that can be loaded in and selected as one entity. It’s useful for making maps quickly as you will likely find with the CA-made prefabs. This guide will not touch on prefabs&lt;br /&gt;
&lt;br /&gt;
As of the initial writing of this guide, we don’t have any tile maps made by the community (or by CA) for use in WH3, but we do have all the WH2 tile maps (and most of them seem to work!). As such, I have uploaded them here for use in your maps.&lt;br /&gt;
&lt;br /&gt;
For the best compatibility with the existing WH2 tile maps, you should use 8x8 as your tile size. This “size” refers to the grid size of the green squares when you load up your tile.&lt;br /&gt;
&lt;br /&gt;
For climate, this controls the texture set used for your tile, and it should be pretty self-explanatory. This does not control the environment (lighting and atmospherics)&lt;br /&gt;
&lt;br /&gt;
The first time, save your map using “save as…”, which will pull up a dialog asking you to save a tile set and name. The name is not the display name for the map, and for the tile set you use, please save it as domination. Be sure to leave the box checked at the bottom.&lt;br /&gt;
 &lt;br /&gt;
[[File:dmmg_2.png|thumb|link=Special:FilePath/dmmg_2.png]]&lt;br /&gt;
&lt;br /&gt;
If you are importing a WH2 map, you need to change “ProjectTilewithVista” in the .terry file to “ProjectTile” by opening the file with notepad and changing it manually. In addition, when you load the map in, you will likely be greeted by a red hellscape. To get rid of this, you have to load a new environment file in “settings” at the bottom right.&lt;br /&gt;
&lt;br /&gt;
Whenever you reload a map, you may often be greeted by overly dark shadows. To fix this, regenerate light probes in settings (shown below).&lt;br /&gt;
&lt;br /&gt;
Insert the provided terry_buildings file into WH3’s data directory to add additional buildings into terry for your use.&lt;br /&gt;
&lt;br /&gt;
Finally, you should refrain from putting anything in your map below y=0 due to a water heights issue. If you do have stuff below y=0, then you will have to raise the tile map until no terrain is below y=0 in order to prevent floating unit icons.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_3.png|thumb|link=Special:FilePath/dmmg_3.png]]&lt;br /&gt;
&lt;br /&gt;
===SETTING UP INITIAL DEPLOYMENT&lt;br /&gt;
So we’ve skipped ahead a little since the act of texturing, placing objects, adjusting the height map, etc hasn’t changed much from previous iterations of terry and is very intuitive. This section will basically cover how to set up deployment zones. However, as best practice, you should also set up no-go zones around any impassable terrain and check the size of your map as you make it with the prop “ref_group_human”.&lt;br /&gt;
&lt;br /&gt;
For deployment zones, go to tools &amp;gt; entity creation (logical), and create one on each side. Next, go to the object tree on the left and click on each zone. In each, you will find an additive deployment zone region. This is the zone players will deploy in to start the game. Next change one of the zones to alliance ID 1 and it will turn red. Remember that blue is attackers and red is defenders (very intuitive, I know).&lt;br /&gt;
&lt;br /&gt;
With your initial deployment zones made, create another deployment zone region with tools &amp;gt; entity creation (logical). The option is only accessible if you have selected the corresponding deployment zone you want it to be associated with. This deployment zone region will be for vanguard deployment and will use the zone type “guerilla exclusion additive”.&lt;br /&gt;
&lt;br /&gt;
Basically, the way guerilla exclusion additive zones work in Terry is that it prevents the opposite alliance from deploying in that zone. In other words, the opposite team can vanguard deploy everywhere except for the enemy alliance’s guerilla exclusion zone. See below for an example of how my zones are set up. I have drawn over the zones to make them easier to see.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_4.png|thumb|link=Special:FilePath/dmmg_4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_5.png|thumb|link=Special:FilePath/dmmg_5.png]]&lt;br /&gt;
 &lt;br /&gt;
As you can see, there will be some overlap between guerilla exclusion zones in the middle. As a final note, you must ensure that players cannot vanguard deploy onto the domination points since that would allow them to capture them before the match starts.&lt;br /&gt;
&lt;br /&gt;
Finally, you can make a playable area using tools &amp;gt; entity creation (logical). This defines what space in the tile that players can actually move around in (aka, the “white lines”). I think it should be between 2x2 and 3x3 or so, but it’s highly variable depending on how big or what shape you want the map to be. &lt;br /&gt;
&lt;br /&gt;
===SECTION 3: SETTING UP DOMINATION CAPTURE POINTS===&lt;br /&gt;
To make capture points, go to tools &amp;gt; entity creation (logical) and create a capture point. You can make the point any shape, but I will use the rectangular shape as a reference. For type, use domination 1, 2, or 3 depending on which point you are making. For importance, you must use “score”. For size, I think anywhere between 80x80 to 180x180 can work depending on the map. See below for reference.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_5_1.png|thumb|link=Special:FilePath/dmmg_5_1.png]]&lt;br /&gt;
&lt;br /&gt;
===SETTING UP TELEPORT POINTS===&lt;br /&gt;
To make the points used to spawn units in, go to tools &amp;gt; entity creation (logical), and create an ai hint. Use the type “attacker (or defender) teleport reinforcement line” and create a single, short line with two points. Remember, attacker is the blue side and defender is the red side.&lt;br /&gt;
&lt;br /&gt;
The vanguard deployment lines are exactly the same, but make sure to check the box for vanguard deployment in the entity properties. See below as an example for one of the vanguard points.&lt;br /&gt;
&lt;br /&gt;
If you have issues with the teleport point not appearing in game, it is likely due to the line being too short. If it’s about 20 units long, that’s enough.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_6.png|thumb|link=Special:FilePath/dmmg_6.png]]&lt;br /&gt;
 &lt;br /&gt;
===SETTING UP THE TILE MAP===&lt;br /&gt;
At this point, you have to understand two different file locations where map files are stored. In your assembly kit folder (located within WH3 wherever you have that stored), you will find two folders, raw_data and working_data. Raw data is the files that the modding tools will work with to make maps, while working data is the stuff that the mod tools export which you will need to compile to make the final map file. Everything we need will be located within the terrain folders of each.&lt;br /&gt;
&lt;br /&gt;
When you are more-or-less done with the map, go to “tools &amp;gt; create battle for tile…”. This will create a tile map file associated with this map in raw_data&amp;gt;terrain&amp;gt;battles&amp;gt;yourmap. You will only need to do this once. This has generated a tile map for your tile, but we need to change it because the climate isn’t set up and there’s no outfield.&lt;br /&gt;
&lt;br /&gt;
This is where you either create your own tile map or use one of the WH2 ones (I would suggest the latter for now). Use the vistas I have provided with this guide to pull the tile_map.png and climate_map.png files from whatever vista you want into the tile map folder that was generated. The tile map tells the game which tiles from the tile db to generate in the outfield, and the climate map tells the game which textures to use. Climate map colors are located in the settings file of terrain&amp;gt;tiles&amp;gt;battle&amp;gt;_tile_database. Tile map colors and sizes are located in the tile database found in terry. See below for an example of the files needed in the tile map folder. The extra terry user file is only generated when you open the tile map in Terry.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_7.png|thumb|link=Special:FilePath/dmmg_7.png]]&lt;br /&gt;
&lt;br /&gt;
Next, you need to modify the explicit_tiles file to tell the game where the playable tile is located within the tile map. By default, it will probably be something like this:&lt;br /&gt;
&lt;br /&gt;
3,3,terrain/tiles/battle/lzd_hills_infield/chaqua_pit,0&lt;br /&gt;
&lt;br /&gt;
If you are using an 8x8 tile and one of the WH2 tile maps, your map will line up with the 8x8 black square in the middle. Open the tile map in a program like [https://www.gimp.org/ GIMP] to view the coordinates of the upper left corner of the black square. Change the first two numbers of the explicit_tiles file to these coordinates. See below for an example of the 28,28 coordinates for a 64x64 tile map.&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_8.png|thumb|link=Special:FilePath/dmmg_8.png]]&lt;br /&gt;
 &lt;br /&gt;
Once you’re done with this open up the .terry file (the tile map) in Terry itself. This will initially load a tile map that is too small and isn’t using the right climate, but don’t panic! Changes to the tile map file will only show up in the editor once you have exported it, so do that now using file &amp;gt; process with BOB. To see if the tile map looks right, reload the tile map in Terry after you have exported it.&lt;br /&gt;
&lt;br /&gt;
===EXPORTING THE TILE===&lt;br /&gt;
Always export the tile AFTER exporting the tile map. Do this by using file &amp;gt; process with BOB. If you make changes to your tile, you only need to re-export the tile, not the tile map. As stated before, you never need to do “tools &amp;gt; create battle for tile…” more than once.&lt;br /&gt;
&lt;br /&gt;
Before you export, also ensure that legacy vegetation generation is turned off the in the map properties (bottom right)&lt;br /&gt;
&lt;br /&gt;
===COMPILING THE MAP IN RPFM===&lt;br /&gt;
Total war uses pack files to load mods into the user’s game. To make your pack file, you could use CA’s pack file manager, but most people think that the community-made [https://github.com/Frodo45127/rpfm/releases RPFM] is superior for this process. This tutorial will exclusively use RPFM.&lt;br /&gt;
&lt;br /&gt;
As an example for how this is set up, please download [https://steamcommunity.com/sharedfiles/filedetails/?id=2861441854 my map pack] and go to steamapps &amp;gt; workshop &amp;gt; content and then find the folder for WH3, then find my mod in that folder. There, you will find my mod’s pack file, which you can open in RPFM to see how to set this up.&lt;br /&gt;
&lt;br /&gt;
I will not describe in detail exactly how to use RPFM to do everything here, but I invite you to go to the modder’s den discord to ask questions about how the program works. Here is generally how a compiled map pack (with multiple maps) will look:&lt;br /&gt;
&lt;br /&gt;
[[File:dmmg_9.png|thumb|link=Special:FilePath/dmmg_9.png]]&lt;br /&gt;
&lt;br /&gt;
There are 4 main components:&lt;br /&gt;
1.	First add the map files by adding the entire working_data &amp;gt; terrain folder. Then delete the files for the assembly kit example map.&lt;br /&gt;
2.	Add a text db then add a line with “battles_localised_name_[map key]” followed by the display name. Tooltip is good.&lt;br /&gt;
3.	Add the folders for battle map images and add all of the in-game images that will display in the map selection screen. These images should be 3 times as wide as they are tall.&lt;br /&gt;
4.	Add a db with the battles_tables table. Most of it should be easy enough. For specification, use “copy path” to get the terrain &amp;gt; battles &amp;gt; yourmap folder for your map. You do need the extra slash at the end. Get the path for the environment file from the game files in the bottom left; it’s in the weathers folder.&lt;br /&gt;
&lt;br /&gt;
Finally, save your pack in WH3’s data folder located in the game’s base directory. Make a cover image to display in the workshop; it should be square, compressed, and should have the same name as the pack file.&lt;br /&gt;
&lt;br /&gt;
To assist in testing, you can use [https://steamcommunity.com/sharedfiles/filedetails/?id=2860443397 this] mod made by Klissan, which will allow you to load into domination maps without another player.&lt;br /&gt;
&lt;br /&gt;
GOOD LUCK, YOU’RE GONNA NEED IT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WH3 Map Making Beautification Guide==&lt;br /&gt;
[https://docs.google.com/presentation/d/1f8SPKHqGtLz5jOZo-qoJshu_SP8gJ242UdOjbJBHrus/edit#slide=id.g1af5a2e59f5_0_50 powerpoint on beutification]&lt;br /&gt;
&lt;br /&gt;
==WH3 Battle Map Capture Points Guide==&lt;br /&gt;
&lt;br /&gt;
===INTRO===&lt;br /&gt;
With the latest release of the Total Tavern map pack (Nov 2, 2022), we now have a rudimentary ability to add additional capturable objectives to domination maps other than the 3 main objectives. In particular, we are able to add points that give supplies as well as generic points that can be used for as a logical link to other capturable objectives.&lt;br /&gt;
&lt;br /&gt;
Assuming you already know how to make capture points, let’s look at all of the different parameters in a capture point:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_1.png|thumb|link=Special:FilePath/CP_1.png]]&lt;br /&gt;
&lt;br /&gt;
The most important parameters are the type and the importance. The type controls the symbol given to the capture point on the UI as well as the tooltip that appears when you mouse over it. The importance controls how many tickets the capture points gives, what currencies the points gives, and the time it takes to capture it.&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the importance of the capture point is its chief parameter. Unfortunately, due to database limitations, we cannot add new levels of importance for capture points, but we can add new capture point types. Therefore, when thinking about how to add different types of capture points, we can only work with 4 different levels of importance: Key Building A, Key Building, B, Major and Minor (these 4 were otherwise unused in domination).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===HOW TO ADD SUPPLY POINTS===&lt;br /&gt;
The biggest functionality that this map pack update provides is the ability to create points that generate supplies. This functionality is mainly controlled by the db/battle_secondary_currency_sources_links_tables (see pic below).&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_2.png|thumb|link=Special:FilePath/CP_2.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, each entry defines how a certain number of supplies are doled out as long as the “source type” condition is met. For example, for line 3, the game will give 3 supplies/second to a player as long as they control a major victory point, regardless of how many major victory points they control. Because of that, if you wanted to make two capture points in a map that each gave 1 supply/second, you would have to have them on two separate importance levels.&lt;br /&gt;
&lt;br /&gt;
As a result, this is how the importance levels shook out when I designed this mod:&lt;br /&gt;
●	Score - This was not changed at all since this is reserved for the domination points themselves&lt;br /&gt;
●	Minor - This will give neither supplies nor tickets. It is intended to be a point type used for side objectives like capturable towers or reinforcement points&lt;br /&gt;
●	Key Building A and B - I wanted the ability to make maps with two points that each give 1 supply/second, so both of these are reserved for that purpose&lt;br /&gt;
●	Major - Gives 3 supplies/second&lt;br /&gt;
&lt;br /&gt;
To communicate this to the player, I created 3 new capture point types. The picture below shows the .loc that generates the tooltips so you can see what they say:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_3.png|thumb|link=Special:FilePath/CP_3.png]]&lt;br /&gt;
&lt;br /&gt;
Therefore, there are a limited number of available configurations for supply points, and certain point types should only be used with certain point importances. To sum up, these are the only available configurations of supply points you can use on your maps:&lt;br /&gt;
&lt;br /&gt;
Option A:&lt;br /&gt;
1.	Supply point 1 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply Point 2 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building B (generates 1 sup/sec)&lt;br /&gt;
Option B:&lt;br /&gt;
1.	Supply Point 1 of 1&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
Option C:&lt;br /&gt;
1.	Supply point 1 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply Point 2 of 2&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
Option D:&lt;br /&gt;
1.	Supply point 1 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building A (generates 1 sup/sec)&lt;br /&gt;
2.	Supply point 2 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_i&lt;br /&gt;
b.	Importance: Key Building B (generates 1 sup/sec)&lt;br /&gt;
3.	Supply Point 3 of 3&lt;br /&gt;
a.	Type: tt_dom_supply_point_ii&lt;br /&gt;
b.	Importance: Major (generates 3 sup/sec)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===HOW TO ADD REINFORCEMENT CAPTURE POINTS===&lt;br /&gt;
Tower capture points are fairly self-explanatory in the sense that you can just add the required tower prefab and then link it to the CA-provided tower_only capture point zone. However, reinforcement zone capture points didn’t seem to be something that CA planned for, so it required the addition of another capture point zone type to communicate this functionality to the player.&lt;br /&gt;
&lt;br /&gt;
To be clear, when I’m talking about reinforcement zone capture points, I’m talking about stuff like my map, Crater of Decay, where you have an additional objective that, when captured, unlocks neutral zones where you can spawn units from.&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_4.png|thumb|link=Special:FilePath/CP_4.png]]&lt;br /&gt;
&lt;br /&gt;
Minor importance was reserved for this purpose since it will not give any supplies. As a result, all reinforcement zone capture points should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:CP_5.png|thumb|link=Special:FilePath/CP_5.png]]&lt;br /&gt;
&lt;br /&gt;
Of course, reinforcement capture points also require the extra step of linking them to the points they give control over. To do this, simply go to the entity properties of those reinforcement points, and select the tt_dom_reinf_zone_point from the capture location drop-down menu. See example below for a capturable vanguard point.&lt;br /&gt;
&lt;br /&gt;
[[File:CP_6.png|thumb|link=Special:FilePath/CP_6.png]]&lt;br /&gt;
&lt;br /&gt;
One important thing to note is that despite the fact that the reinforcement spawn points are now capturable, they aren’t “neutral” in the sense that they are still linked to attacker and defender. For example, if the attacker captures the tt_dom_reinf_zone_point, they will not gain control of this defender teleport reinforcement line. Only the defender can do that and vice versa.&lt;br /&gt;
&lt;br /&gt;
===REQUIRED FILES AND HOW TO TEST===&lt;br /&gt;
Since modifications were made to the game to make all this stuff work, you will need to put these changes into your mod to do any testing. To facilitate this, I have created two pack files:&lt;br /&gt;
[https://drive.google.com/file/d/1hA_psc5m5fAEYKqzyaQPyuhui8POl71O/view?usp=share_link link]&lt;br /&gt;
[https://drive.google.com/file/d/1MFGgsxw9rFP2bVBWEjkbIOS4d78l0NVt/view?usp=share_link link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first link is a pack file that you should put in your game’s data folder. All this does is it adds the new capture point types as table entries so that you can select them when making maps.&lt;br /&gt;
&lt;br /&gt;
The second pack file is something that you should merge into your map mod’s pack file to get all of the other database changes that affect gameplay. To do this, right click the root of your pack file in RPFM and go to add &amp;gt; from pack file. Then navigate to the file from the second download link that says “merge me”.&lt;br /&gt;
 &lt;br /&gt;
[[File:CP_7.png|thumb|link=Special:FilePath/CP_7.png]]&lt;br /&gt;
&lt;br /&gt;
After that, just double click the root of the other pack file, and it will bring everything in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How to Make Land Battle versions of Domination maps==&lt;br /&gt;
This will use the catchment system so that you don’t have to make multiple copies of the same map.&lt;br /&gt;
&lt;br /&gt;
First, put everything related specifically to the domination game mode into a file layer or logical layer. The difference between the two is that file layer saves the selection to a different layer file whereas logical layer will save it as a selection within the same layer file. Either will work.&lt;br /&gt;
&lt;br /&gt;
Next, change the BMD export type of the layer to catchment_01 (or whichever you want to use).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
[[File:lb_to_d_1.png|thumb|link=Special:FilePath/Lb_to_d_1.png]]&lt;br /&gt;
&lt;br /&gt;
Then export the tile and add it to your pack file as you normally would; exporting the tile map is not required if you have already done so before.&lt;br /&gt;
&lt;br /&gt;
In battles_tables in RPFM, you will have to make two separate rows for your map. I have copied the relevant columns from the two entries in my pack so you can see how it should be.&lt;br /&gt;
&lt;br /&gt;
KEY                            de_labor_camp_dom                                             de_labor_camp_lb&lt;br /&gt;
TYPE                               domination                                                      classic&lt;br /&gt;
SPECIFICATION      terrain/battles/test_domination_de_labor_camp/              terrain/battles/test_domination_de_labor_camp/		&lt;br /&gt;
SCREENSHOT PATH   ui/frontend ui/battle_map_images/bleakspire_wide.png       ui/frontend ui/battle_map_images/bleakspire_wide.png	&lt;br /&gt;
CATCHMENT NAME                     catchment_01&lt;br /&gt;
 &lt;br /&gt;
So basically, everything stays the same except you change the battle type, append something to the key to make it easy to recognize which is which (I chose “_dom” and “_lb”), and then load the appropriate catchment layer for dom.&lt;br /&gt;
&lt;br /&gt;
Once you’ve done that, you also need to update the text loc file which generates the display names since there are now two different keys.&lt;br /&gt;
&lt;br /&gt;
In this case, all I did was isolate the domination-specific features. However, this system is quite flexible. For example, you could have different initial deployment zones and white lines on the domination version of the map than the land battle version by having one set be on catchment_01 and the other on catchment_02.&lt;br /&gt;
&lt;br /&gt;
[[Category:Warhammer 3]]&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Green3.png&amp;diff=576</id>
		<title>File:Green3.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Green3.png&amp;diff=576"/>
		<updated>2023-02-24T00:23:10Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Battle4.png&amp;diff=575</id>
		<title>File:Battle4.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Battle4.png&amp;diff=575"/>
		<updated>2023-02-24T00:23:10Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:File5.png&amp;diff=574</id>
		<title>File:File5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:File5.png&amp;diff=574"/>
		<updated>2023-02-24T00:23:09Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Green.png&amp;diff=573</id>
		<title>File:Green.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Green.png&amp;diff=573"/>
		<updated>2023-02-24T00:23:09Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Green1.png&amp;diff=572</id>
		<title>File:Green1.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Green1.png&amp;diff=572"/>
		<updated>2023-02-24T00:23:09Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Green2.png&amp;diff=571</id>
		<title>File:Green2.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Green2.png&amp;diff=571"/>
		<updated>2023-02-24T00:23:08Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Optimization.png&amp;diff=570</id>
		<title>File:Optimization.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Optimization.png&amp;diff=570"/>
		<updated>2023-02-24T00:23:08Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=544</id>
		<title>Example Scripts</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=544"/>
		<updated>2022-09-12T22:07:59Z</updated>

		<summary type="html">&lt;p&gt;Not All is Dust: /* Example Scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A list of example scripts that can easily be copied, edited and then put into a [[Mods|mod]].&lt;br /&gt;
&lt;br /&gt;
== Using Example Scripts ==&lt;br /&gt;
Unless otherwise stated these scripts go into a .pack file at `script/campaign/mod/?.lua`, replace ? with whatever your file name is.&lt;br /&gt;
&lt;br /&gt;
Each script listed is self-contained - so you can use multiple of the example scripts in a single .lua file.&lt;br /&gt;
&lt;br /&gt;
When using the scripts, please keep the credits at the top and don't remove comments. Comments are the text following -- or in a comment block denoted by --[ [ Text here ] ].&lt;br /&gt;
&lt;br /&gt;
Typically an example script will have a list of variables that should be changed to tailor the script to your particular mod, these will often have comments next to them explaining where you will find the keys or values from.&lt;br /&gt;
&lt;br /&gt;
Example in the Replace Starting General example script, you have a line that reads 'local faction_name = &amp;quot;wh_main_emp_empire&amp;quot;;'&lt;br /&gt;
&lt;br /&gt;
This could instead be changed to 'local faction_name = &amp;quot;wh2_dlc11_vmp_the_barrow_legion&amp;quot;;' to affect the Barrow Legion faction instead of The Empire.&lt;br /&gt;
&lt;br /&gt;
If there are out() calls within the example script, you are encouraged to insert a unique text identifier, so you can find your unique output in the [[Lua:Debugging|script logs]] using ctrl+f.&lt;br /&gt;
&lt;br /&gt;
Example in the Replacing Starting General Script, replace REPLAC: with your unique identifier, maybe the starting letters of your discord username, or the mod name or the name of your cat, or something else unique to you.&lt;br /&gt;
&lt;br /&gt;
== Contributing new scripts ==&lt;br /&gt;
If you have some generic scripted functionality you think would be useful for the wider community, please consider adding it to the wiki here, or bring attention to it via Modding Discord in the channel for the wiki.&lt;br /&gt;
&lt;br /&gt;
Add a new Sub-Heading 1 within the Example Scripts section below, give it a meaningful title and a short description. Include what games it is valid for and any specific notes necessary, ie. has to go in this directory, has to be done this way etc.&lt;br /&gt;
&lt;br /&gt;
Avoid using global variables in the example scripts, use local variables and local functions to avoid incidents involving scripts that have overlapping names. Make sure to use comments explaining what the various parts of the script is doing or when referring to specific keys from the database, like where to find them. Context and explanation goes a long way towards helping make sense of the scripts for beginners.&lt;br /&gt;
&lt;br /&gt;
If your script runs through a single init function that's triggered through a first tick callback, give the local function a meaningful name and implement the first-tick-callback, and leave it at that. No need to have the modder replace the local function name in their own replication.&lt;br /&gt;
&lt;br /&gt;
Mind that plopping something in this page leaves it open for collaboration, so someone in the future may come in and add more comments, change anything necessary for an update, make an extra version for another game, or much else. If you're editing the original script, leave the credits the same, or add your name to the credits if you think the addition is meaningful. Don't remove the OG author for sure.&lt;br /&gt;
&lt;br /&gt;
== Example Scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Replacing a Starting General ===&lt;br /&gt;
	&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Replaces the starting general for a specific faction&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function replace_starting_general()&lt;br /&gt;
	if cm:is_new_game() then&lt;br /&gt;
		-- The Empire&lt;br /&gt;
		local faction_name = &amp;quot;wh_main_emp_empire&amp;quot;;		-- Faction key from Factions table&lt;br /&gt;
		local faction = cm:get_faction(faction_name);&lt;br /&gt;
&lt;br /&gt;
		if faction:is_null_interface() == false and faction:is_dead() == false then&lt;br /&gt;
&lt;br /&gt;
			-- Creating replacement for Karl Franz with a regular Empire General&lt;br /&gt;
			local general_details = {&lt;br /&gt;
				general_faction = faction_name,&lt;br /&gt;
				unit_list = &amp;quot;wh_main_emp_cav_reiksguard,wh_main_emp_cav_reiksguard,wh_main_emp_cav_reiksguard&amp;quot;; -- unit keys from main_units table&lt;br /&gt;
				region_key = faction:home_region():name(),&lt;br /&gt;
				type = &amp;quot;general&amp;quot;,																				-- Agent type&lt;br /&gt;
				subtype = &amp;quot;emp_lord&amp;quot;,																			-- Agent subtype&lt;br /&gt;
				forename = &amp;quot;names_name_1904032251&amp;quot;,																-- From local_en names table, Bernhoff the Butcher is now ruler of Reikland&lt;br /&gt;
				clanname = &amp;quot;&amp;quot;,																					-- From local_en names table&lt;br /&gt;
				surname = &amp;quot;names_name_151217003&amp;quot;,																-- From local_en names table&lt;br /&gt;
				othername = &amp;quot;&amp;quot;,																					-- From local_en names table&lt;br /&gt;
				is_faction_leader = true,																		-- Bool for whether the general being replaced is the new faction leader&lt;br /&gt;
				trait = &amp;quot;wh2_dlc09_trait_benevolence&amp;quot;															-- The trait key you want to assign to the new General from character traits table&lt;br /&gt;
			};&lt;br /&gt;
&lt;br /&gt;
			local general_x_pos, general_y_pos = cm:find_valid_spawn_location_for_character_from_settlement(general_details.general_faction, general_details.region_key, false, true, 8);&lt;br /&gt;
			out(faction_name .. &amp;quot; home region name is &amp;quot; .. general_details.region_key);&lt;br /&gt;
&lt;br /&gt;
			cm:create_force_with_general(&lt;br /&gt;
				general_details.general_faction,&lt;br /&gt;
				general_details.unit_list,&lt;br /&gt;
				general_details.region_key,&lt;br /&gt;
				general_x_pos,&lt;br /&gt;
				general_y_pos,&lt;br /&gt;
				general_details.type,&lt;br /&gt;
				general_details.subtype,&lt;br /&gt;
				general_details.forename,&lt;br /&gt;
				general_details.clanname,&lt;br /&gt;
				general_details.surname,&lt;br /&gt;
				general_details.othername,&lt;br /&gt;
				general_details.is_faction_leader,&lt;br /&gt;
&lt;br /&gt;
				-- Generals created this way does not come with a trait normally&lt;br /&gt;
				function(cqi)&lt;br /&gt;
					local char_str = cm:char_lookup_str(cqi);&lt;br /&gt;
&lt;br /&gt;
					-- Adding a new trait to the above general&lt;br /&gt;
					cm:force_add_trait(char_str, general_details.trait, true);&lt;br /&gt;
					out(&amp;quot;Adding Replacement General's trait&amp;quot;);&lt;br /&gt;
				end&lt;br /&gt;
			);&lt;br /&gt;
			out(&amp;quot;Created replacement Lord &amp;quot; .. general_details.forename .. &amp;quot; for &amp;quot; .. faction_name);&lt;br /&gt;
&lt;br /&gt;
			-- Killing Karl Franz permanently&lt;br /&gt;
			local char_list = faction:character_list();&lt;br /&gt;
			local char_subtype = &amp;quot;emp_karl_franz&amp;quot;; -- Karl Franz's agent subtype&lt;br /&gt;
			local char_forename = &amp;quot;names_name_2147343849&amp;quot;; -- Karl Franz's forename&lt;br /&gt;
&lt;br /&gt;
			for i = 0, char_list:num_items() - 1 do&lt;br /&gt;
				local current_char = char_list:item_at(i);&lt;br /&gt;
				local char_str = cm:char_lookup_str(current_char);&lt;br /&gt;
&lt;br /&gt;
				if current_char:is_null_interface() == false and current_char:character_subtype_key() == char_subtype and current_char:get_forename() == char_forename and current_char:has_military_force() == true then&lt;br /&gt;
					cm:set_character_immortality(char_str, false);&lt;br /&gt;
					cm:disable_event_feed_events(true, &amp;quot;wh_event_category_character&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
					cm:kill_character(current_char:command_queue_index(), true, true);&lt;br /&gt;
					cm:callback(function() cm:disable_event_feed_events(false, &amp;quot;wh_event_category_character&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;) end, 0.5);&lt;br /&gt;
					out(&amp;quot;Killing original &amp;quot; .. char_subtype .. &amp;quot; with forename &amp;quot; .. char_forename .. &amp;quot; for &amp;quot; .. faction_name .. &amp;quot; permanently&amp;quot;);&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
		end;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() replace_starting_general() end);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adding RoRs to mercenary pool ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Adds custom Regiments of Reknown to specified factions&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function add_custom_ror()&lt;br /&gt;
&lt;br /&gt;
	-- Checking whether the script has already run for saved games and if it has then the script doesn't need to run again&lt;br /&gt;
	if cm:get_saved_value(&amp;quot;custom_ror_enabled&amp;quot;) == nil then&lt;br /&gt;
&lt;br /&gt;
		-- Table for faction, unit key and parameters for add_unit_to_faction_mercenary_pool&lt;br /&gt;
		local cror_list = {&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_schwartzhafen&amp;quot;, unit = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;, count = 1, rcp = 100, munits = 1, murpt = 0.1, xplevel = 0, frr = &amp;quot;&amp;quot;, srr = &amp;quot;&amp;quot;, trr = &amp;quot;&amp;quot;, replen = true},&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_vampire_counts&amp;quot;, unit = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;, count = 1, rcp = 100, munits = 1, murpt = 0.1, xplevel = 0, frr = &amp;quot;&amp;quot;, srr = &amp;quot;&amp;quot;, trr = &amp;quot;&amp;quot;, replen = true}&lt;br /&gt;
		};&lt;br /&gt;
&lt;br /&gt;
		-- Loop for the table above&lt;br /&gt;
		for i = 1, #cror_list do&lt;br /&gt;
			local faction_name = cror_list[i].faction_key;	-- Faction whose pool the unit(s) should be added to&lt;br /&gt;
			local faction = cm:get_faction(faction_name);	-- FACTION_SCRIPT_INTERFACE&lt;br /&gt;
			local unit_key = cror_list[i].unit;				-- Key of unit to add to the mercenary pool, from the main_units table&lt;br /&gt;
			local unit_count = cror_list[i].count;			-- Number of units to add to the mercenary pool&lt;br /&gt;
			local rcp = cror_list[i].rcp;					-- Replenishment chance, as a percentage&lt;br /&gt;
			local munits = cror_list[i].munits;				-- The maximum number of units of the supplied type that the pool is allowed to contain.&lt;br /&gt;
			local murpt = cror_list[i].murpt;				-- The maximum number of units of the supplied type that may be added by replenishment per-turn&lt;br /&gt;
			local xplevel = cror_list[i].xplevel;			-- The experience level of the units when recruited&lt;br /&gt;
			local frr = cror_list[i].frr;					-- (may be empty) The key of the faction who can actually recruit the units, from the factions database table&lt;br /&gt;
			local srr = cror_list[i].srr;					-- (may be empty) The key of the subculture who can actually recruit the units, from the cultures_subcultures database table&lt;br /&gt;
			local trr = cror_list[i].trr;					-- (may be empty) The key of a technology that must be researched in order to recruit the units, from the technologies database table&lt;br /&gt;
			local replen = cror_list[i].replen;				-- Allow replenishment of partial units&lt;br /&gt;
&lt;br /&gt;
			-- Adding the listed unit to the listed faction in the above table&lt;br /&gt;
			cm:add_unit_to_faction_mercenary_pool(faction, unit_key, unit_count, rcp, munits, murpt, xplevel, frr, srr, trr, replen);&lt;br /&gt;
&lt;br /&gt;
			-- Debug message for log&lt;br /&gt;
			out(&amp;quot;CROR: adding the custom ror unit &amp;quot; .. unit_key .. &amp;quot; to &amp;quot; .. faction_name);&lt;br /&gt;
		end;&lt;br /&gt;
&lt;br /&gt;
		-- Setting saved value, so that the script doesn't run again when reloaded from a saved game&lt;br /&gt;
		cm:set_saved_value(&amp;quot;custom_ror_enabled&amp;quot;, true);&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() add_custom_ror() end);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Replacing Starting Armies ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Replaces the starting units for specified starting Lords&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function army_tweaks()&lt;br /&gt;
&lt;br /&gt;
	-- Checking whether it's a new game, we don't want to replace armies in the middle of a campaign&lt;br /&gt;
	if cm:is_new_game() then&lt;br /&gt;
&lt;br /&gt;
		-- Creating a table with entries for the various starting Lords, their Faction key from Factions table, subtype key from agent_subtypes, Forename from names table and Unit List with keys from Main Units&lt;br /&gt;
		local starting_army = {&lt;br /&gt;
			-- Vlad, Carsteins&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_schwartzhafen&amp;quot;, subtype = &amp;quot;dlc04_vmp_vlad_con_carstein&amp;quot;, forename = &amp;quot;names_name_2147345130&amp;quot;, units = {&amp;quot;wh_main_vmp_inf_skeleton_warriors_0&amp;quot;, &amp;quot;wh_main_vmp_inf_skeleton_warriors_0&amp;quot;, &amp;quot;wh_main_vmp_mon_fell_bats&amp;quot;, &amp;quot;wh_main_vmp_mon_fell_bats&amp;quot;, &amp;quot;wh_main_vmp_cav_black_knights_0&amp;quot;, &amp;quot;wh_main_vmp_cav_black_knights_0&amp;quot;}},&lt;br /&gt;
			-- Isabella, Carsteins&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_schwartzhafen&amp;quot;, subtype = &amp;quot;pro02_vmp_isabella_von_carstein&amp;quot;, forename = &amp;quot;names_name_2147345124&amp;quot;, units = {&amp;quot;wh_main_vmp_inf_zombie&amp;quot;, &amp;quot;wh_main_vmp_inf_zombie&amp;quot;, &amp;quot;wh_main_vmp_mon_dire_wolves&amp;quot;, &amp;quot;wh_main_vmp_mon_dire_wolves&amp;quot;, &amp;quot;wh_main_vmp_mon_fell_bats&amp;quot;, &amp;quot;wh_main_vmp_mon_vargheists&amp;quot;}}&lt;br /&gt;
		};&lt;br /&gt;
&lt;br /&gt;
		for i = 1, #starting_army do&lt;br /&gt;
			local faction_name = starting_army[i].faction_key;&lt;br /&gt;
			local faction = cm:get_faction(faction_name);&lt;br /&gt;
			local char_list = faction:character_list();&lt;br /&gt;
			local general_subtype = starting_army[i].subtype;&lt;br /&gt;
			local general_forename = starting_army[i].forename;&lt;br /&gt;
			local unit_list = starting_army[i].units;&lt;br /&gt;
&lt;br /&gt;
			for j = 0, char_list:num_items() - 1 do&lt;br /&gt;
				local current_char = char_list:item_at(j);&lt;br /&gt;
				local char_str = cm:char_lookup_str(current_char);&lt;br /&gt;
&lt;br /&gt;
				if current_char:is_null_interface() == false and current_char:character_subtype_key() == general_subtype and current_char:get_forename() == general_forename and current_char:has_military_force() == true then&lt;br /&gt;
&lt;br /&gt;
					-- Removing all existing units from the General&lt;br /&gt;
					cm:remove_all_units_from_general(current_char);&lt;br /&gt;
					out(&amp;quot;ARMY: Removing starting units from &amp;quot; .. general_subtype .. &amp;quot; with forename &amp;quot; .. general_forename);&lt;br /&gt;
&lt;br /&gt;
					for k = 1, #unit_list do&lt;br /&gt;
						local unit = unit_list[k];&lt;br /&gt;
&lt;br /&gt;
						-- Granting new units to the General&lt;br /&gt;
						cm:grant_unit_to_character(char_str, unit);&lt;br /&gt;
						out(&amp;quot;ARMY: Adding new starting units to &amp;quot; .. general_subtype .. &amp;quot; with forename &amp;quot; .. general_forename);&lt;br /&gt;
					end;&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
		end;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() army_tweaks() end);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Changing CAI based on campaign difficulty ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Replaces the Campaign AI Personality for specific factions depending on the chosen campaign difficulty level&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function replace_cai_difficulty()&lt;br /&gt;
	if cm:is_new_game() == true then&lt;br /&gt;
		local difficulty_str = cm:get_difficulty(true);&lt;br /&gt;
		local def_personality = &amp;quot;&amp;quot;;&lt;br /&gt;
		local hef_personality = &amp;quot;&amp;quot;;&lt;br /&gt;
		local wef_personality = &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		-- CAI personality to use for easy difficulty&lt;br /&gt;
		if difficulty_str == &amp;quot;easy&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
			def_personality = &amp;quot;wh2_darkelf_early_easy&amp;quot;;&lt;br /&gt;
			hef_personality = &amp;quot;wh2_highelf_early_easy&amp;quot;;&lt;br /&gt;
			wef_personality = &amp;quot;wh_dlc05_wood_elves_default_main&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		-- CAI personality to use for normal difficulty&lt;br /&gt;
		elseif difficulty_str == &amp;quot;normal&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
			def_personality = &amp;quot;wh2_darkelf_early&amp;quot;;&lt;br /&gt;
			hef_personality = &amp;quot;wh2_highelf_early&amp;quot;;&lt;br /&gt;
			wef_personality = &amp;quot;wh_dlc05_wood_elves_default_main&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		-- CAI personality to use for hard difficulty&lt;br /&gt;
		elseif difficulty_str == &amp;quot;hard&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
			def_personality = &amp;quot;wh2_darkelf_early_hard&amp;quot;;&lt;br /&gt;
			hef_personality = &amp;quot;wh2_highelf_early_hard&amp;quot;;&lt;br /&gt;
			wef_personality = &amp;quot;wh_dlc05_wood_elves_default_main&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		-- CAI personality to use for very hard difficulty&lt;br /&gt;
		elseif difficulty_str == &amp;quot;very hard&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
			def_personality = &amp;quot;wh2_darkelf_early_hard&amp;quot;;&lt;br /&gt;
			hef_personality = &amp;quot;wh2_highelf_early_hard&amp;quot;;&lt;br /&gt;
			wef_personality = &amp;quot;wh_dlc05_wood_elves_default_main&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
		-- CAI personality to use for legendary difficulty&lt;br /&gt;
		elseif difficulty_str == &amp;quot;legendary&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
			def_personality = &amp;quot;wh2_darkelf_early_hard&amp;quot;;&lt;br /&gt;
			hef_personality = &amp;quot;wh2_highelf_early_hard&amp;quot;;&lt;br /&gt;
			wef_personality = &amp;quot;wh_dlc05_wood_elves_default_main&amp;quot;;&lt;br /&gt;
		end;&lt;br /&gt;
&lt;br /&gt;
		local faction_list = cm:model():world():faction_list();&lt;br /&gt;
&lt;br /&gt;
		for i = 0, faction_list:num_items() - 1 do&lt;br /&gt;
			local faction = faction_list:item_at(i);&lt;br /&gt;
			local faction_name = faction:name();&lt;br /&gt;
			local faction_culture = faction:culture();&lt;br /&gt;
&lt;br /&gt;
			-- Checking whetether the faction exists and is alive&lt;br /&gt;
			if faction:is_null_interface() == false and faction:is_dead() == false and faction:is_human() == false then&lt;br /&gt;
&lt;br /&gt;
					-- Dark Elves culture&lt;br /&gt;
				if faction_culture == &amp;quot;wh2_main_def_dark_elves&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
					-- Changing the CAI for all Dark Elf factions&lt;br /&gt;
					cm:force_change_cai_faction_personality(faction_name, def_personality);&lt;br /&gt;
					out(&amp;quot;ELF: Changing CAI personality for &amp;quot; .. faction_name .. &amp;quot; to &amp;quot; .. def_personality .. &amp;quot; on &amp;quot; .. difficulty_str .. &amp;quot; difficulty&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
					-- High Elves culture&lt;br /&gt;
				elseif faction_culture == &amp;quot;wh2_main_hef_high_elves&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
					-- Changing the CAI for all High Elf factions&lt;br /&gt;
					cm:force_change_cai_faction_personality(faction_name, hef_personality);&lt;br /&gt;
					out(&amp;quot;ELF: Changing CAI personality for &amp;quot; .. faction_name .. &amp;quot; to &amp;quot; .. hef_personality .. &amp;quot; on &amp;quot; .. difficulty_str .. &amp;quot; difficulty&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
					-- Wood Elves culture&lt;br /&gt;
				elseif faction_culture == &amp;quot;wh_dlc05_wef_wood_elves&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
					-- Changing the CAI for all Wood Elf factions&lt;br /&gt;
					cm:force_change_cai_faction_personality(faction_name, wef_personality);&lt;br /&gt;
					out(&amp;quot;ELF: Changing CAI personality for &amp;quot; .. faction_name .. &amp;quot; to &amp;quot; .. wef_personality .. &amp;quot; on &amp;quot; .. difficulty_str .. &amp;quot; difficulty&amp;quot;);&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
		end;&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() replace_cai_difficulty() end);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spawning a Unique Agent ===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Spawns a Unique Agent next to the starting lord of a specified faction&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function add_unique_agent()&lt;br /&gt;
&lt;br /&gt;
	-- Checking whether the script has already run for saved games and if it has then the script doesn't need to run again&lt;br /&gt;
	if cm:get_saved_value(&amp;quot;unique_agent_enabled&amp;quot;) == nil then&lt;br /&gt;
&lt;br /&gt;
		-- Starting agent setup&lt;br /&gt;
		unique_agent_setup();&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
function unique_agent_setup()&lt;br /&gt;
	-- Agent Details&lt;br /&gt;
	local agent_details = {&lt;br /&gt;
		faction_str = &amp;quot;wh2_dlc13_emp_the_huntmarshals_expedition&amp;quot;,	-- faction_key from factions&lt;br /&gt;
		forename_key = &amp;quot;names_name_2147359013&amp;quot;,						-- forename_key from names&lt;br /&gt;
		family_name_key = &amp;quot;names_name_1535812850&amp;quot;,					-- family_name_key from names&lt;br /&gt;
		subtype_key = &amp;quot;wh2_dlc13_emp_hunter_jorek_grimm&amp;quot;,			-- agent subtype_key from agent_subtypes&lt;br /&gt;
		art_set_key = &amp;quot;wh2_dlc13_art_set_emp_hunter_jorek_grimm_0&amp;quot;,	-- agent art_set_id from campaign_character_arts&lt;br /&gt;
		unique_string = &amp;quot;wh2_dlc13_emp_hunter_jorek_grimm&amp;quot;,			-- unique agent string from unique_agents&lt;br /&gt;
		saved_value = &amp;quot;unique_agent_enabled&amp;quot;,						-- saved_value string&lt;br /&gt;
		trait = &amp;quot;wh2_dlc09_trait_benevolence&amp;quot;						-- agent trait from character_traits&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
	-- Monitor activated, listening for FactionTurnStart for The Huntmarshals Expedition&lt;br /&gt;
	core:add_listener(&lt;br /&gt;
		&amp;quot;unique_agent_setup&amp;quot;,&lt;br /&gt;
		&amp;quot;FactionTurnStart&amp;quot;,&lt;br /&gt;
		function(context)&lt;br /&gt;
			return context:faction():name() == agent_details.faction_str;&lt;br /&gt;
		end,&lt;br /&gt;
		function(context)&lt;br /&gt;
			-- Spawning Jorek as a unique agent next to Markus&lt;br /&gt;
			local faction = cm:get_faction(agent_details.faction_str);&lt;br /&gt;
			local faction_cqi = faction:command_queue_index();&lt;br /&gt;
			local faction_leader_cqi = faction:faction_leader():command_queue_index();&lt;br /&gt;
&lt;br /&gt;
			cm:disable_event_feed_events(true, &amp;quot;wh_event_category_agent&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
			cm:spawn_unique_agent_at_character(&lt;br /&gt;
				faction_cqi,&lt;br /&gt;
				agent_details.unique_string,&lt;br /&gt;
				faction_leader_cqi,&lt;br /&gt;
				true&lt;br /&gt;
			);&lt;br /&gt;
			cm:callback(function()&lt;br /&gt;
				cm:disable_event_feed_events(false, &amp;quot;wh_event_category_agent&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;
				CampaignUI.ClearSelection();&lt;br /&gt;
			end, 0.5);&lt;br /&gt;
			out(&amp;quot;UNIQ: Spawned Jorek next to Markus&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
			-- Looping through the character list for The Huntmarshals Expedition&lt;br /&gt;
			local char_list = faction:character_list();&lt;br /&gt;
&lt;br /&gt;
			for i = 0, char_list:num_items() - 1 do&lt;br /&gt;
				local current_char = char_list:item_at(i);&lt;br /&gt;
				local char_str = cm:char_lookup_str(current_char);&lt;br /&gt;
&lt;br /&gt;
				-- Adding Joreks trait, replenishing AP and overriding the art set&lt;br /&gt;
				if current_char:is_null_interface() == false and current_char:character_subtype_key() == agent_details.subtype_key then&lt;br /&gt;
&lt;br /&gt;
					-- Adding trait&lt;br /&gt;
					cm:force_add_trait(char_str, agent_details.trait, false);&lt;br /&gt;
					out(&amp;quot;UNIQ: Adding &amp;quot; .. agent_details.trait .. &amp;quot; to Jorek&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
					-- Replenishing action points&lt;br /&gt;
					cm:replenish_action_points(char_str);&lt;br /&gt;
					out(&amp;quot;UNIQ: Replenishing the action points of Jorek&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
					-- Failsafe for the random chance that the art_set doesn't apply properly&lt;br /&gt;
					cm:add_unit_model_overrides(char_str, agent_details.art_set_key);&lt;br /&gt;
					out(&amp;quot;UNIQ: Adding unit model override for Jorek&amp;quot;);&lt;br /&gt;
				end;&lt;br /&gt;
			end;&lt;br /&gt;
&lt;br /&gt;
			-- Setting saved value, so that the script doesn't run again when reloaded from a saved game&lt;br /&gt;
			cm:set_saved_value(agent_details.saved_value, true);&lt;br /&gt;
			out(&amp;quot;UNIQ: Setting saved value &amp;quot; .. agent_details.saved_value);&lt;br /&gt;
		end,&lt;br /&gt;
		false&lt;br /&gt;
	);&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() add_unique_agent() end);&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Adding RoRs to mercenary pool, Wh3 version ===&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;--[[&lt;br /&gt;
	Script by Aexrael Dex&lt;br /&gt;
	Adds custom Regiments of Renown to specified factions&lt;br /&gt;
]]&lt;br /&gt;
--Edited to function with total war warhammer 3, by All is Dust&lt;br /&gt;
&lt;br /&gt;
local function add_custom_ror()&lt;br /&gt;
&lt;br /&gt;
	-- Checking whether the script has already run for saved games and if it has then the script doesn't need to run again&lt;br /&gt;
	if cm:get_saved_value(&amp;quot;custom_ror_enabled&amp;quot;) == nil then&lt;br /&gt;
&lt;br /&gt;
		-- Table for faction, unit key and parameters for add_unit_to_faction_mercenary_pool. Every entry must have a &amp;quot;,&amp;quot; at the end except the last&lt;br /&gt;
		local cror_list = {&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_schwartzhafen&amp;quot;, unit = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;, merc_pool = &amp;quot;renown&amp;quot;, count = 1, rcp = 100, munits = 1, murpt = 0.1, xplevel = 0, frr = &amp;quot;&amp;quot;, srr = &amp;quot;&amp;quot;, trr = &amp;quot;&amp;quot;, replen = true, merc_group = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;},&lt;br /&gt;
			{faction_key = &amp;quot;wh_main_vmp_vampire_counts&amp;quot;, unit = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;, merc_pool = &amp;quot;renown&amp;quot;, count = 1, rcp = 100, munits = 1, murpt = 0.1, xplevel = 0, frr = &amp;quot;&amp;quot;, srr = &amp;quot;&amp;quot;, trr = &amp;quot;&amp;quot;, replen = true, merc_group = &amp;quot;wh2_dlc11_cst_inf_zombie_deckhands_mob_ror_0&amp;quot;}&lt;br /&gt;
		};&lt;br /&gt;
&lt;br /&gt;
		-- Loop for the table above&lt;br /&gt;
		for i = 1, #cror_list do&lt;br /&gt;
			local faction_name = cror_list[i].faction_key;	-- Faction whose pool the unit(s) should be added to&lt;br /&gt;
			local faction = cm:get_faction(faction_name);	-- FACTION_SCRIPT_INTERFACE&lt;br /&gt;
			local unit_key = cror_list[i].unit;				-- Key of unit to add to the mercenary pool, from the main_units table&lt;br /&gt;
            local pool = cror_list[i].merc_pool;            --NEW, found in &amp;quot;ui_mercenary_recruitment_infos_tables&amp;quot; table, or in &amp;quot;mercenary_pools_tables&amp;quot; beneath UI recruitment info &lt;br /&gt;
			local unit_count = cror_list[i].count;			-- Number of units to add to the mercenary pool&lt;br /&gt;
			local rcp = cror_list[i].rcp;					-- Replenishment chance, as a percentage&lt;br /&gt;
			local munits = cror_list[i].munits;				-- The maximum number of units of the supplied type that the pool is allowed to contain.&lt;br /&gt;
			local murpt = cror_list[i].murpt;				-- The maximum number of units of the supplied type that may be added by replenishment per-turn&lt;br /&gt;
			local xplevel = cror_list[i].xplevel;			-- The experience level of the units when recruited&lt;br /&gt;
			local frr = cror_list[i].frr;					-- (may be empty) The key of the faction who can actually recruit the units, from the factions database table&lt;br /&gt;
			local srr = cror_list[i].srr;					-- (may be empty) The key of the subculture who can actually recruit the units, from the cultures_subcultures database table&lt;br /&gt;
			local trr = cror_list[i].trr;					-- (may be empty) The key of a technology that must be researched in order to recruit the units, from the technologies database table&lt;br /&gt;
			local replen = cror_list[i].replen;				-- Allow replenishment of partial units&lt;br /&gt;
            local merc_grup_key = cror_list[i].merc_group; 	--NEW, key used in mercenary_unit_groups_tables can most of the time be the same has main_unit key&lt;br /&gt;
&lt;br /&gt;
			-- Adding the listed unit to the listed faction in the above table&lt;br /&gt;
			cm:add_unit_to_faction_mercenary_pool(faction, unit_key, pool, unit_count, rcp, munits, murpt, frr, srr, trr, replen, merc_grup_key);&lt;br /&gt;
&lt;br /&gt;
			-- Debug message for log&lt;br /&gt;
			out(&amp;quot;CROR: adding the custom ror unit &amp;quot; .. unit_key .. &amp;quot; to &amp;quot; .. faction_name);&lt;br /&gt;
		end;&lt;br /&gt;
&lt;br /&gt;
		-- Setting saved value, so that the script doesn't run again when reloaded from a saved game&lt;br /&gt;
		cm:set_saved_value(&amp;quot;custom_ror_enabled&amp;quot;, true);&lt;br /&gt;
	end;&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
cm:add_first_tick_callback(function() add_custom_ror() end);&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Not All is Dust</name></author>
	</entry>
</feed>