<?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=Fenriswolf</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=Fenriswolf"/>
	<link rel="alternate" type="text/html" href="https://tw-modding.com/wiki/Special:Contributions/Fenriswolf"/>
	<updated>2026-05-05T18:31:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Creating_%26_Editing_.Wsmodels&amp;diff=454</id>
		<title>Tutorial:Creating &amp; Editing .Wsmodels</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Creating_%26_Editing_.Wsmodels&amp;diff=454"/>
		<updated>2022-01-22T19:17:20Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: included the missing pictures and introduced blocks for the wsmodels&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Originally by Shawmuscle ===&lt;br /&gt;
This guide aims to show you how to edit and create .wsmodel files, this will enable you to change the color of hexwraiths, chaos weapons and much more. You will be able to edit the effects that are directly associated with the models in warhammer.&lt;br /&gt;
&lt;br /&gt;
== Things you will need ==&lt;br /&gt;
RPFM -(recommended) &amp;lt;nowiki&amp;gt;https://github.com/Frodo45127/rpfm/releases&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unwrap 3D (dont have to have this, just makes life easy) &amp;lt;nowiki&amp;gt;https://www.unwrap3d.com/u3d/index.aspx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://www.gimp.org/downloads/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here we can start to create the .wsmodel files&lt;br /&gt;
&lt;br /&gt;
I will be selecting a model that currently has no .wsmodel as this will enable you deal with all the possibilities, I will also be showing you how to use glows and effects in the material file and how you can have a material file that allows both the deletion of parts from any model (helmets cause some issues) as well as add effects to them. Next section please!&lt;br /&gt;
&lt;br /&gt;
== Get files and create .wsmodel ==&lt;br /&gt;
To start we will be using Karl franz model, why this one? This is a good  model as it presents quite a few challenges that not all models have, which I will show you. Comments&lt;br /&gt;
&lt;br /&gt;
So go ahead and open RPFM.&lt;br /&gt;
&lt;br /&gt;
create a new mod if you dont currently have one. &lt;br /&gt;
or&lt;br /&gt;
you can use mine here – &amp;lt;nowiki&amp;gt;https://drive.google.com/open?id=19d8tciXLkGjzl9k5ig6aepATJrsFEvuq&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
open the “campaign_variants” file&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_0_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
Now open up variants_dds2.pack and extract the “tex” file associated with Karl Franz. like this-&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-1.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
now we have what the vanilla files can offer us.&lt;br /&gt;
&lt;br /&gt;
== The Next Step ==&lt;br /&gt;
Next we are going to go ahead an just make the .wsmodel and later we will edit it and show you why you will want to start using .wsmodel files.&lt;br /&gt;
&lt;br /&gt;
Using RPFM Create a new folder called “materials” Like this-&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-2.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
you now have 2 options,&lt;br /&gt;
&lt;br /&gt;
====== Option 1 (not recommended but worth mentioning) ======&lt;br /&gt;
&lt;br /&gt;
:: Using Rpfm open up variants or campaign variants and find a unit that has some material files, extract them and import into your mod under the tab “materials”&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
====== Option 2 (recommended) ======&lt;br /&gt;
&lt;br /&gt;
:: You can use my material files which do not have limitations as many others in vanilla do – you can find those here-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://drive.google.com/open?id=1tdaFdxaa6OSrAi7Jbk_89ZZnfNowkp-K&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
import those material files into your mod, should look like this –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-3.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
Great! Now we need a .wsmodel file! We will get into the editing of the material files later.&lt;br /&gt;
&lt;br /&gt;
Using RPFM pick a .wsmodel from anyone, you are going to change it so it doesnt matter which. for easy pickings try Green Knight in bret.&lt;br /&gt;
&lt;br /&gt;
Should have a mod that looks something like this –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-4.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
the next step is to open the rigid model v2 file in 3D unwrap but this will allow you to see how many parts there are to a model&lt;br /&gt;
&lt;br /&gt;
like so&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-5.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
as you can see in the right hand side there are 2 parts to this one rigid model file, so we will need to create a .wsmodel file that refers to 2 parts&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;model version=”1″&amp;gt;&lt;br /&gt;
    &amp;lt;geometry&amp;gt;variantmeshes/wh_variantmodels/hu1/emp/emp_karl_franz/theodric_karl_franz.rigid_model_v2&amp;lt;/geometry&amp;gt;&lt;br /&gt;
    &amp;lt;materials&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”0″ part_index=”1″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_head_01_weighted4.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”1″ part_index=”1″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_head_01_weighted4.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”2″ part_index=”1″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_head_01_weighted2.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”3″ part_index=”1″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_head_01_weighted2.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”0″ part_index=”0″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_body_01_weighted4.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”1″ part_index=”0″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_body_01_weighted4.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”2″ part_index=”0″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_body_01_weighted2.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
       &amp;lt;material lod_index=”3″ part_index=”0″&amp;gt;VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/materials/emp_karl_franz_body_01_weighted2.xml.material&amp;lt;/material&amp;gt;&lt;br /&gt;
    &amp;lt;/materials&amp;gt;&lt;br /&gt;
 &amp;lt;/model&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
here you can use mine.&lt;br /&gt;
&lt;br /&gt;
As you can see I have my “lod” indexes 0-3, always do 4 lods and then I have referenced “part index” 0 and 1 the head being part index 1 and the body being part index 0. I know to put 2 parts as we opened the file in Unwrap 3D.&lt;br /&gt;
&lt;br /&gt;
Awesome! now we have a .wsmodel file! But there is still some work to be done in the material files which I will now show you.&lt;br /&gt;
&lt;br /&gt;
== Editing the Material files ==&lt;br /&gt;
Ok for those of you who used Option 1 you will have to spend some time figuring out which material files will work with karl franz, once you have found one, reference karls .dds files in the material file. The important part of the material files to look at are there it says which shader it is.&lt;br /&gt;
I will reference a few and try to give some info on which types do what&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;name&amp;gt;chs_sorcerer_legs_01_weighted4_alpha_on.xml&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;shader&amp;gt;shaders/weighted4_faction_colours_skin_alpha.xml.shader&amp;lt;/shader&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This shader is used for a lot of units, it enables the deletion of parts but does not allow glow effects. Also notice where it says “weighted4” super important for armours/bodies as most of the time the lods will reference a “weighted2” and a “weighted4”, its best to look at vanilla wsmodel to be sure but if you are creating a new file reference both in your .wsmodel.&lt;br /&gt;
&lt;br /&gt;
another type of shader you will find is-&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;name&amp;gt;chs_archaon_head_01_weighted2.xml&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;shader&amp;gt;shaders/weighted2_tinted_metal_emissive_optimized.xml.shader&amp;lt;/shader&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we all know Archaons head is lit up like a Christmas tree, you guessed it…this shader enables glow effects but does not allow the deletion of parts using the alpha channel. Something that sucks about this one is that it doesnt say “alpha on” or “alpha off” but it usually works that if it enables a glow you cannot use it to delete a part and vice versa.&lt;br /&gt;
&lt;br /&gt;
There are hundreds to choose from so have a search and test what they do, change some values try different stuff out. I made my own material files to work for all purposes as I got frustrated with searching through the shaders endlessly.&lt;br /&gt;
&lt;br /&gt;
For those who took my material files you should be looking at something like this –&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_5_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
as you can see I have highlighted the line that is referring to the diffuse file, all you need to do to use the vanilla files is go down the list of .dds files and reference&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; VariantMeshes/wh_variantmodels/hu1/emp/emp_karl_franz/tex/emp_karl_franz_body_01_diffuse.dds &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and do this for gloss map,normal,specular and mask dds files.&lt;br /&gt;
&lt;br /&gt;
but if you are wanting to use your own .dds file you have created reference them here, as I have done in the picture above.&lt;br /&gt;
&lt;br /&gt;
Do this for all the material files. You will find that by using my custom material files the diffuse does not get seen and your colors may look a little off, so simply darken your specular .dds file to achieve the same result. (I will show you later why you will want to be using my material files)&lt;br /&gt;
&lt;br /&gt;
now you have that, all you need to do is reference your material files in your .wsmodel file that you made earlier. Then go to variant mesh definitions\ “emp_ch_karl.variantmeshdefinition” and paste in your new .wsmodel file&lt;br /&gt;
&lt;br /&gt;
like this –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-6.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_6_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
great! If all you wanted to do was create a .wsmodel file and not edit glows or delete parts etc. you are done! Whoooo! good for you guys.&lt;br /&gt;
&lt;br /&gt;
For those interested in the possibilities of a .wsmodel file and why we use them carry on reading ;)&lt;br /&gt;
&lt;br /&gt;
== Creating glows &amp;amp; Removing body parts ==&lt;br /&gt;
Ok so this is why I like using .wsmodels, they enable us to do some really cool things. &lt;br /&gt;
We are going to delete Karl franz head an replace with a different one.&lt;br /&gt;
&lt;br /&gt;
to start I will be showing you something simple and what I imagine most modders know how to do using Rigid model v2 files. Its pretty simple, using my material files that I left a link to earlier, or some people may want to use vanilla files, if you do, pick ones that use '''Alpha_on''' as this is what enables us to delete body parts, if you are using one that says '''Alpha_off''' then you cannot remove body parts. hence why I made a material file that does both.&lt;br /&gt;
&lt;br /&gt;
anyway using my material file, you want to open up karl franz head diffuse file in GIMP looks like this – then go ahead and delete everything in there looks like this –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-7.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-8.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
now save it as whatever your heart desires, ideally not the same as karl_franz vanilla... unless you are editing karl franz to have no head.&lt;br /&gt;
&lt;br /&gt;
import you new diffuse.dds file back into your mod.&lt;br /&gt;
&lt;br /&gt;
Referencing it in the “emp_karl_franz_head_01_weighted2.xml.material” and “emp_karl_franz_head_01_weighted4.xml.material” files like so –&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_7_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
this will now have removed his head. But we are replacing it, so in the variant mesh definition add a head from another unit, here is a character Ive already made as an example.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;VARIANT_MESH&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”tophat” &amp;gt;&lt;br /&gt;
       &amp;lt;VARIANT_MESH model=”VariantMeshes/wh_variantmodels/hu1/tmb/tmb_tomb_guard/head/slv_tomb_guard_head_03.rigid_model_v2″ /&amp;gt;&lt;br /&gt;
    &amp;lt;/SLOT&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”faceness” &amp;gt;&lt;br /&gt;
       &amp;lt;VARIANT_MESH model=”VariantMeshes\wh_variantmodels\hu1\brt\brt_lord\head\ude_lord_head_01.rigid_model_v2″ /&amp;gt;&lt;br /&gt;
    &amp;lt;/SLOT&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”body” &amp;gt;&lt;br /&gt;
       &amp;lt;VARIANT_MESH model=”VariantMeshes\wh_variantmodels\hu1\emp\emp_karl_franz\theodric_body_01.wsmodel” &amp;gt;&lt;br /&gt;
          &amp;lt;META_DATA&amp;gt;audio_entity_type:wh_human_male_LH&amp;lt;/META_DATA&amp;gt;&lt;br /&gt;
          &amp;lt;META_DATA&amp;gt;audio_armour_type:plate&amp;lt;/META_DATA&amp;gt;&lt;br /&gt;
          &amp;lt;META_DATA&amp;gt;audio_actor_id:actor_16&amp;lt;/META_DATA&amp;gt;&amp;lt;/VARIANT_MESH&amp;gt;&lt;br /&gt;
    &amp;lt;/SLOT&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”weapon_1″ attach_point=”be_prop_0″ /&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”weapon_2″ attach_point=”be_prop_1″ &amp;gt;&lt;br /&gt;
       &amp;lt;VARIANT_MESH model=”VariantMeshes\wh_variantmodels\hu1\emp\emp_props\emp_arch_lector_hammer_1h_01.rigid_model_v2″ &amp;gt;&lt;br /&gt;
          &amp;lt;META_DATA&amp;gt;audio_melee_weapon_type:hammer&amp;lt;/META_DATA&amp;gt;&amp;lt;/VARIANT_MESH&amp;gt;&lt;br /&gt;
    &amp;lt;/SLOT&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”shield” attach_point=”be_prop_2″ /&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”weapon_3″ attach_point=”be_prop_3″ /&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”weapon_4″ attach_point=”be_prop_4″ /&amp;gt;&lt;br /&gt;
    &amp;lt;SLOT name=”weapon_5″ attach_point=”be_prop_5″ &amp;gt;&lt;br /&gt;
       &amp;lt;VARIANT_MESH model=”VariantMeshes\wh_variantmodels\hu1\emp\emp_props\emp_arch_lector_hammer_1h_01.rigid_model_v 2″ &amp;gt;&lt;br /&gt;
          &amp;lt;META_DATA&amp;gt;audio_melee_weapon_type:hammer&amp;lt;/META_DATA&amp;gt;&amp;lt;/VARIANT_MESH&amp;gt;&lt;br /&gt;
    &amp;lt;/SLOT&amp;gt;&lt;br /&gt;
 &amp;lt;/VARIANT_MESH&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you can see I added 2 extra models together to make a new head, looks like this&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-9.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
which is cool but you can already do this using the vanilla files, or a Rigid_v2 file.&lt;br /&gt;
&lt;br /&gt;
I will show you how using the .wsmodel combined with my material files, can create units that are completely unique.&lt;br /&gt;
&lt;br /&gt;
So far we have removed the head of the model karl franz and replaced it, but in a .wsmodel, we will now learn how to add effects like Durthu has or a hexwraith to any unit and to specific parts of each model.&lt;br /&gt;
&lt;br /&gt;
Going back to Gimp open up karl franz body diffuse file, do a save as on this but save it as a ” (yourcharcternamehere)_mask.dds” looks like this&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-10.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
now create a new layer and using a BLACK brush draw on where you would like to see a glow effect here is my example –&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_10_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
I just drew a big T on the cape. Now delete the bottom layer. should now only have the T left, like so&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-11.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
here is where people trip up, this will work but it will be a very solid and almost uncomfortable look, we can actually create a gradient (man im tired) using the mask file there are 2 things that effect this, one is the mask file itself and second is located within the material file itself under&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;name&amp;gt;emissive_strength&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;type&amp;gt;float&amp;lt;/type&amp;gt;&lt;br /&gt;
 &amp;lt;value&amp;gt;0.75&amp;lt;/value&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so using the mask file create a blank layer underneath this one like so –&lt;br /&gt;
&lt;br /&gt;
[[File:wsmodel_11_5.png|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
notice how now it looks faint, what this does is lessen the active effect and how strong it is in certain parts,if you want stronger glow in the center make it darker there than on the edges etc. this will enable you to create effects like the chaos weapons have the key is to&lt;br /&gt;
&lt;br /&gt;
Save as “BC3 / DXT5” –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-12.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
Now you have your new mask.dds file made just for Karl Franz, go ahead and import it then reference it in your material file using the correct file paths &lt;br /&gt;
&lt;br /&gt;
to change the color of the effect you have to change the RGB values in the material file located here –&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-13.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt; &amp;lt;name&amp;gt;emissive_tint&amp;lt;/name&amp;gt;&lt;br /&gt;
 &amp;lt;type&amp;gt;float3&amp;lt;/type&amp;gt;&lt;br /&gt;
 &amp;lt;value&amp;gt;100,0,0&amp;lt;/value&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this would show a red glow, the middle is green and the right value is blue etc. If the colors are showing too strong or too weak try editing the emissive strength value which I referenced earlier.&lt;br /&gt;
&lt;br /&gt;
Ok now give it a go  should have a glow that is in a T shape on the cape of Karl franz. Boom Finished! Enjoy life now that you know a little more than you did before &lt;br /&gt;
&lt;br /&gt;
But this is just the surface of possibilities. here are some units I have made using .wsmodel files&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-14.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-15.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-16.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wsmodels-17.jpg|frameless|697x697px]]&lt;br /&gt;
&lt;br /&gt;
== Notes n Stuff ==&lt;br /&gt;
Hey guys hope you enjoyed the guide and learnt something new, if you know something I dont and think it needs to be in this guide let me know! I would love know and share that with others!&lt;br /&gt;
&lt;br /&gt;
When your .wsmodel files are not working 90% of the time its a file path error you messed up&lt;br /&gt;
&lt;br /&gt;
somewhere I guarantee it! Sometimes is your “lods” and “parts” and in some cases it the shader you are trying to use.&lt;br /&gt;
&lt;br /&gt;
This tip comes from Chaos robbie, so thank you you him&lt;br /&gt;
&lt;br /&gt;
Super Tip: If you’re getting that washed-out bug when using wsmodels it’s because your .dds formats are wrong. Here are the Intel Texture Works v1.0.4 settings that work 100% of the time:&lt;br /&gt;
&lt;br /&gt;
* for Diffuse use Color and BC7 8 bpp Fine (sRGB, DX11++)&lt;br /&gt;
&lt;br /&gt;
o or if you have an alpha channel use Color+Alpha and BC7 8 bpp Fine (sRGB, DX11++)&lt;br /&gt;
&lt;br /&gt;
* for Specular use the same&lt;br /&gt;
* for Gloss Map you use Color and BC1 4bpp (Linear)&lt;br /&gt;
* for Normal Map you use Color+Alpha and BC1 4bpp (Linear)&lt;br /&gt;
&lt;br /&gt;
the best advice I can give is dont give up, keep trying different stuff, we are all still new to this .wsmodel stuff, who knows you may find something new.&lt;br /&gt;
&lt;br /&gt;
If you get stuck you can ask here but I am much more likely to reply on the Discord here – &amp;lt;nowiki&amp;gt;https://discord.gg/62retHM&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If I do not answer someone else like Cataph or Marthenil will be able to help you.&lt;br /&gt;
&lt;br /&gt;
which reminds me, this guide would not be possible if not for the discord, so thanks to everyone who has helped and answered my questions.&lt;br /&gt;
[[Category:Needs Formatting]]&lt;br /&gt;
[[Category:Needs Review]]&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_11_5.png&amp;diff=460</id>
		<title>File:Wsmodel 11 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_11_5.png&amp;diff=460"/>
		<updated>2022-01-22T18:06:04Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_10_5.png&amp;diff=459</id>
		<title>File:Wsmodel 10 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_10_5.png&amp;diff=459"/>
		<updated>2022-01-22T18:05:42Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_7_5.png&amp;diff=458</id>
		<title>File:Wsmodel 7 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_7_5.png&amp;diff=458"/>
		<updated>2022-01-22T17:44:55Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_6_5.png&amp;diff=457</id>
		<title>File:Wsmodel 6 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_6_5.png&amp;diff=457"/>
		<updated>2022-01-22T17:32:47Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_5_5.png&amp;diff=456</id>
		<title>File:Wsmodel 5 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_5_5.png&amp;diff=456"/>
		<updated>2022-01-22T17:32:34Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Wsmodel_0_5.png&amp;diff=455</id>
		<title>File:Wsmodel 0 5.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Wsmodel_0_5.png&amp;diff=455"/>
		<updated>2022-01-22T17:10:06Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=453</id>
		<title>Example Scripts</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=453"/>
		<updated>2022-01-18T21:42:41Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Fixed the broken link&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;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Mods&amp;diff=452</id>
		<title>Mods</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Mods&amp;diff=452"/>
		<updated>2022-01-18T21:37:19Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: linked the two wrong links to the proper pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A mod is any alteration to the base game, through [[modding]].&lt;br /&gt;
&lt;br /&gt;
Mods are made up of a single .pack file, which contains all the changes for that mod, and a single .png file of the same name - which is just used as the thumbnail within Steam and the Total War Launcher.&lt;br /&gt;
== Finding Mods ==&lt;br /&gt;
Most mods that you will find can be discovered on the Steam Workshop page, for each Total War game.&lt;br /&gt;
&lt;br /&gt;
* [https://steamcommunity.com/app/594570/workshop/ Total War: Warhammer 2 Steam Workshop]&lt;br /&gt;
* Etc.&lt;br /&gt;
&lt;br /&gt;
Point of assistance here - you'll have a better time either Googling for the mods you're looking for (ie., &amp;quot;total war warhammer 2 greenskin units mods&amp;quot;), or searching for a collection on the Workshop. Steam Workshop is... a subpar searching service. Ironically.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
When you find a mod you like in the Steam Workshop, you simply press the &amp;quot;Subscribe&amp;quot; button - '''making sure to download all required items for that mod!''' - and let Steam download it in the background. Next time you load up the game, you will see it available in the launcher's mod manager. Simply tick the mod in the manager, and it will be enabled next time you press play!&lt;br /&gt;
&lt;br /&gt;
Important note here: Don't faff around with [[Troubleshooting#How_to_Load_Order|load order]]. Mods are sorted alphanumerically by default, and modders are aware of the priorities needed between mods most of the time, when it comes to [[Tutorial:Submodding#WHAT_IS_A_SUBMOD.3F|submods]] or similar.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If a mod doesn't appear to work or update, you can try to unsubscribe and re-subscribe, though in some instances this may not be enough and you may need to Clear the Steam Download Cache, see this [https://support.steampowered.com/kb_article.php?ref=3134-TIAL-4638 article]&lt;br /&gt;
&lt;br /&gt;
See also: [[Troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
== Compatibility ==&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Modding&amp;diff=314</id>
		<title>Modding</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Modding&amp;diff=314"/>
		<updated>2021-04-14T09:31:41Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: linked to the installing and using mods guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modding, or creating [[mods]], is the act of modifying the game files in order to cause changes or create new behavior within the game. There's a lot that can be done with modding - this page seeks to be a clear outline of what modding is, what you can and cannot mod, and other important high-level concepts.&lt;br /&gt;
&lt;br /&gt;
If you're looking for [[Tutorial:Using Mods|using mods]], check that page.&lt;br /&gt;
&lt;br /&gt;
And you can check the [[Tutorial:Main Page|modding tutorials]] page for a portal about various available, specific tutorials.&lt;br /&gt;
&lt;br /&gt;
== What's a Mod ==&lt;br /&gt;
A mod - short for &amp;quot;Modification&amp;quot; - can be anything user-created that edits the game in a meaningful way.&lt;br /&gt;
&lt;br /&gt;
In the Total War series, mods are composed of a single file - a .pack file - which contain all of the changes within that mod. Packs act like a .zip or .rar file, a compressed folder in a single file. Much of the vanilla game is composed of various CA-made pack files.&lt;br /&gt;
&lt;br /&gt;
Packs can contain a lot of various pieces, such as:&lt;br /&gt;
&lt;br /&gt;
* '''Data:''' One of the most-used parts of a mod is databasing. Total War uses database files, similar to spreadsheets, which can be used to change behavior and values, or add new objects to the game. This is used for much of the game, from units and their stats to the cost of buildings and much in between.&lt;br /&gt;
* '''Text:''' On top of that, text you see in the game - from the name of a lord to the flavour text of a skill - is done within packs, in .loc files. These files attach text to the database, and they can be used for translations as well!&lt;br /&gt;
* '''Assets:''' This is a wide topic - but much of the game can be edited through assets. Assets range from .png images scattered throughout the UI, to altered .dds files which are used on the various unit models in the game, to entirely new models or otherwise.&lt;br /&gt;
* '''Battle Maps:''' Battle maps are created through the Terry tool, from within the [[Assembly Kit]].&lt;br /&gt;
* '''Scripts:''' There's a layer of the game that can be interacted with through scripts (.lua files). Scripts power things such as characters getting experience, legendary lord defeat traits, and the Chaos Invasion - and much in between!&lt;br /&gt;
&lt;br /&gt;
There's natural limitations to modding the game, since the game is written in a way that cannot be decompiled easily - meaning much of the game code and engine is unreadable and untouchable. That said, Creative Assembly does a comparatively excellent job at making sure much of the game is exposed to being modified!&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
You've decided on a general mod idea you want to do, and you're ready to set aside some time to try, fail, try, fail, try and then inexplicably succeed the third time. This is the spot for you!&lt;br /&gt;
&lt;br /&gt;
First thing's first, before you go on, you need to grab the [https://github.com/Frodo45127/rpfm/releases/latest Rusted Pack File Manager], by Frodo. It's the primary tool available to create a .pack file, edit it, and manipulate it in whatever way, and comes with a lot of excellent functionality.&lt;br /&gt;
&lt;br /&gt;
Right after installing RPFM, you should decide on a folder on your computer that you'll store your mods. This'll be your primary directory for modding. For instance, I have S:/modding/ determined as my main spot on disk. Name it whatever you want, put it wherever you want.&lt;br /&gt;
&lt;br /&gt;
Then, within RPFM, open the Preferences menu (through Ctrl+P, or PackFile -&amp;gt; Preferences), and begin to set up the necessary preferences within. Target all of the folders for all installed Total War games, targeting the folder where the .exe of the game is. Underneath, in &amp;quot;MyMod's Folder&amp;quot;, fill in your new folder.&lt;br /&gt;
[[File:Screenshot 2021-01-31 205343.png|left|thumb|710x710px|Fill in your MyMod folder here!]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fill out whatever other preferences you may like, but most of this stuff you'll see through time. Keep &amp;quot;Allow Editing of CA PackFiles&amp;quot; to false, I prefer to have all of the checks valid on start, and of course the Use Dark Theme setting is an absolute must.&lt;br /&gt;
&lt;br /&gt;
With RPFM, we can do an absolute load of modding. I recommend [[Setting up GitHub|using GitHub]] for version and source control - it's saved me several dozen times when I almost certainly would've lost an entire mod, or gotten two versions (ie. an update version and the retail version) mixed up.&lt;br /&gt;
&lt;br /&gt;
You may also want to download the [[Assembly Kit]] for the game you're modding, as well as [https://www.microsoft.com/en-us/microsoft-365/excel Excel] or another spreadsheet program - it can come in hand a billion times over.&lt;br /&gt;
&lt;br /&gt;
With all of our tools set up, we can get [[First Mod|started on our first mod]]!&lt;br /&gt;
&lt;br /&gt;
== Guidelines ==&lt;br /&gt;
This is a list of hopefully helpful tips for modders - new or old.&lt;br /&gt;
&lt;br /&gt;
* '''Start small, build up.''' One of the oldest tricks in the book is having a tremendously bloated idea, trying to make it all at once, getting overwhelmed, and then quitting. We've literally all done it. Instead of trying to build a pyramid from the bottom up, try to build a glacier from the top down, starting with a simpler idea and continuing it naturally.&lt;br /&gt;
* '''Ask for help.''' The Total War modding community, especially that around the Modding Den Discord, is a big help - you're not in this alone.&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Using_Mods&amp;diff=311</id>
		<title>Tutorial:Using Mods</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Using_Mods&amp;diff=311"/>
		<updated>2021-03-31T22:14:59Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Fixed formatting.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Before we begin ==&lt;br /&gt;
This guide explains how you to use mods. It has nothing to do with the actual creating part of modding. The KMM parts of this guide are recommended but not strictly neccesary. But like Gromby aptly says: &lt;br /&gt;
[[File:USEKMM.jpg]]&lt;br /&gt;
This guide is written with steam in mind, if you are an epic games user go to the end of the guide to find out what you need to do different.&lt;br /&gt;
&lt;br /&gt;
== Setting up KMM ==&lt;br /&gt;
=== Installing KMM ===&lt;br /&gt;
1) Download from: [https://github.com/Kaedrin/warhammer-mod-manager/releases/latest Kaedrin´s mod manager latest download]&lt;br /&gt;
2) Unzip the folder in your Documents directory OR your Desktop. ANYWHERE except the game directories or anything related to Steam.&lt;br /&gt;
3) Create a shortcut to Warhammer2MM.exe and put it on your Desktop&lt;br /&gt;
4) If you need to set the shortcut to admin mode, right click the shortcut, go to properties, click Advanced, and turn on &amp;quot;Run as Administrator&amp;quot;&lt;br /&gt;
=== Setting up the paths ===&lt;br /&gt;
* After you have installed it when you open it for the first time it will give you a popup about detecting your game paths. Just click accept and reopen KMM. KMM should already have detected all your TW games. You can check this by clicking on the &amp;quot;Game&amp;quot; header in KMM. The black names are the ones which it detected and you can choose. The grey names are the ones which would be possible but it either didn´t detect or you don´t own. KMM smells pirated TW games from miles away so if you pirated it it will also not work.&lt;br /&gt;
* When clicking on the &amp;quot;Options&amp;quot; header you can set the paths for Mod Backups if you want KMM to backup your mods for you, PFM (switch to RPFM pls if you still use PFM) and RPFM (Rusted Packfile Manager the tool with which most of us create our mods). You can also force KMM to try to detect new game paths.&lt;br /&gt;
== Downloading Mods ==&lt;br /&gt;
So downloading Mods is fairly simple. You begin by opening your steam client. Then you click on the &amp;quot;COMMUNITY&amp;quot; Header in your client (1). After this you should be seeing a tab with your last played games. If the TW game for which you want to download mods is not in that list then please click on the search bar to the right of the list and search for the game. Once you see the name of your game click on it(2). You are now in the community tab of the game. Now click on the &amp;quot;WORKSHOP&amp;quot; header in that Tab (3). Here´s a picture where I highlighted the different steps in case you didn´t understand what I was talking about: [[File:Downloading Mods.PNG]]&lt;br /&gt;
Now you search for the mods you want to use. Once you have found them you click on the subscribe button and Steam should start the download automatically.&lt;br /&gt;
== Using KMM ==&lt;br /&gt;
Here´s a picture so you can understand my description better: &lt;br /&gt;
[[File:Using KMM.PNG]]&lt;br /&gt;
=== NR1: Options ===&lt;br /&gt;
* &amp;quot;Use last profile&amp;quot; and &amp;quot;Highlight recent mods&amp;quot; are pretty self-explanatory and should in my opinion both be ticked.&lt;br /&gt;
* &amp;quot;Backup Mods&amp;quot; and &amp;quot;Choose Backup Location&amp;quot; are still self-explanatory. Click on &amp;quot;Choose Backup Location&amp;quot; to choose where your backup should be saved and check &amp;quot;Backup Mods&amp;quot; to actually enable the Backup function.&lt;br /&gt;
* &amp;quot;Choose PFM location&amp;quot; and &amp;quot;Choose RPFM location&amp;quot; is used to set the path to the respective manager. (Pls don´t use PFM thought instead use RPFM)&lt;br /&gt;
* &amp;quot;Detect Game Installations&amp;quot; is used to retrigger the game detection if you have a new TW game you want to use mods for.&lt;br /&gt;
* &amp;quot;Bypass CA launcher&amp;quot; does what it says when ticked and should always be ticked in my opinion.&lt;br /&gt;
* &amp;quot;Bypass Conflict Detection&amp;quot; should be ticked unless you have a real need for it. But mostly you won´t.&lt;br /&gt;
=== NR2 and 2*: Profiles ===&lt;br /&gt;
* You can make a new profile by enabling the mods you want in it and then naming it in the text field (2*) and click save and you have your new profile.&lt;br /&gt;
* You can export your currently open profile via the &amp;quot;Profile&amp;quot; header (2). It will be saved as a txt file in the location you choose.&lt;br /&gt;
* You can import a profile if you have the txt file for it. You do this via the &amp;quot;Profile&amp;quot; header (2). It will automatically only enable the mods you are subbed to and are in that profile and disable all others.&lt;br /&gt;
=== NR3: Game ===&lt;br /&gt;
* You can see all games supported by KMM (grey names) and the ones which are supported and KMM detected (black names) when you click on the &amp;quot;Game&amp;quot; header.&lt;br /&gt;
=== NR4: Tips ===&lt;br /&gt;
* Here you see some good tips and info for using KMM&lt;br /&gt;
=== NR5: Version ===&lt;br /&gt;
* You can see the version you use in the top row and the latest version available under the headers. Make sure to always use the newest version.&lt;br /&gt;
=== NR6: Number of Mods ===&lt;br /&gt;
* You can see how many mods you have enabled in the top, left of the tips and info section.&lt;br /&gt;
* You can see the number of movie mods you have over the start button. Movie mods are always active regardless of if you activate them or not. So be aware of that. You can see which mods are movie mods by sorting via the &amp;quot;type column&amp;quot;.&lt;br /&gt;
* You enable mods by checking the small box left of their name.&lt;br /&gt;
=== NR7: Launching and Refreshing ===&lt;br /&gt;
* The refresh button over the launch button is used to refresh KMM if you downloaded any mods while KMM was open so KMM becomes aware of the new mods.&lt;br /&gt;
* You launch the game by clicking on the launch button.&lt;br /&gt;
== Enabling mods (CA/Vanilla Launcher) ==&lt;br /&gt;
So you have succesfully downloaded a mod. Congratz! But you have decided against using KMM. Well it´s not my part to judge...&lt;br /&gt;
You enable mods by starting your game like you normally do but before you click on the play button inside of the TW launcher you click on the &amp;quot;Mod Manager&amp;quot; header on the left right next to the &amp;quot;Game&amp;quot; and &amp;quot;Shop&amp;quot; header.&lt;br /&gt;
Then you should be in the CA mod manager. There you search through the list of mods and click on the grey bar on their left to enable them. They should then turn green. Once you have enabled all the mods you want to use you click on the big play button in the upper right. You now get a popup that lists all enabled mods. Look through them if you forgot to enable some and then accept the popup. Here´s another picture to simplify:&lt;br /&gt;
[[File:Enabling Mods.PNG]] Congrats! You now succesfully activated a mod!&lt;br /&gt;
== Good Practices ==&lt;br /&gt;
* Don´t change Loadorder! Only do this if you are aware of what you are doing there and even then only do this if you have a good reason!&lt;br /&gt;
* If you have issues with mods try to fix them yourself first (I recommend Cataph´s excellent guide: [[Troubleshooting|Troubleshooting Guide]] ) and only if you have confirmed it is a problem with that particular mod contact the author. Most of us prefer Discord but Steam works as well.&lt;br /&gt;
* Don´t be obnoxious. Almost all of us are doing Modding as a hobby and not as a job. So don´t spam &amp;quot;UPDATE PLS&amp;quot; for example. There might be a very good reason why we didn´t update our mod yet or we just didn´t have time yet. &lt;br /&gt;
== Differences if you are using Epic Games instead of Steam ==&lt;br /&gt;
I have no idea as I don´t own a TW Game on Epic. But if you do and know what´s different for epic games then please fill in this section. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I’ll add more information later if people have questions or I forgot anything.&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Using_KMM.PNG&amp;diff=309</id>
		<title>File:Using KMM.PNG</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Using_KMM.PNG&amp;diff=309"/>
		<updated>2021-03-31T22:13:17Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Fenriswolf uploaded a new version of File:Using KMM.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:USEKMM.jpg&amp;diff=312</id>
		<title>File:USEKMM.jpg</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:USEKMM.jpg&amp;diff=312"/>
		<updated>2021-03-31T22:11:01Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Custom_Lords_%26_Heroes&amp;diff=310</id>
		<title>Tutorial:Custom Lords &amp; Heroes</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Custom_Lords_%26_Heroes&amp;diff=310"/>
		<updated>2021-03-31T21:48:42Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Missed one link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== By Nanu ===&lt;br /&gt;
&lt;br /&gt;
=== Contents ===&lt;br /&gt;
&lt;br /&gt;
* Creating a Character&lt;br /&gt;
** agent_subtypes&lt;br /&gt;
** agent_uniforms&lt;br /&gt;
** campaign_character_art_sets&lt;br /&gt;
** campaign_character_arts&lt;br /&gt;
** character_skill_node_sets_tables&lt;br /&gt;
** faction_agent_permitted_subtypes&lt;br /&gt;
* Agent Actions&lt;br /&gt;
** agent_actions_tables&lt;br /&gt;
* Legendary Lords and Heroes&lt;br /&gt;
&lt;br /&gt;
==== Setup ====&lt;br /&gt;
This guide assumes you have created the unit for you custom hero/lord, see [https://steamcommunity.com/sharedfiles/filedetails/?id=1694945483 Cryswar's Unit Guide] if you haven't yet. &lt;br /&gt;
&lt;br /&gt;
You should also have [https://github.com/Frodo45127/rpfm/releases Rusted Pack File Manager] (RPFM). It's free, it's easy to use, and it's well maintained.&lt;br /&gt;
&lt;br /&gt;
Below is a list of tables, localization files, and other resources that are required to add a new agent to the game, as well as a few optional ones.&lt;br /&gt;
&lt;br /&gt;
Required&lt;br /&gt;
&lt;br /&gt;
* Tables&lt;br /&gt;
** agent_subtypes&lt;br /&gt;
** agent_uniforms&lt;br /&gt;
** campaign_character_art_sets&lt;br /&gt;
** campaign_character_arts&lt;br /&gt;
** character_skill_node_sets&lt;br /&gt;
** faction_agent_permitted_subtypes&lt;br /&gt;
* Localizations&lt;br /&gt;
** agent_subtypes.loc&lt;br /&gt;
* [https://steamcommunity.com/sharedfiles/filedetails/?id=1194811468 Porthole Process]&lt;br /&gt;
&lt;br /&gt;
Optional&lt;br /&gt;
&lt;br /&gt;
* Tables&lt;br /&gt;
** agent_actions&lt;br /&gt;
** effect_bonus_value_agent_action_record_junctions_tables&lt;br /&gt;
** character_skill_level_to_effects_junctions_tables&lt;br /&gt;
** character_skill_nodes_tables&lt;br /&gt;
** names&lt;br /&gt;
* Localizations&lt;br /&gt;
** names.loc&lt;br /&gt;
* Lua script to spawn your character&lt;br /&gt;
&lt;br /&gt;
Now I can drone on about the tables and whats in them or we can build a mod together. Lets do the latter. We're going to make a mod that adds new characters to the game.&lt;br /&gt;
&lt;br /&gt;
So what kind of characters should we mod into the game? What kind of characters does Total War Warhammer II need?&lt;br /&gt;
&lt;br /&gt;
How about a Chaos Sorcerer of Life, and a Chaos Sorcerer Lord of Life. Maybe Archaon had a change of heart and wants to heal the world.&lt;br /&gt;
&lt;br /&gt;
We're going to ignore the unit tables, if you want to build this mod along with this guide then go ahead and set up the unit tables now. [https://steamcommunity.com/sharedfiles/filedetails/?id=1694945483 This guide] will help you set everything up&lt;br /&gt;
&lt;br /&gt;
Great! Now that we have our units ready lets walk through the tables we need to create our tree hugging Champions of Chaos. I have provided the tables needed in this guide, but some are too large to fit on the page. You'll need to zoom out (left ctrl + mouse wheel) to see them fully.&lt;br /&gt;
&lt;br /&gt;
One more thing, [https://steamcommunity.com/sharedfiles/filedetails/?id=2137707555 this is our completed mod], you can download it and use it to follow along if you'd like.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Creating the Character ===&lt;br /&gt;
&lt;br /&gt;
==== agent_subtypes ====&lt;br /&gt;
Any character or lord on the campaign map or embedded into an army is an agent. The agent_subtypes table contains basic information about this specific subtype of agent.&lt;br /&gt;
&lt;br /&gt;
Here's the agent_subtypes table for our new chaos characters&lt;br /&gt;
&lt;br /&gt;
I know, theres a lot, but don't worry! Its not as hard as it looks and most of it is self explanatory&lt;br /&gt;
&lt;br /&gt;
* Key&lt;br /&gt;
** Key is well, the key of our agent subtype. This is a unique key that will be used to reference our agent from the db or scripts. This must be a unique key and if possible should match the main_unit key for your agent.&lt;br /&gt;
* Auto Generate&lt;br /&gt;
** Whether or not the game should automatically generate this character and add them to the character pool. Leave this unchecked for unique characters like Legendary Lords. Names will be generated from the factions name list. Starting traits have to be added to a list for each subtype. More on that later. For our characters, we are going to leave this checked, since we want the game to make generic versions of these characters&lt;br /&gt;
* Is Caster&lt;br /&gt;
** This just determines whether or not this character can use casting items.&lt;br /&gt;
* Small Icon&lt;br /&gt;
** The icon you'll see on the campaign map for this character. Lords have this icon overridden so you can leave it blank for them.&lt;br /&gt;
* Associated Unit Override&lt;br /&gt;
** The main_unit key associated with this character. You don't need a new subtype for each mount, only the base unit is needed here.&lt;br /&gt;
* Audio Voiceover Actor Group&lt;br /&gt;
** The voice that this character has on the campaign map. Battle voice actor is determined in main_units (yes, they can be different).&lt;br /&gt;
* Show in Ui&lt;br /&gt;
** Whether or not this character shows up in the recruitment panel. Set to false for Legendary Heroes like Cylostra's Damned Paladin or Wulfhart's unique hereos.&lt;br /&gt;
* Cap&lt;br /&gt;
** This is only used for Gotrek, Felix, Lord Kroak, and Henri le Massif. As far as I know it isn't needed even for Legendary Lords or unique heroes. Leave this as -1.&lt;br /&gt;
* Has Female Name&lt;br /&gt;
** Self Explanatory&lt;br /&gt;
* Can Gain Xp&lt;br /&gt;
** Self Explanatory&lt;br /&gt;
* Loyalty is Applicable&lt;br /&gt;
** This doesn't add your lord to the loyalty system, it only shows the loyalty icon above their banner and in their details panel. Loyalty is scripted, you must add your lords to the loyalty scripts to add them to the loyalty system&lt;br /&gt;
* Contributes to Agent Cap&lt;br /&gt;
** Whether or not this subtype takes up an agent slot. I set this to false for my unique Heroes, but you can leave it as true if you want. This should always be true for Lords.&lt;br /&gt;
* Recruitment Category&lt;br /&gt;
** As of the Warden and the Paunch, Lords now are separated into different groups like Heroes. This value determines which group your lord should be sorted into. Leave this blank for Heroes&lt;br /&gt;
* Magic Lore&lt;br /&gt;
** Used only for sorting Lords into categories under their respective Recruitment Category. Leave this blank for Heroes&lt;br /&gt;
* Audio Vo Culture Override&lt;br /&gt;
** Only Grom and the River Troll Hag use this. Just leave it blank&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== agent_uniforms ====&lt;br /&gt;
This one is simple, and you should have already done this when you went through the [https://steamcommunity.com/sharedfiles/filedetails/?id=1194811468 porthole process]. I won't go through it since this its pretty simple, just reference the variant key for your subtype (or for this variation, you need a uniform for each variant unless you want this hero type to all look the same).&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== campaign_character_art_sets ====&lt;br /&gt;
This table is one of two that determine your agent's campaign variant.&lt;br /&gt;
&lt;br /&gt;
* Art Set Id&lt;br /&gt;
** Unique ID for your character Art Set. This is needed for every variation of your subtype. Most vanilla agents have 2-5 different art sets (and subsequent uniforms/portholes). Our characters only have one each to make things easy.&lt;br /&gt;
* Is Custom&lt;br /&gt;
** Leave this false. Only a few unique characters like Kemmler and Mannfred use this and idk why&lt;br /&gt;
* Agent Type&lt;br /&gt;
** The agent type your subtype belongs to. Lords are all generals, heroes can be wizards, champions, spies, dignitaries, and engineers. There are others but they're deprecated&lt;br /&gt;
* Faction&lt;br /&gt;
** I'm pretty sure this is how you limit which faction this art set applies to, Lokhir is the only one I'm aware of that uses this. Best to leave this blank&lt;br /&gt;
* Culture&lt;br /&gt;
** Same as above, just follow a vanilla equivalent&lt;br /&gt;
* Subculture&lt;br /&gt;
** Again, same as above. Chaos Lords and Heroes use this column, so I did too. When in doubt do what CA does&lt;br /&gt;
* Is Male&lt;br /&gt;
** Leave this checked. Yes, even if your character is a girl.&lt;br /&gt;
* Agent Subtype&lt;br /&gt;
** Your agent_subtype key&lt;br /&gt;
* Campaign Map Scale&lt;br /&gt;
** Leave as 1&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== campaign_character_arts ====&lt;br /&gt;
&lt;br /&gt;
* Art Set Id&lt;br /&gt;
** Same as your art set Id from the above table&lt;br /&gt;
* Level&lt;br /&gt;
** Leave this as 0&lt;br /&gt;
* Season&lt;br /&gt;
** Leave this as none&lt;br /&gt;
* Age&lt;br /&gt;
** Leave this as 0&lt;br /&gt;
* Portrait&lt;br /&gt;
** Leave this blank&lt;br /&gt;
* Uniform&lt;br /&gt;
** The agent_uniform this character art uses&lt;br /&gt;
* Card&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Info&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Sea Uniform&lt;br /&gt;
** The ship you see on the campaign map when this agent embarks onto the water&lt;br /&gt;
* Navy Uniform&lt;br /&gt;
** Deprecated. Use the faction's default lord Navy Uniform&lt;br /&gt;
* Land Animation&lt;br /&gt;
** The animation your character uses on the campaign map. Must be a campaign animation, battle animations don't work here.&lt;br /&gt;
* Sea Animation&lt;br /&gt;
** The animation your ship uses on the water.&lt;br /&gt;
* Navy Animation&lt;br /&gt;
** again, deprecated, copy the vanilla Lord default value&lt;br /&gt;
* Id&lt;br /&gt;
** Unique ID for this character art. This must be a unique number.&lt;br /&gt;
* Religion&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Land Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
* Sea Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
* Navy Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== character_skill_node_sets_tables ====&lt;br /&gt;
This table connects your character skill node set to your subtype. Without this table, your character won't have any skills to use when they level up. I won't go through the basics of skills in this guide, [https://steamcommunity.com/sharedfiles/filedetails/?id=1696051257 there already exists a guide for it], but you will need this to fully flesh out your characters so I've added it.&lt;br /&gt;
&lt;br /&gt;
* Key&lt;br /&gt;
** Unique Key for this node set&lt;br /&gt;
* Faction Key&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Campaign Key&lt;br /&gt;
** Leave Blank&lt;br /&gt;
* Agent Key&lt;br /&gt;
** The Agent type for you subtype. Yes, you have to specify it again. This isn't even the last time either.&lt;br /&gt;
* Subculture&lt;br /&gt;
** Leave Blank&lt;br /&gt;
* For Army&lt;br /&gt;
** Leave unchecked&lt;br /&gt;
* For Navy&lt;br /&gt;
** Leave unchecked&lt;br /&gt;
* Agent Subtype&lt;br /&gt;
** This will add this character node set to your agent subtype. All characters with this subtype will have the same skill node set. If you want your characters to have different skill node sets you need to make new subtypes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== faction_agent_permitted_subtypes ====&lt;br /&gt;
This mess of a table is what adds your agent subtype to the faction of your choice. You have to add your subtype to every faction that will have access to the subtype.&lt;br /&gt;
&lt;br /&gt;
* Faction&lt;br /&gt;
** The faction that will now have access to this agent subtype&lt;br /&gt;
* Agent&lt;br /&gt;
** Yes, you have to specify this again. No, I don't know why&lt;br /&gt;
* Subtype&lt;br /&gt;
** Your agent subtype&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== agent_subtypes.loc ====&lt;br /&gt;
You should be familiar with loc files by now, this just specifies the name and description of your agent subtypes.&lt;br /&gt;
----And thats it! With those tables filled out, you've done everything you need to turn your unit into a recruitable character! Assuming you have your unit tables finished, you can now go into campaign and recruit your new Chaos Sorcerer Lord of Life.&lt;br /&gt;
&lt;br /&gt;
If it's crashing or your characters aren't showing up as recruitable, check that you filled out everything right, or [https://steamcommunity.com/sharedfiles/filedetails/?id=2137707555 use the example mod as a comparison].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Adding Agent Actions ===&lt;br /&gt;
But wait! What about our Chaos Sorcerer's campaign actions? How can we get our new campaign hero to assault units or assassinate a character?  &lt;br /&gt;
&lt;br /&gt;
Well, the campaign actions are added via skills, and we can just add a skill that CA already defined for us to our characters skill node set. But maybe we want our character to be a little more unique? &lt;br /&gt;
&lt;br /&gt;
Lets give them a different set of abilities, we'll need to create a new skill, which you can do by following [https://steamcommunity.com/sharedfiles/filedetails/?id=1696051257 this guide]. After you made a new skill and added it to the skill node set, lets add some agent actions to it in the character_skill_level_to_effects_junctions table:&lt;br /&gt;
&lt;br /&gt;
This is a copy of the vanilla wh2_main_skill_all_dummy_agent_actions_chs_sorcerer skill, but we want to make some changes, so lets replace the passive wh2_main_effect_agent_action_enable_wizard_hinder_settlement_steal_technology, which give our hero the ability to boost technolofy by attacking a settlement, and replace it with wh2_main_effect_agent_action_enable_wizard_hinder_settlement_damage_walls, which lets him damage the walls instead:&lt;br /&gt;
&lt;br /&gt;
Great! Now we have a hero who has a different set of campaign actions. Keep in mind you must use effects that apply to your agent type, if you want to add an agent action that doesn't exist already, you must make the agent action and effect to apply it. Lets go ahead and make a new agent action for the Chaos Sorcerer of Life. We'll give him the ability to assassinate, something normal wizards can't do in the base game. Here are the tables you'll need:&lt;br /&gt;
&lt;br /&gt;
* agent_actions&lt;br /&gt;
* effect_bonus_value_agent_action_record_junctions_tables&lt;br /&gt;
&lt;br /&gt;
I'm going to skip over the effect tables, you can make a new empty effect using [https://steamcommunity.com/sharedfiles/filedetails/?id=1761177338 this guide] if you want to follow along, otherwise, I'll assume you have your effect ready.&lt;br /&gt;
&lt;br /&gt;
==== agent_actions ====&lt;br /&gt;
This table is very convoluted and particularly finicky, you'll want to start with an agent action that already exists to avoid making mistakes. Lets start with the Exalted Hero's assassinate ability, defined as wh2_main_agent_action_champion_hinder_agent_assassinate&lt;br /&gt;
&lt;br /&gt;
in the agent_actions table.&lt;br /&gt;
&lt;br /&gt;
We're not going to change much here, just the Agent and the Unique Id. We'll copy this row from the CA data.pack into our mod, change Agent to wizard and Unique Id to chs_chaos_sorcerer_life_assassinate&lt;br /&gt;
&lt;br /&gt;
Now we can add the agent action to the effect_bonus_value_agent_action_record_junctions_table&lt;br /&gt;
&lt;br /&gt;
And finally add our effect to the chs_chaos_sorcerer_life_agent_actions skill we made&lt;br /&gt;
&lt;br /&gt;
And that's it! We now have a custom hero subtype that has a unique set of campaign actions!&lt;br /&gt;
&lt;br /&gt;
=== Legendary Lords and Heroes ===&lt;br /&gt;
Making Legendary Lords and Heroes is simple, plus you've already done most of the legwork. A guide on how to name them and spawn them on the campaign map is available [https://steamcommunity.com/sharedfiles/filedetails/?id=1695928423 here].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Custom_Lords_%26_Heroes&amp;diff=303</id>
		<title>Tutorial:Custom Lords &amp; Heroes</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Custom_Lords_%26_Heroes&amp;diff=303"/>
		<updated>2021-03-29T18:51:41Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: I changed the links to steam links since the pages where they linked originally don´t exist anymore&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== By Nanu ===&lt;br /&gt;
&lt;br /&gt;
=== Contents ===&lt;br /&gt;
&lt;br /&gt;
* Creating a Character&lt;br /&gt;
** agent_subtypes&lt;br /&gt;
** agent_uniforms&lt;br /&gt;
** campaign_character_art_sets&lt;br /&gt;
** campaign_character_arts&lt;br /&gt;
** character_skill_node_sets_tables&lt;br /&gt;
** faction_agent_permitted_subtypes&lt;br /&gt;
* Agent Actions&lt;br /&gt;
** agent_actions_tables&lt;br /&gt;
* Legendary Lords and Heroes&lt;br /&gt;
&lt;br /&gt;
==== Setup ====&lt;br /&gt;
This guide assumes you have created the unit for you custom hero/lord, see [https://steamcommunity.com/sharedfiles/filedetails/?id=1694945483 Cryswar's Unit Guide] if you haven't yet. &lt;br /&gt;
&lt;br /&gt;
You should also have [https://github.com/Frodo45127/rpfm/releases Rusted Pack File Manager] (RPFM). It's free, it's easy to use, and it's well maintained.&lt;br /&gt;
&lt;br /&gt;
Below is a list of tables, localization files, and other resources that are required to add a new agent to the game, as well as a few optional ones.&lt;br /&gt;
&lt;br /&gt;
Required&lt;br /&gt;
&lt;br /&gt;
* Tables&lt;br /&gt;
** agent_subtypes&lt;br /&gt;
** agent_uniforms&lt;br /&gt;
** campaign_character_art_sets&lt;br /&gt;
** campaign_character_arts&lt;br /&gt;
** character_skill_node_sets&lt;br /&gt;
** faction_agent_permitted_subtypes&lt;br /&gt;
* Localizations&lt;br /&gt;
** agent_subtypes.loc&lt;br /&gt;
* [https://steamcommunity.com/sharedfiles/filedetails/?id=1194811468 Porthole Process]&lt;br /&gt;
&lt;br /&gt;
Optional&lt;br /&gt;
&lt;br /&gt;
* Tables&lt;br /&gt;
** agent_actions&lt;br /&gt;
** effect_bonus_value_agent_action_record_junctions_tables&lt;br /&gt;
** character_skill_level_to_effects_junctions_tables&lt;br /&gt;
** character_skill_nodes_tables&lt;br /&gt;
** names&lt;br /&gt;
* Localizations&lt;br /&gt;
** names.loc&lt;br /&gt;
* Lua script to spawn your character&lt;br /&gt;
&lt;br /&gt;
Now I can drone on about the tables and whats in them or we can build a mod together. Lets do the latter. We're going to make a mod that adds new characters to the game.&lt;br /&gt;
&lt;br /&gt;
So what kind of characters should we mod into the game? What kind of characters does Total War Warhammer II need?&lt;br /&gt;
&lt;br /&gt;
How about a Chaos Sorcerer of Life, and a Chaos Sorcerer Lord of Life. Maybe Archaon had a change of heart and wants to heal the world.&lt;br /&gt;
&lt;br /&gt;
We're going to ignore the unit tables, if you want to build this mod along with this guide then go ahead and set up the unit tables now. [https://steamcommunity.com/sharedfiles/filedetails/?id=1694945483 This guide] will help you set everything up&lt;br /&gt;
&lt;br /&gt;
Great! Now that we have our units ready lets walk through the tables we need to create our tree hugging Champions of Chaos. I have provided the tables needed in this guide, but some are too large to fit on the page. You'll need to zoom out (left ctrl + mouse wheel) to see them fully.&lt;br /&gt;
&lt;br /&gt;
One more thing, [https://steamcommunity.com/sharedfiles/filedetails/?id=2137707555 this is our completed mod], you can download it and use it to follow along if you'd like.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Creating the Character ===&lt;br /&gt;
&lt;br /&gt;
==== agent_subtypes ====&lt;br /&gt;
Any character or lord on the campaign map or embedded into an army is an agent. The agent_subtypes table contains basic information about this specific subtype of agent.&lt;br /&gt;
&lt;br /&gt;
Here's the agent_subtypes table for our new chaos characters&lt;br /&gt;
&lt;br /&gt;
I know, theres a lot, but don't worry! Its not as hard as it looks and most of it is self explanatory&lt;br /&gt;
&lt;br /&gt;
* Key&lt;br /&gt;
** Key is well, the key of our agent subtype. This is a unique key that will be used to reference our agent from the db or scripts. This must be a unique key and if possible should match the main_unit key for your agent.&lt;br /&gt;
* Auto Generate&lt;br /&gt;
** Whether or not the game should automatically generate this character and add them to the character pool. Leave this unchecked for unique characters like Legendary Lords. Names will be generated from the factions name list. Starting traits have to be added to a list for each subtype. More on that later. For our characters, we are going to leave this checked, since we want the game to make generic versions of these characters&lt;br /&gt;
* Is Caster&lt;br /&gt;
** This just determines whether or not this character can use casting items.&lt;br /&gt;
* Small Icon&lt;br /&gt;
** The icon you'll see on the campaign map for this character. Lords have this icon overridden so you can leave it blank for them.&lt;br /&gt;
* Associated Unit Override&lt;br /&gt;
** The main_unit key associated with this character. You don't need a new subtype for each mount, only the base unit is needed here.&lt;br /&gt;
* Audio Voiceover Actor Group&lt;br /&gt;
** The voice that this character has on the campaign map. Battle voice actor is determined in main_units (yes, they can be different).&lt;br /&gt;
* Show in Ui&lt;br /&gt;
** Whether or not this character shows up in the recruitment panel. Set to false for Legendary Heroes like Cylostra's Damned Paladin or Wulfhart's unique hereos.&lt;br /&gt;
* Cap&lt;br /&gt;
** This is only used for Gotrek, Felix, Lord Kroak, and Henri le Massif. As far as I know it isn't needed even for Legendary Lords or unique heroes. Leave this as -1.&lt;br /&gt;
* Has Female Name&lt;br /&gt;
** Self Explanatory&lt;br /&gt;
* Can Gain Xp&lt;br /&gt;
** Self Explanatory&lt;br /&gt;
* Loyalty is Applicable&lt;br /&gt;
** This doesn't add your lord to the loyalty system, it only shows the loyalty icon above their banner and in their details panel. Loyalty is scripted, you must add your lords to the loyalty scripts to add them to the loyalty system&lt;br /&gt;
* Contributes to Agent Cap&lt;br /&gt;
** Whether or not this subtype takes up an agent slot. I set this to false for my unique Heroes, but you can leave it as true if you want. This should always be true for Lords.&lt;br /&gt;
* Recruitment Category&lt;br /&gt;
** As of the Warden and the Paunch, Lords now are separated into different groups like Heroes. This value determines which group your lord should be sorted into. Leave this blank for Heroes&lt;br /&gt;
* Magic Lore&lt;br /&gt;
** Used only for sorting Lords into categories under their respective Recruitment Category. Leave this blank for Heroes&lt;br /&gt;
* Audio Vo Culture Override&lt;br /&gt;
** Only Grom and the River Troll Hag use this. Just leave it blank&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== agent_uniforms ====&lt;br /&gt;
This one is simple, and you should have already done this when you went through the [https://steamcommunity.com/sharedfiles/filedetails/?id=1194811468 porthole process]. I won't go through it since this its pretty simple, just reference the variant key for your subtype (or for this variation, you need a uniform for each variant unless you want this hero type to all look the same).&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== campaign_character_art_sets ====&lt;br /&gt;
This table is one of two that determine your agent's campaign variant.&lt;br /&gt;
&lt;br /&gt;
* Art Set Id&lt;br /&gt;
** Unique ID for your character Art Set. This is needed for every variation of your subtype. Most vanilla agents have 2-5 different art sets (and subsequent uniforms/portholes). Our characters only have one each to make things easy.&lt;br /&gt;
* Is Custom&lt;br /&gt;
** Leave this false. Only a few unique characters like Kemmler and Mannfred use this and idk why&lt;br /&gt;
* Agent Type&lt;br /&gt;
** The agent type your subtype belongs to. Lords are all generals, heroes can be wizards, champions, spies, dignitaries, and engineers. There are others but they're deprecated&lt;br /&gt;
* Faction&lt;br /&gt;
** I'm pretty sure this is how you limit which faction this art set applies to, Lokhir is the only one I'm aware of that uses this. Best to leave this blank&lt;br /&gt;
* Culture&lt;br /&gt;
** Same as above, just follow a vanilla equivalent&lt;br /&gt;
* Subculture&lt;br /&gt;
** Again, same as above. Chaos Lords and Heroes use this column, so I did too. When in doubt do what CA does&lt;br /&gt;
* Is Male&lt;br /&gt;
** Leave this checked. Yes, even if your character is a girl.&lt;br /&gt;
* Agent Subtype&lt;br /&gt;
** Your agent_subtype key&lt;br /&gt;
* Campaign Map Scale&lt;br /&gt;
** Leave as 1&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== campaign_character_arts ====&lt;br /&gt;
&lt;br /&gt;
* Art Set Id&lt;br /&gt;
** Same as your art set Id from the above table&lt;br /&gt;
* Level&lt;br /&gt;
** Leave this as 0&lt;br /&gt;
* Season&lt;br /&gt;
** Leave this as none&lt;br /&gt;
* Age&lt;br /&gt;
** Leave this as 0&lt;br /&gt;
* Portrait&lt;br /&gt;
** Leave this blank&lt;br /&gt;
* Uniform&lt;br /&gt;
** The agent_uniform this character art uses&lt;br /&gt;
* Card&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Info&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Sea Uniform&lt;br /&gt;
** The ship you see on the campaign map when this agent embarks onto the water&lt;br /&gt;
* Navy Uniform&lt;br /&gt;
** Deprecated. Use the faction's default lord Navy Uniform&lt;br /&gt;
* Land Animation&lt;br /&gt;
** The animation your character uses on the campaign map. Must be a campaign animation, battle animations don't work here.&lt;br /&gt;
* Sea Animation&lt;br /&gt;
** The animation your ship uses on the water.&lt;br /&gt;
* Navy Animation&lt;br /&gt;
** again, deprecated, copy the vanilla Lord default value&lt;br /&gt;
* Id&lt;br /&gt;
** Unique ID for this character art. This must be a unique number.&lt;br /&gt;
* Religion&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Land Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
* Sea Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
* Navy Animation Vfx Filter&lt;br /&gt;
** Leave as 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== character_skill_node_sets_tables ====&lt;br /&gt;
This table connects your character skill node set to your subtype. Without this table, your character won't have any skills to use when they level up. I won't go through the basics of skills in this guide, [[Tutorial:Custom Skills, Items, and Effects|there already exists a guide for that]], but you will need this to fully flesh out your characters so I've added it.&lt;br /&gt;
&lt;br /&gt;
* Key&lt;br /&gt;
** Unique Key for this node set&lt;br /&gt;
* Faction Key&lt;br /&gt;
** Leave blank&lt;br /&gt;
* Campaign Key&lt;br /&gt;
** Leave Blank&lt;br /&gt;
* Agent Key&lt;br /&gt;
** The Agent type for you subtype. Yes, you have to specify it again. This isn't even the last time either.&lt;br /&gt;
* Subculture&lt;br /&gt;
** Leave Blank&lt;br /&gt;
* For Army&lt;br /&gt;
** Leave unchecked&lt;br /&gt;
* For Navy&lt;br /&gt;
** Leave unchecked&lt;br /&gt;
* Agent Subtype&lt;br /&gt;
** This will add this character node set to your agent subtype. All characters with this subtype will have the same skill node set. If you want your characters to have different skill node sets you need to make new subtypes&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== faction_agent_permitted_subtypes ====&lt;br /&gt;
This mess of a table is what adds your agent subtype to the faction of your choice. You have to add your subtype to every faction that will have access to the subtype.&lt;br /&gt;
&lt;br /&gt;
* Faction&lt;br /&gt;
** The faction that will now have access to this agent subtype&lt;br /&gt;
* Agent&lt;br /&gt;
** Yes, you have to specify this again. No, I don't know why&lt;br /&gt;
* Subtype&lt;br /&gt;
** Your agent subtype&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== agent_subtypes.loc ====&lt;br /&gt;
You should be familiar with loc files by now, this just specifies the name and description of your agent subtypes.&lt;br /&gt;
----And thats it! With those tables filled out, you've done everything you need to turn your unit into a recruitable character! Assuming you have your unit tables finished, you can now go into campaign and recruit your new Chaos Sorcerer Lord of Life.&lt;br /&gt;
&lt;br /&gt;
If it's crashing or your characters aren't showing up as recruitable, check that you filled out everything right, or [https://steamcommunity.com/sharedfiles/filedetails/?id=2137707555 use the example mod as a comparison].&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== Adding Agent Actions ===&lt;br /&gt;
But wait! What about our Chaos Sorcerer's campaign actions? How can we get our new campaign hero to assault units or assassinate a character?  &lt;br /&gt;
&lt;br /&gt;
Well, the campaign actions are added via skills, and we can just add a skill that CA already defined for us to our characters skill node set. But maybe we want our character to be a little more unique? &lt;br /&gt;
&lt;br /&gt;
Lets give them a different set of abilities, we'll need to create a new skill, which you can do by following [https://steamcommunity.com/sharedfiles/filedetails/?id=1696051257 this guide]. After you made a new skill and added it to the skill node set, lets add some agent actions to it in the character_skill_level_to_effects_junctions table:&lt;br /&gt;
&lt;br /&gt;
This is a copy of the vanilla wh2_main_skill_all_dummy_agent_actions_chs_sorcerer skill, but we want to make some changes, so lets replace the passive wh2_main_effect_agent_action_enable_wizard_hinder_settlement_steal_technology, which give our hero the ability to boost technolofy by attacking a settlement, and replace it with wh2_main_effect_agent_action_enable_wizard_hinder_settlement_damage_walls, which lets him damage the walls instead:&lt;br /&gt;
&lt;br /&gt;
Great! Now we have a hero who has a different set of campaign actions. Keep in mind you must use effects that apply to your agent type, if you want to add an agent action that doesn't exist already, you must make the agent action and effect to apply it. Lets go ahead and make a new agent action for the Chaos Sorcerer of Life. We'll give him the ability to assassinate, something normal wizards can't do in the base game. Here are the tables you'll need:&lt;br /&gt;
&lt;br /&gt;
* agent_actions&lt;br /&gt;
* effect_bonus_value_agent_action_record_junctions_tables&lt;br /&gt;
&lt;br /&gt;
I'm going to skip over the effect tables, you can make a new empty effect using [https://steamcommunity.com/sharedfiles/filedetails/?id=1761177338 this guide] if you want to follow along, otherwise, I'll assume you have your effect ready.&lt;br /&gt;
&lt;br /&gt;
==== agent_actions ====&lt;br /&gt;
This table is very convoluted and particularly finicky, you'll want to start with an agent action that already exists to avoid making mistakes. Lets start with the Exalted Hero's assassinate ability, defined as wh2_main_agent_action_champion_hinder_agent_assassinate&lt;br /&gt;
&lt;br /&gt;
in the agent_actions table.&lt;br /&gt;
&lt;br /&gt;
We're not going to change much here, just the Agent and the Unique Id. We'll copy this row from the CA data.pack into our mod, change Agent to wizard and Unique Id to chs_chaos_sorcerer_life_assassinate&lt;br /&gt;
&lt;br /&gt;
Now we can add the agent action to the effect_bonus_value_agent_action_record_junctions_table&lt;br /&gt;
&lt;br /&gt;
And finally add our effect to the chs_chaos_sorcerer_life_agent_actions skill we made&lt;br /&gt;
&lt;br /&gt;
And that's it! We now have a custom hero subtype that has a unique set of campaign actions!&lt;br /&gt;
&lt;br /&gt;
=== Legendary Lords and Heroes ===&lt;br /&gt;
Making Legendary Lords and Heroes is simple, plus you've already done most of the legwork. A guide on how to name them and spawn them on the campaign map is available [https://steamcommunity.com/sharedfiles/filedetails/?id=1695928423 here].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=305</id>
		<title>Example Scripts</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Example_Scripts&amp;diff=305"/>
		<updated>2021-03-29T17:44:17Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Set a space between the [[ of the example as it was getting picked up as a link and not as the symbols (as it should since you want to show how to comment in portuguese  moon)&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 [[Script logging|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;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Using_Mods&amp;diff=304</id>
		<title>Tutorial:Using Mods</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Using_Mods&amp;diff=304"/>
		<updated>2021-03-29T12:59:01Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: Finished the guide. I am not sure if my pictures and links work but we will see.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Before we begin ===&lt;br /&gt;
This guide explains how you to use mods. It has nothing to do with the actual creating part of modding. The KMM parts of this guide are recommended but not strictly neccesary. But like Gromby aptly says: https://media.discordapp.net/attachments/373745291289034765/569917924278796318/USEKMM.jpg?width=500&amp;amp;height=373 This guide is written with steam in mind, if you are an epic games user go to the end of the guide to find out what you need to do different.&lt;br /&gt;
&lt;br /&gt;
=== Setting up KMM ===&lt;br /&gt;
 == Installing KMM ==&lt;br /&gt;
  1) Download from: [https://github.com/Kaedrin/warhammer-mod-manager/releases/latest Kaedrin´s mod manager latest download]&lt;br /&gt;
  2) Unzip the folder in your Documents directory OR your Desktop. ANYWHERE except the game directories or anything related to Steam.&lt;br /&gt;
  3) Create a shortcut to Warhammer2MM.exe and put it on your Desktop&lt;br /&gt;
  4) If you need to set the shortcut to admin mode, right click the shortcut, go to properties, click Advanced, and turn on &amp;quot;Run as Administrator&amp;quot;&lt;br /&gt;
 == Setting up the paths ==&lt;br /&gt;
  * After you have installed it when you open it for the first time it will give you a popup about detecting your game paths. Just click accept and reopen KMM. KMM should already have detected all your TW games. You can check this by clicking on the &amp;quot;Game&amp;quot; header in KMM. The black names are the ones which it detected and you can choose. The grey names are the ones which would be possible but it either didn´t detect or you don´t own. KMM smells pirated TW games from miles away so if you pirated it it will also not work.&lt;br /&gt;
  * When clicking on the &amp;quot;Options&amp;quot; header you can set the paths for Mod Backups if you want KMM to backup your mods for you, PFM (switch to RPFM pls if you still use PFM) and RPFM (Rusted Packfile Manager the tool with which most of us create our mods). You can also force KMM to try to detect new game paths.&lt;br /&gt;
=== Downloading Mods ===&lt;br /&gt;
So downloading Mods is fairly simple. You begin by opening your steam client. Then you click on the &amp;quot;COMMUNITY&amp;quot; Header in your client. After this you should be seeing a tab with your last played games. If the TW game for which you want to download mods is not in that list then please click on the search bar to the right of the list and search for the game. Once you see the name of your game click on it. You are now in the community tab of the game. Now click on the &amp;quot;WORKSHOP&amp;quot; header in that Tab. Here´s a picture where I highlighted the different steps in case you didn´t understand what I was talking about: [[File:Downloading Mods|thumb]]&lt;br /&gt;
Now you search for the mods you want to use. Once you have found them you click on the subscribe button and Steam should start the download automatically.&lt;br /&gt;
=== Using KMM ===&lt;br /&gt;
Here´s a picture so you can understand my description better: &lt;br /&gt;
[[File:Using KMM|thumb]]&lt;br /&gt;
 == NR1: Options ==&lt;br /&gt;
  * &amp;quot;Use last profile&amp;quot; and &amp;quot;Highlight recent mods&amp;quot; are pretty self-explanatory and should in my opinion both be ticked.&lt;br /&gt;
  * &amp;quot;Backup Mods&amp;quot; and &amp;quot;Choose Backup Location&amp;quot; are still self-explanatory. Click on &amp;quot;Choose Backup Location&amp;quot; to choose where your backup should be saved and check &amp;quot;Backup Mods&amp;quot; to actually enable the Backup function.&lt;br /&gt;
  * &amp;quot;Choose PFM location&amp;quot; and &amp;quot;Choose RPFM location&amp;quot; is used to set the path to the respective manager. (Pls don´t use PFM thought instead use RPFM)&lt;br /&gt;
  * &amp;quot;Detect Game Installations&amp;quot; is used to retrigger the game detection if you have a new TW game you want to use mods for.&lt;br /&gt;
  * &amp;quot;Bypass CA launcher&amp;quot; does what it says when ticked and should always be ticked in my opinion.&lt;br /&gt;
  * &amp;quot;Bypass Conflict Detection&amp;quot; should be ticked unless you have a real need for it. But mostly you won´t.&lt;br /&gt;
 == NR2 and 2*: Profiles ==&lt;br /&gt;
  * You can make a new profile by enabling the mods you want in it and then naming it in the text field (2*) and click save and you have your new profile.&lt;br /&gt;
  * You can export your currently open profile via the &amp;quot;Profile&amp;quot; header (2). It will be saved as a txt file in the location you choose.&lt;br /&gt;
  * You can import a profile if you have the txt file for it. You do this via the &amp;quot;Profile&amp;quot; header (2). It will automatically only enable the mods you are subbed to and are in that profile and disable all others.&lt;br /&gt;
 == NR3: Game ==&lt;br /&gt;
  * You can see all games supported by KMM (grey names) and the ones which are supported and KMM detected (black names) when you click on the &amp;quot;Game&amp;quot; header.&lt;br /&gt;
 == NR4: Tips ==&lt;br /&gt;
  * Here you see some good tips and info for using KMM&lt;br /&gt;
 == NR5: Version ==&lt;br /&gt;
  * You can see the version you use in the top row and the latest version available under the headers. Make sure to always use the newest version.&lt;br /&gt;
 == NR6: Number of Mods ==&lt;br /&gt;
  * You can see how many mods you have enabled in the top, left of the tips and info section.&lt;br /&gt;
  * You can see the number of movie mods you have over the start button. Movie mods are always active regardless of if you activate them or not. So be aware of that. You can see which mods are movie mods by sorting via the &amp;quot;type column&amp;quot;.&lt;br /&gt;
  * You enable mods by checking the small box left of their name.&lt;br /&gt;
 == NR7: Launching and Refreshing ==&lt;br /&gt;
  * The refresh button over the launch button is used to refresh KMM if you downloaded any mods while KMM was open so KMM becomes aware of the new mods.&lt;br /&gt;
  * You launch the game by clicking on the launch button.&lt;br /&gt;
=== Enabling mods (CA/Vanilla Launcher) ===&lt;br /&gt;
So you have succesfully downloaded a mod. Congratz! But you have decided against using KMM. Well it´s not my part to judge...&lt;br /&gt;
You enable mods by starting your game like you normally do but before you click on the play button inside of the TW launcher you click on the &amp;quot;Mod Manager&amp;quot; header on the left right next to the &amp;quot;Game&amp;quot; and &amp;quot;Shop&amp;quot; header.&lt;br /&gt;
Then you should be in the CA mod manager. There you search through the list of mods and click on the grey bar on their left to enable them. They should then turn green. Once you have enabled all the mods you want to use you click on the big play button in the upper right. You now get a popup that lists all enabled mods. Look through them if you forgot to enable some and then accept the popup. Here´s another picture to simplify:&lt;br /&gt;
[[File:Enabling Mods|thumb]] Congrats! You now succesfully activated a mod!&lt;br /&gt;
=== Good Practices ===&lt;br /&gt;
 * Don´t change Loadorder! Only do this if you are aware of what you are doing there and even then only do this if you have a good reason!&lt;br /&gt;
 * If you have issues with mods try to fix them yourself first (I recommend Cataph´s excellent guide: [[Troubleshooting|Troubleshooting Guide]] ) and only if you have confirmed it is a problem with that particular mod contact the author. Most of us prefer Discord but Steam works as well.&lt;br /&gt;
 * Don´t be obnoxious. Almost all of us are doing Modding as a hobby and not as a job. So don´t spam &amp;quot;UPDATE PLS&amp;quot; for example. There might be a very good reason why we didn´t update our mod yet or we just didn´t have time yet. &lt;br /&gt;
=== Differences if you are using Epic Games instead of Steam ===&lt;br /&gt;
I have no idea as I don´t own a TW Game on Epic. But if you do and know what´s different for epic games then please fill in this section. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I’ll add more information later if people have questions or I forgot anything.&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Using_KMM.PNG&amp;diff=308</id>
		<title>File:Using KMM.PNG</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Using_KMM.PNG&amp;diff=308"/>
		<updated>2021-03-29T10:31:26Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Enabling_Mods.PNG&amp;diff=307</id>
		<title>File:Enabling Mods.PNG</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Enabling_Mods.PNG&amp;diff=307"/>
		<updated>2021-03-28T22:59:13Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Downloading_Mods.PNG&amp;diff=306</id>
		<title>File:Downloading Mods.PNG</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Downloading_Mods.PNG&amp;diff=306"/>
		<updated>2021-03-28T22:23:17Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Modding&amp;diff=302</id>
		<title>Modding</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Modding&amp;diff=302"/>
		<updated>2021-03-24T20:25:42Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modding, or creating [[mods]], is the act of modifying the game files in order to cause changes or create new behavior within the game. There's a lot that can be done with modding - this page seeks to be a clear outline of what modding is, what you can and cannot mod, and other important high-level concepts.&lt;br /&gt;
&lt;br /&gt;
If you're looking for [[installing mods]], check that page.&lt;br /&gt;
&lt;br /&gt;
And you can check the [[Tutorial:Main Page|modding tutorials]] page for a portal about various available, specific tutorials.&lt;br /&gt;
&lt;br /&gt;
== What's a Mod ==&lt;br /&gt;
A mod - short for &amp;quot;Modification&amp;quot; - can be anything user-created that edits the game in a meaningful way.&lt;br /&gt;
&lt;br /&gt;
In the Total War series, mods are composed of a single file - a .pack file - which contain all of the changes within that mod. Packs act like a .zip or .rar file, a compressed folder in a single file. Much of the vanilla game is composed of various CA-made pack files.&lt;br /&gt;
&lt;br /&gt;
Packs can contain a lot of various pieces, such as:&lt;br /&gt;
&lt;br /&gt;
* '''Data:''' One of the most-used parts of a mod is databasing. Total War uses database files, similar to spreadsheets, which can be used to change behavior and values, or add new objects to the game. This is used for much of the game, from units and their stats to the cost of buildings and much in between.&lt;br /&gt;
* '''Text:''' On top of that, text you see in the game - from the name of a lord to the flavour text of a skill - is done within packs, in .loc files. These files attach text to the database, and they can be used for translations as well!&lt;br /&gt;
* '''Assets:''' This is a wide topic - but much of the game can be edited through assets. Assets range from .png images scattered throughout the UI, to altered .dds files which are used on the various unit models in the game, to entirely new models or otherwise.&lt;br /&gt;
* '''Battle Maps:''' Battle maps are created through the Terry tool, from within the [[Assembly Kit]].&lt;br /&gt;
* '''Scripts:''' There's a layer of the game that can be interacted with through scripts (.lua files). Scripts power things such as characters getting experience, legendary lord defeat traits, and the Chaos Invasion - and much in between!&lt;br /&gt;
&lt;br /&gt;
There's natural limitations to modding the game, since the game is written in a way that cannot be decompiled easily - meaning much of the game code and engine is unreadable and untouchable. That said, Creative Assembly does a comparatively excellent job at making sure much of the game is exposed to being modified!&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
You've decided on a general mod idea you want to do, and you're ready to set aside some time to try, fail, try, fail, try and then inexplicably succeed the third time. This is the spot for you!&lt;br /&gt;
&lt;br /&gt;
First thing's first, before you go on, you need to grab the [https://github.com/Frodo45127/rpfm/releases/latest Rusted Pack File Manager], by Frodo. It's the primary tool available to create a .pack file, edit it, and manipulate it in whatever way, and comes with a lot of excellent functionality.&lt;br /&gt;
&lt;br /&gt;
Right after installing RPFM, you should decide on a folder on your computer that you'll store your mods. This'll be your primary directory for modding. For instance, I have S:/modding/ determined as my main spot on disk. Name it whatever you want, put it wherever you want.&lt;br /&gt;
&lt;br /&gt;
Then, within RPFM, open the Preferences menu (through Ctrl+P, or PackFile -&amp;gt; Preferences), and begin to set up the necessary preferences within. Target all of the folders for all installed Total War games, targeting the folder where the .exe of the game is. Underneath, in &amp;quot;MyMod's Folder&amp;quot;, fill in your new folder.&lt;br /&gt;
[[File:Screenshot 2021-01-31 205343.png|left|thumb|710x710px|Fill in your MyMod folder here!]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fill out whatever other preferences you may like, but most of this stuff you'll see through time. Keep &amp;quot;Allow Editing of CA PackFiles&amp;quot; to false, I prefer to have all of the checks valid on start, and of course the Use Dark Theme setting is an absolute must.&lt;br /&gt;
&lt;br /&gt;
With RPFM, we can do an absolute load of modding. I recommend [[Setting up GitHub|using GitHub]] for version and source control - it's saved me several dozen times when I almost certainly would've lost an entire mod, or gotten two versions (ie. an update version and the retail version) mixed up.&lt;br /&gt;
&lt;br /&gt;
You may also want to download the [[Assembly Kit]] for the game you're modding, as well as [https://www.microsoft.com/en-us/microsoft-365/excel Excel] or another spreadsheet program - it can come in hand a billion times over.&lt;br /&gt;
&lt;br /&gt;
With all of our tools set up, we can get [[First Mod|started on our first mod]]!&lt;br /&gt;
&lt;br /&gt;
== Guidelines ==&lt;br /&gt;
This is a list of hopefully helpful tips for modders - new or old.&lt;br /&gt;
&lt;br /&gt;
* '''Start small, build up.''' One of the oldest tricks in the book is having a tremendously bloated idea, trying to make it all at once, getting overwhelmed, and then quitting. We've literally all done it. Instead of trying to build a pyramid from the bottom up, try to build a glacier from the top down, starting with a simpler idea and continuing it naturally.&lt;br /&gt;
* '''Ask for help.''' The Total War modding community, especially that around the Modding Den Discord, is a big help - you're not in this alone.&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Modding&amp;diff=301</id>
		<title>Modding</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Modding&amp;diff=301"/>
		<updated>2021-03-24T20:08:35Z</updated>

		<summary type="html">&lt;p&gt;Fenriswolf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Modding, or creating [[mods]], is the act of modifying the game files in order to cause changes or create new behavior within the game. There's a lot that can be done with modding - this page seeks to be a clear outline of what modding is, what you can and cannot mod, and other important high-level concepts.&lt;br /&gt;
&lt;br /&gt;
If you're looking for [[installing mods]], check that page.&lt;br /&gt;
&lt;br /&gt;
And you can check the[[Tutorial:Main Page|modding tutorials]] page for a portal about various available, specific tutorials.&lt;br /&gt;
&lt;br /&gt;
== What's a Mod ==&lt;br /&gt;
A mod - short for &amp;quot;Modification&amp;quot; - can be anything user-created that edits the game in a meaningful way.&lt;br /&gt;
&lt;br /&gt;
In the Total War series, mods are composed of a single file - a .pack file - which contain all of the changes within that mod. Packs act like a .zip or .rar file, a compressed folder in a single file. Much of the vanilla game is composed of various CA-made pack files.&lt;br /&gt;
&lt;br /&gt;
Packs can contain a lot of various pieces, such as:&lt;br /&gt;
&lt;br /&gt;
* '''Data:''' One of the most-used parts of a mod is databasing. Total War uses database files, similar to spreadsheets, which can be used to change behavior and values, or add new objects to the game. This is used for much of the game, from units and their stats to the cost of buildings and much in between.&lt;br /&gt;
* '''Text:''' On top of that, text you see in the game - from the name of a lord to the flavour text of a skill - is done within packs, in .loc files. These files attach text to the database, and they can be used for translations as well!&lt;br /&gt;
* '''Assets:''' This is a wide topic - but much of the game can be edited through assets. Assets range from .png images scattered throughout the UI, to altered .dds files which are used on the various unit models in the game, to entirely new models or otherwise.&lt;br /&gt;
* '''Battle Maps:''' Battle maps are created through the Terry tool, from within the [[Assembly Kit]].&lt;br /&gt;
* '''Scripts:''' There's a layer of the game that can be interacted with through scripts (.lua files). Scripts power things such as characters getting experience, legendary lord defeat traits, and the Chaos Invasion - and much in between!&lt;br /&gt;
&lt;br /&gt;
There's natural limitations to modding the game, since the game is written in a way that cannot be decompiled easily - meaning much of the game code and engine is unreadable and untouchable. That said, Creative Assembly does a comparatively excellent job at making sure much of the game is exposed to being modified!&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
You've decided on a general mod idea you want to do, and you're ready to set aside some time to try, fail, try, fail, try and then inexplicably succeed the third time. This is the spot for you!&lt;br /&gt;
&lt;br /&gt;
First thing's first, before you go on, you need to grab the [https://github.com/Frodo45127/rpfm/releases/latest Rusted Pack File Manager], by Frodo. It's the primary tool available to create a .pack file, edit it, and manipulate it in whatever way, and comes with a lot of excellent functionality.&lt;br /&gt;
&lt;br /&gt;
Right after installing RPFM, you should decide on a folder on your computer that you'll store your mods. This'll be your primary directory for modding. For instance, I have S:/modding/ determined as my main spot on disk. Name it whatever you want, put it wherever you want.&lt;br /&gt;
&lt;br /&gt;
Then, within RPFM, open the Preferences menu (through Ctrl+P, or PackFile -&amp;gt; Preferences), and begin to set up the necessary preferences within. Target all of the folders for all installed Total War games, targeting the folder where the .exe of the game is. Underneath, in &amp;quot;MyMod's Folder&amp;quot;, fill in your new folder.&lt;br /&gt;
[[File:Screenshot 2021-01-31 205343.png|left|thumb|710x710px|Fill in your MyMod folder here!]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fill out whatever other preferences you may like, but most of this stuff you'll see through time. Keep &amp;quot;Allow Editing of CA PackFiles&amp;quot; to false, I prefer to have all of the checks valid on start, and of course the Use Dark Theme setting is an absolute must.&lt;br /&gt;
&lt;br /&gt;
With RPFM, we can do an absolute load of modding. I recommend [[Setting up GitHub|using GitHub]] for version and source control - it's saved me several dozen times when I almost certainly would've lost an entire mod, or gotten two versions (ie. an update version and the retail version) mixed up.&lt;br /&gt;
&lt;br /&gt;
You may also want to download the [[Assembly Kit]] for the game you're modding, as well as [https://www.microsoft.com/en-us/microsoft-365/excel Excel] or another spreadsheet program - it can come in hand a billion times over.&lt;br /&gt;
&lt;br /&gt;
With all of our tools set up, we can get [[First Mod|started on our first mod]]!&lt;br /&gt;
&lt;br /&gt;
== Guidelines ==&lt;br /&gt;
This is a list of hopefully helpful tips for modders - new or old.&lt;br /&gt;
&lt;br /&gt;
* '''Start small, build up.''' One of the oldest tricks in the book is having a tremendously bloated idea, trying to make it all at once, getting overwhelmed, and then quitting. We've literally all done it. Instead of trying to build a pyramid from the bottom up, try to build a glacier from the top down, starting with a simpler idea and continuing it naturally.&lt;br /&gt;
* '''Ask for help.''' The Total War modding community, especially that around the Modding Den Discord, is a big help - you're not in this alone.&lt;/div&gt;</summary>
		<author><name>Fenriswolf</name></author>
	</entry>
</feed>