<?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=Thesniperdevil</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=Thesniperdevil"/>
	<link rel="alternate" type="text/html" href="https://tw-modding.com/wiki/Special:Contributions/Thesniperdevil"/>
	<updated>2026-05-05T15:57:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://tw-modding.com/index.php?title=Effects&amp;diff=681</id>
		<title>Effects</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Effects&amp;diff=681"/>
		<updated>2023-06-10T16:41:14Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Whenever you pick a new skill for a character, or gain an item, or apply a banner to a unit, or build a building - you are getting and using effects.&lt;br /&gt;
&lt;br /&gt;
Effects are one of the most common game objects in all of Total War, and they drive a vast majority of any sort of dynamic/changing values throughout the game, and many game play systems. For example - the income from buildings is done through effects; attrition immunity is applied through effects; stat changes for units (ie. +Melee Attack for all archers) are done through effects.&lt;br /&gt;
&lt;br /&gt;
Learning how to create and alter effects is a fundamental part of being able to make meaningful edits to the game.&lt;br /&gt;
&lt;br /&gt;
NOTE: Written with R2/3K/WH2 in mind, this information should be valid from Empire to the present though. Please share if there are any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
=== The Effect Ecosystem: ===&lt;br /&gt;
Before we get into how to set up effect, lets take a quick look at how they are integrated into the game – at first glance, it can be a little overwhelming so lets just start simple and work our way up!&lt;br /&gt;
[[File:Effect tree.png|alt=A diagram showing the table relationship of effects|How an effect connects to the wider game.|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You define your effect in its own table.&lt;br /&gt;
&lt;br /&gt;
You can then define what it effects through the MANY effect_bonus_values_ tables, and the ones you use depend on what you want to use the effect on.&lt;br /&gt;
&lt;br /&gt;
Finally, you attach the effect to the “thing” in game that will apply it. There are two core ways of doing this.&lt;br /&gt;
&lt;br /&gt;
* Many systems in the game are built to apply effects through an effect bundle (literally a bundle of one or more effects that get applied in one go). It’s worth noting, this is the only method of applying effects via script.&lt;br /&gt;
* There are a good number of systems that forgoe effect bundles and hook up directly to the effect, skipping the need of an effect bundle, for example building levels or ancillaries.&lt;br /&gt;
&lt;br /&gt;
And that is largely it, in a nutshell!&lt;br /&gt;
&lt;br /&gt;
=== '''Anatomy of an effect:''' ===&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file.&lt;br /&gt;
[[File:Sample of the effects table.png|center|1024x1024px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table defines a few important things:&lt;br /&gt;
&lt;br /&gt;
* '''Key:''' This is the     unique key for this effect. Name it uniquely, and name it in a way so that     you can tell what it does! You will be referring to this a lot in other     tables.&lt;br /&gt;
* '''Icon | icon_negative:''' defines     the icon this effect will display when it’s having a positive effect and     negative effect.&lt;br /&gt;
* '''Description:''' This     is the text that will be displayed (note that you’re going to need to     define this in a.loc file in rPFM).&lt;br /&gt;
* '''Is_posititve_value_good:'''     This means that, if your value is a     positive integer and this bool is set to true, the text will show up as     green; if your value is negative and this bool is set to false, the text     will show up as red.&lt;br /&gt;
* '''Priority:''' 0 will     result in the effect being hidden. Otherwise, the higher the number, the     lower on a list the effect will be displayed in the UI.&lt;br /&gt;
* '''Category:'''  which determines where an effect shows up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the above table only creates the foundation for an effect, it’ll show up in the UI but nothing happens. Sometimes, this is all you may want, here are plenty of dummy effects in the game already that add a UI element to the game for things done in script!&lt;br /&gt;
&lt;br /&gt;
To make real change, we’re going to need to delve into the realm of effect_bonus_values, these allows us to hook up effects to bonus value ids, the games way to connect an effect to “stuff” in the game that the effect will impact.&lt;br /&gt;
&lt;br /&gt;
=== Bonus Value Ids: ===&lt;br /&gt;
Bonus value ids are essentially the way an effect modifies a given “thing”. Below you can see all the ways you can modify unit abilities with an effect. &lt;br /&gt;
[[File:Example bonus value ids.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot create a new bonus value id. Sorry. Just the way it is.&lt;br /&gt;
&lt;br /&gt;
With this in mind, don’t get too caught up with knowing all the Bonus Value Id’s. There are a lot of them and many of them will never show up in your modding activities, best to look at the ones tied to what you want to achieve and 99% of the time, you can just imitate what effects in the base game are already doing.&lt;br /&gt;
&lt;br /&gt;
=== Effect Bonus Value Tables: ===&lt;br /&gt;
OK, so we’re here! This is where we connect your effect to the bonus value and define the id to modify it! I’m afraid this is highly contextual and really depends on what it is you want to achieve. So I’m going to give a couple of examples to help demonstrate and hopefully that will be enough to get you started.&lt;br /&gt;
&lt;br /&gt;
==== Army Abilities: ====&lt;br /&gt;
Here you can see two effects one enables the usage of an army ability and another increases the charges of an army ability by one. This is defined in the effect_bonus_value_military_force_ability_junctions table.&lt;br /&gt;
[[File:Effect bonus value military force ability junctions example.png|center|1024x1024px|effect_bonus_value_military_force_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Units (sets): ====&lt;br /&gt;
Here you can see two effects that that give “barrier health”. One to the unit set that covers all skinks, the other to a unit set to all Saurus. &lt;br /&gt;
[[File:Effect bonus value unit set unit ability junctions tables.png|center|effect_bonus_value_ids_unit_sets_tables ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here you can see two effects that that give a redirect aura to the two same unit sets, but done in a different table. &lt;br /&gt;
[[File:Effect bonus value ids unit sets tables.png|center|effect_bonus_value_unit_set_unit_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Buildings: ====&lt;br /&gt;
And here, we can see two effects that modify the building set for high elf defences. One modifies the building cost, the other the build time. &lt;br /&gt;
[[File:Effect bonus value building set junctions tables.png|center|1024x1024px|effect_bonus_value_building_set_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Pooled Resources: ====&lt;br /&gt;
Note: to learn more about pooled resources, there is a dedicated [[Tutorial:Pooled Resources Updated|guide]] to them.&lt;br /&gt;
&lt;br /&gt;
In this example, you can see how two effects are set up to affect the dark elf slave pooled resource, one effect modifies the base amount and another is a percentage multiplier.&lt;br /&gt;
[[File:Effect bonus value pooled resource factor junctions table.png|center|978x978px|effect_bonus_value_pooled_resource_factor_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
===  ARCHIVE: ===&lt;br /&gt;
Below is part of old guide detailing how to set up effect bundles.&lt;br /&gt;
&lt;br /&gt;
==== Applying an Effect ====&lt;br /&gt;
From here, the effect ''works'' and is a beautiful machination, but it doesn't do anything since it isn't applied anywhere. In order to take hold, it needs to be attached into an &amp;lt;code&amp;gt;effect_bundle&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Effect bundles are another fairly common data object, and their name is pretty much their definition - they're a nice lil' package of effects. There are two types of effect_bundles - explicit, and implicit. Explicit effect bundles are defined in the table &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, and then those effect bundles can be applied through a variety of means. Implicit effect bundles are created when another effect-bundling table is used - for instance, &amp;lt;code&amp;gt;building_effects_junction&amp;lt;/code&amp;gt;. This table defines a list of effects that attach to a building, which are then '''bundled up''' in the game, thus implicitly.&lt;br /&gt;
&lt;br /&gt;
Looking first at explicit effect_bundles - you would first define the effect_bundle key in &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, which again is primarily UI information. However - there's an important bit of data in this table too, that we'll have to return to later. The &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; column is very important, as it plays a big role in a future bit that we'll cover soon. It's mostly common sense here - if the effect bundle is going to be applied to a character via an ancillary, use the &amp;lt;code&amp;gt;character&amp;lt;/code&amp;gt; bundle_target. If it's applied to an army through a stance, use the &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt; bundle_target. This is the game object that '''has''' the effect_bundle, and the effects will be applied ''from'' that object.&lt;br /&gt;
&lt;br /&gt;
From there, the next jump for making an explicit effect_bundle is the table &amp;lt;code&amp;gt;effect_bundles_to_effects_junctions&amp;lt;/code&amp;gt;. You'll never guess what it does!&lt;br /&gt;
&lt;br /&gt;
First off the bat, we have the &amp;lt;code&amp;gt;effect_bundle_key&amp;lt;/code&amp;gt; - self-explanatory. Same with &amp;lt;code&amp;gt;effect_key&amp;lt;/code&amp;gt; and, I assume, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If you're editing a numerical bonus_value - like, editing a stat - it'll just be whatever number you want to add to the stat. If you're applying some stranger effect - like attrition immunity - that doesn't use actually numbers, you'll either use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for &amp;quot;deactivate&amp;quot;, or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for &amp;quot;activate&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; is where it gets really important. Effect_scopes are defined in data, and new ones can be made - and, sometimes, are needed. Effect_scopes are composed of ''source'' and a ''target''. The '''source''' of an effect_scope will have to be the &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; defined in the effect_bundle earlier - you're applying an effect '''from''' the bundle_target's effect_bundle to something else. For example, if you wanted to add charge bonus on a character through an ancillary, you would just use the &amp;lt;code&amp;gt;character_to_character_own&amp;lt;/code&amp;gt; effect_scope - since the character has the ''effect_bundle'' and will receive the ''effect''.&lt;br /&gt;
&lt;br /&gt;
One more very important note - '''not every effect works with every effect target.''' You can't assign a charge_bonus to a &amp;lt;code&amp;gt;faction&amp;lt;/code&amp;gt;, for instance. That just doesn't make sense. 90% of the time, you can find which game objects are valid targets in the bonus value definitions (&amp;lt;code&amp;gt;campaign_bonus_value_ids_xxxxx&amp;lt;/code&amp;gt;), in the notes column. They'll say something like &amp;quot;used at character bonuses&amp;quot;, which means it's only applicable to a character. On the 10% that aren't noted in that table, you can typically find examples in vanilla for what you want to do, and you can copy what they do.&lt;br /&gt;
&lt;br /&gt;
Implicit effect_bundles are much the same - just without defining the effect_bundle on its own, and its bundle_target. This means the &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; column doesn't have a predefined effect source, so you will need to be slightly more aware of what you're using. Again, check vanilla examples as much as you can.&lt;br /&gt;
&lt;br /&gt;
Aside from using the aforementioned data structures, you can script some effect bundles as well. You can use a Lua script to apply (or remove) an explicit effect_bundle from a bundle_target - though mind it won't work for implicit effect_bundles.&lt;br /&gt;
&lt;br /&gt;
For Warhammer 2 - you can read up [https://chadvandy.github.io/tw_modding_resources/campaign/campaign_manager.html#section:campaign_manager:Effect%20Bundles here]. The same general commands should exist in all other games, with the biggest difference lying in Three Kingdoms.&lt;br /&gt;
&lt;br /&gt;
Likewise, Warhammer 2 got a GREAT new ability to completely change explicit effect_bundles dynamically while the game is going on. Instead of defining a dozen different effect bundles with 12 different values for the same effect, you can make one effect_bundle, and change its effect value dynamically. [[Custom Effect Bundles|Read up more on it here]].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;br /&gt;
[[Category:Rome 2]]&lt;br /&gt;
[[Category:Three Kingdoms]]&lt;br /&gt;
[[Category:Troy]]&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Effects&amp;diff=680</id>
		<title>Effects</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Effects&amp;diff=680"/>
		<updated>2023-06-10T16:38:42Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Whenever you pick a new skill for a character, or gain an item, or apply a banner to a unit, or build a building - you are getting and using effects.&lt;br /&gt;
&lt;br /&gt;
Effects are one of the most common game objects in all of Total War, and they drive a vast majority of any sort of dynamic/changing values throughout the game, and many game play systems. For example - the income from buildings is done through effects; attrition immunity is applied through effects; stat changes for units (ie. +Melee Attack for all archers) are done through effects.&lt;br /&gt;
&lt;br /&gt;
Learning how to create and alter effects is a fundamental part of being able to make meaningful edits to the game.&lt;br /&gt;
&lt;br /&gt;
NOTE: Written with R2/3K/WH2 in mind, this information should be valid from Empire to the present though. Please share if there are any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
=== The Effect Ecosystem: ===&lt;br /&gt;
Before we get into how to set up effect, lets take a quick look at how they are integrated into the game – at first glance, it can be a little overwhelming so lets just start simple and work our way up!&lt;br /&gt;
[[File:Effect tree.png|alt=A diagram showing the table relationship of effects|How an effect connects to the wider game.|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You define your effect in its own table.&lt;br /&gt;
&lt;br /&gt;
You can then define what it effects through the MANY effect_bonus_values_ tables, and the ones you use depend on what you want to use the effect on.&lt;br /&gt;
&lt;br /&gt;
Finally, you attach the effect to the “thing” in game that will apply it. There are two core ways of doing this.&lt;br /&gt;
&lt;br /&gt;
* Many systems in the game are built to apply effects through an effect bundle (literally a bundle of one or more effects that get applied in one go). It’s worth noting, this is the only method of applying effects via script.&lt;br /&gt;
* There are a good number of systems that forgoe effect bundles and hook up directly to the effect, skipping the need of an effect bundle, for example building levels or ancillaries.&lt;br /&gt;
&lt;br /&gt;
And that is largely it, in a nutshell!&lt;br /&gt;
&lt;br /&gt;
=== '''Anatomy of an effect:''' ===&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file.&lt;br /&gt;
[[File:Sample of the effects table.png|center|1024x1024px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table defines a few important things:&lt;br /&gt;
&lt;br /&gt;
* '''Key:''' This is the     unique key for this effect. Name it uniquely, and name it in a way so that     you can tell what it does! You will be referring to this a lot in other     tables.&lt;br /&gt;
* '''Icon | icon_negative:''' defines     the icon this effect will display when it’s having a positive effect and     negative effect.&lt;br /&gt;
* '''Description:''' This     is the text that will be displayed (note that you’re going to need to     define this in a.loc file in rPFM).&lt;br /&gt;
* '''Is_posititve_value_good:'''     This means that, if your value is a     positive integer and this bool is set to true, the text will show up as     green; if your value is negative and this bool is set to false, the text     will show up as red.&lt;br /&gt;
* '''Priority:''' 0 will     result in the effect being hidden. Otherwise, the higher the number, the     lower on a list the effect will be displayed in the UI.&lt;br /&gt;
* '''Category:'''  which determines where an effect shows up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the above table only creates the foundation for an effect, it’ll show up in the UI but nothing happens. Sometimes, this is all you may want, here are plenty of dummy effects in the game already that add a UI element to the game for things done in script!&lt;br /&gt;
&lt;br /&gt;
To make real change, we’re going to need to delve into the realm of effect_bonus_values, these allows us to hook up effects to bonus value ids, the games way to connect an effect to “stuff” in the game that the effect will impact.&lt;br /&gt;
&lt;br /&gt;
=== Bonus Value Ids: ===&lt;br /&gt;
Bonus value ids are essentially the way an effect modifies a given “thing”. Below you can see all the ways you can modify unit abilities with an effect. &lt;br /&gt;
[[File:Example bonus value ids.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot create a new bonus value id. Sorry. Just the way it is.&lt;br /&gt;
&lt;br /&gt;
With this in mind, don’t get too caught up with knowing all the Bonus Value Id’s. There are a lot of them and many of them will never show up in your modding activities, best to look at the ones tied to what you want to achieve and 99% of the time, you can just imitate what effects in the base game are already doing.&lt;br /&gt;
&lt;br /&gt;
=== Effect Bonus Value Tables: ===&lt;br /&gt;
OK, so we’re here! This is where we connect your effect to the bonus value and define the id to modify it! I’m afraid this is highly contextual and really depends on what it is you want to achieve. So I’m going to give a couple of examples to help demonstrate and hopefully that will be enough to get you started.&lt;br /&gt;
&lt;br /&gt;
==== Army Abilities: ====&lt;br /&gt;
Here you can see two effects one enables the usage of an army ability and another increases the charges of an army ability by one. This is defined in the effect_bonus_value_military_force_ability_junctions table.&lt;br /&gt;
[[File:Effect bonus value military force ability junctions example.png|center|1024x1024px|effect_bonus_value_military_force_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Units (sets): ====&lt;br /&gt;
Here you can see two effects that that give “barrier health”. One to the unit set that covers all skinks, the other to a unit set to all Saurus. &lt;br /&gt;
[[File:Effect bonus value unit set unit ability junctions tables.png|center|effect_bonus_value_ids_unit_sets_tables ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here you can see two effects that that give a redirect aura to the two same unit sets, but done in a different table. &lt;br /&gt;
[[File:Effect bonus value ids unit sets tables.png|center|effect_bonus_value_unit_set_unit_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Buildings: ====&lt;br /&gt;
And here, we can see two effects that modify the building set for high elf defences. One modifies the building cost, the other the build time. &lt;br /&gt;
[[File:Effect bonus value building set junctions tables.png|center|1024x1024px|effect_bonus_value_building_set_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Pooled Resources: ====&lt;br /&gt;
Note: to learn more about pooled resources, there is a dedicated [[Tutorial:Pooled Resources Updated|guide]] to them.&lt;br /&gt;
&lt;br /&gt;
In this example, you can see how two effects are set up to affect the dark elf slave pooled resource, one effect modifies the base amount and another is a percentage multiplier.&lt;br /&gt;
[[File:Effect bonus value pooled resource factor junctions table.png|center|978x978px|effect_bonus_value_pooled_resource_factor_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
===  ARCHIVE: ===&lt;br /&gt;
Below is the old guide. I didn't want to delete it.&lt;br /&gt;
&lt;br /&gt;
==== Anatomy of an Effect ====&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file. This table defines a few important things - the '''key''' of the effect, to link it up to other data objects and the localised text. It will also define some UI details here, typical - such as '''icon''', '''priority''' (which determines the order effects show up, or whether it is hidden from view with 0), and the '''category''', which determines where an effect shows up on a Character Details panel for example. Also mind the boolean in here, '''positive_is_good'''. This means that, if your value is a positive integer and this bool is set to true, the text will show up as green; if your value is negative and this bool is set to false, the text will show up as red.&lt;br /&gt;
&lt;br /&gt;
An effect defined in just this table has no, well, effect - it has to be linked to another game object called &amp;lt;code&amp;gt;bonus_values&amp;lt;/code&amp;gt;. Bonus values are the game object that ''actually do a thing.'' Effects just enable those bonus values to be applied elsewhere. Bonus values can do a bunch, from increasing recruited lords' ranks, to adding charge bonus to a unit set, and far beyond, varying greatly based on the individual game. It's important to note here: '''no, you can't make new bonus_values.''' They are defined in the underlying game engine, and have code attached to them that actually make stuff happen. You can only use existing bonus_values, ever.&lt;br /&gt;
&lt;br /&gt;
The bonus_values are defined in data in dummy tables called &amp;lt;code&amp;gt;campaign_bonus_value_ids_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. For instance, the &amp;lt;code&amp;gt;basic&amp;lt;/code&amp;gt; bonus_values are found in the tables &amp;lt;code&amp;gt;campaign_bonus_value_ids_basic&amp;lt;/code&amp;gt;. Do note that you won't find these tables in RPFM; they're dummy tables, meaning they're not actually used to build data in the game and can't be edited.&lt;br /&gt;
&lt;br /&gt;
The links between an effect is defined in tables called &amp;lt;code&amp;gt;effect_bonus_value_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. These tables are typically either two or three columns - you link an effect key to the bonus_value dummy key, and a potential third piece of data needed for the effect. For instance, &amp;lt;code&amp;gt;effect_bonus_value_ids_unit_sets&amp;lt;/code&amp;gt; has three columns - &amp;lt;code&amp;gt;effect&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bonus_value_id&amp;lt;/code&amp;gt; which defines WHAT'S being edited (upkeep, charge bonus, etc), and &amp;lt;code&amp;gt;unit_set&amp;lt;/code&amp;gt; which defines which units get this effect.&lt;br /&gt;
&lt;br /&gt;
However, not every effect ''needs'' a bonus value - it's fairly common to make a &amp;quot;dummy&amp;quot; effect, which is just UI and text, but doesn't actually have any bonus_values attached to it. This could be desired to make some clear UX about a functionality that is done through script or some other data object.&lt;br /&gt;
&lt;br /&gt;
==== Applying an Effect ====&lt;br /&gt;
From here, the effect ''works'' and is a beautiful machination, but it doesn't do anything since it isn't applied anywhere. In order to take hold, it needs to be attached into an &amp;lt;code&amp;gt;effect_bundle&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Effect bundles are another fairly common data object, and their name is pretty much their definition - they're a nice lil' package of effects. There are two types of effect_bundles - explicit, and implicit. Explicit effect bundles are defined in the table &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, and then those effect bundles can be applied through a variety of means. Implicit effect bundles are created when another effect-bundling table is used - for instance, &amp;lt;code&amp;gt;building_effects_junction&amp;lt;/code&amp;gt;. This table defines a list of effects that attach to a building, which are then '''bundled up''' in the game, thus implicitly.&lt;br /&gt;
&lt;br /&gt;
Looking first at explicit effect_bundles - you would first define the effect_bundle key in &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, which again is primarily UI information. However - there's an important bit of data in this table too, that we'll have to return to later. The &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; column is very important, as it plays a big role in a future bit that we'll cover soon. It's mostly common sense here - if the effect bundle is going to be applied to a character via an ancillary, use the &amp;lt;code&amp;gt;character&amp;lt;/code&amp;gt; bundle_target. If it's applied to an army through a stance, use the &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt; bundle_target. This is the game object that '''has''' the effect_bundle, and the effects will be applied ''from'' that object.&lt;br /&gt;
&lt;br /&gt;
From there, the next jump for making an explicit effect_bundle is the table &amp;lt;code&amp;gt;effect_bundles_to_effects_junctions&amp;lt;/code&amp;gt;. You'll never guess what it does!&lt;br /&gt;
&lt;br /&gt;
First off the bat, we have the &amp;lt;code&amp;gt;effect_bundle_key&amp;lt;/code&amp;gt; - self-explanatory. Same with &amp;lt;code&amp;gt;effect_key&amp;lt;/code&amp;gt; and, I assume, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If you're editing a numerical bonus_value - like, editing a stat - it'll just be whatever number you want to add to the stat. If you're applying some stranger effect - like attrition immunity - that doesn't use actually numbers, you'll either use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for &amp;quot;deactivate&amp;quot;, or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for &amp;quot;activate&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; is where it gets really important. Effect_scopes are defined in data, and new ones can be made - and, sometimes, are needed. Effect_scopes are composed of ''source'' and a ''target''. The '''source''' of an effect_scope will have to be the &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; defined in the effect_bundle earlier - you're applying an effect '''from''' the bundle_target's effect_bundle to something else. For example, if you wanted to add charge bonus on a character through an ancillary, you would just use the &amp;lt;code&amp;gt;character_to_character_own&amp;lt;/code&amp;gt; effect_scope - since the character has the ''effect_bundle'' and will receive the ''effect''.&lt;br /&gt;
&lt;br /&gt;
One more very important note - '''not every effect works with every effect target.''' You can't assign a charge_bonus to a &amp;lt;code&amp;gt;faction&amp;lt;/code&amp;gt;, for instance. That just doesn't make sense. 90% of the time, you can find which game objects are valid targets in the bonus value definitions (&amp;lt;code&amp;gt;campaign_bonus_value_ids_xxxxx&amp;lt;/code&amp;gt;), in the notes column. They'll say something like &amp;quot;used at character bonuses&amp;quot;, which means it's only applicable to a character. On the 10% that aren't noted in that table, you can typically find examples in vanilla for what you want to do, and you can copy what they do.&lt;br /&gt;
&lt;br /&gt;
Implicit effect_bundles are much the same - just without defining the effect_bundle on its own, and its bundle_target. This means the &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; column doesn't have a predefined effect source, so you will need to be slightly more aware of what you're using. Again, check vanilla examples as much as you can.&lt;br /&gt;
&lt;br /&gt;
Aside from using the aforementioned data structures, you can script some effect bundles as well. You can use a Lua script to apply (or remove) an explicit effect_bundle from a bundle_target - though mind it won't work for implicit effect_bundles.&lt;br /&gt;
&lt;br /&gt;
For Warhammer 2 - you can read up [https://chadvandy.github.io/tw_modding_resources/campaign/campaign_manager.html#section:campaign_manager:Effect%20Bundles here]. The same general commands should exist in all other games, with the biggest difference lying in Three Kingdoms.&lt;br /&gt;
&lt;br /&gt;
Likewise, Warhammer 2 got a GREAT new ability to completely change explicit effect_bundles dynamically while the game is going on. Instead of defining a dozen different effect bundles with 12 different values for the same effect, you can make one effect_bundle, and change its effect value dynamically. [[Custom Effect Bundles|Read up more on it here]].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;br /&gt;
[[Category:Rome 2]]&lt;br /&gt;
[[Category:Three Kingdoms]]&lt;br /&gt;
[[Category:Troy]]&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Effects&amp;diff=679</id>
		<title>Effects</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Effects&amp;diff=679"/>
		<updated>2023-06-10T16:37:01Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Whenever you pick a new skill for a character, or gain an item, or apply a banner to a unit, or build a building - you are getting and using effects.&lt;br /&gt;
&lt;br /&gt;
Effects are one of the most common game objects in all of Total War, and they drive a vast majority of any sort of dynamic/changing values throughout the game, and many game play systems. For example - the income from buildings is done through effects; attrition immunity is applied through effects; stat changes for units (ie. +Melee Attack for all archers) are done through effects.&lt;br /&gt;
&lt;br /&gt;
Learning how to create and alter effects is a fundamental part of being able to make meaningful edits to the game.&lt;br /&gt;
&lt;br /&gt;
NOTE: Written with R2/3K/WH2 in mind, this information should be valid from Empire to the present though. Please share if there are any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
=== The Effect Ecosystem: ===&lt;br /&gt;
Before we get into how to set up effect, lets take a quick look at how they are integrated into the game – at first glance, it can be a little overwhelming so lets just start simple and work our way up!&lt;br /&gt;
[[File:Effect tree.png|alt=A diagram showing the table relationship of effects|How an effect connects to the wider game.|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You define your effect in its own table.&lt;br /&gt;
&lt;br /&gt;
You can then define what it effects through the MANY effect_bonus_values_ tables, and the ones you use depend on what you want to use the effect on.&lt;br /&gt;
&lt;br /&gt;
Finally, you attach the effect to the “thing” in game that will apply it. There are two core ways of doing this.&lt;br /&gt;
&lt;br /&gt;
* Many systems in the game are built to apply effects through an effect bundle (literally a bundle of one or more effects that get applied in one go). It’s worth noting, this is the only method of applying effects via script.&lt;br /&gt;
* There are a good number of systems that forgoe effect bundles and hook up directly to the effect, skipping the need of an effect bundle, for example building levels or ancillaries.&lt;br /&gt;
&lt;br /&gt;
And that is largely it, in a nutshell!&lt;br /&gt;
&lt;br /&gt;
=== '''Anatomy of an effect:''' ===&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file.&lt;br /&gt;
[[File:Sample of the effects table.png|center|1024x1024px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table defines a few important things:&lt;br /&gt;
&lt;br /&gt;
* '''Key:''' This is the     unique key for this effect. Name it uniquely, and name it in a way so that     you can tell what it does! You will be referring to this a lot in other     tables.&lt;br /&gt;
* '''Icon | icon_negative:''' defines     the icon this effect will display when it’s having a positive effect and     negative effect.&lt;br /&gt;
* '''Description:''' This     is the text that will be displayed (note that you’re going to need to     define this in a.loc file in rPFM).&lt;br /&gt;
* '''Is_posititve_value_good:'''     This means that, if your value is a     positive integer and this bool is set to true, the text will show up as     green; if your value is negative and this bool is set to false, the text     will show up as red.&lt;br /&gt;
* '''Priority:''' 0 will     result in the effect being hidden. Otherwise, the higher the number, the     lower on a list the effect will be displayed in the UI.&lt;br /&gt;
* '''Category:'''  which determines where an effect shows up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the above table only creates the foundation for an effect, it’ll show up in the UI but nothing happens. Sometimes, this is all you may want, here are plenty of dummy effects in the game already that add a UI element to the game for things done in script!&lt;br /&gt;
&lt;br /&gt;
To make real change, we’re going to need to delve into the realm of effect_bonus_values, these allows us to hook up effects to bonus value ids, the games way to connect an effect to “stuff” in the game that the effect will impact.&lt;br /&gt;
&lt;br /&gt;
=== Bonus Value Ids: ===&lt;br /&gt;
Bonus value ids are essentially the way an effect modifies a given “thing”. Below you can see all the ways you can modify unit abilities with an effect. &lt;br /&gt;
[[File:Example bonus value ids.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot create a new bonus value id. Sorry. Just the way it is.&lt;br /&gt;
&lt;br /&gt;
With this in mind, don’t get too caught up with knowing all the Bonus Value Id’s. There are a lot of them and many of them will never show up in your modding activities, best to look at the ones tied to what you want to achieve and 99% of the time, you can just imitate what effects in the base game are already doing.&lt;br /&gt;
&lt;br /&gt;
=== Effect Bonus Value Tables: ===&lt;br /&gt;
OK, so we’re here! This is where we connect your effect to the bonus value and define the id to modify it! I’m afraid this is highly contextual and really depends on what it is you want to achieve. So I’m going to give a couple of examples to help demonstrate and hopefully that will be enough to get you started.&lt;br /&gt;
&lt;br /&gt;
==== Army Abilities: ====&lt;br /&gt;
Here you can see two effects one enables the usage of an army ability and another increases the charges of an army ability by one. This is defined in the effect_bonus_value_military_force_ability_junctions table.&lt;br /&gt;
[[File:Effect bonus value military force ability junctions example.png|center|1024x1024px|effect_bonus_value_military_force_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Units (sets): ====&lt;br /&gt;
Here you can see two effects that that give “barrier health”. One to the unit set that covers all skinks, the other to a unit set to all Saurus. &lt;br /&gt;
[[File:Effect bonus value unit set unit ability junctions tables.png|center|effect_bonus_value_ids_unit_sets_tables ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here you can see two effects that that give a redirect aura to the two same unit sets, but done in a different table. &lt;br /&gt;
[[File:Effect bonus value ids unit sets tables.png|center|effect_bonus_value_unit_set_unit_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Buildings: ====&lt;br /&gt;
And here, we can see two effects that modify the building set for high elf defences. One modifies the building cost, the other the build time. &lt;br /&gt;
[[File:Effect bonus value building set junctions tables.png|center|1024x1024px|effect_bonus_value_building_set_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Pooled Resources: ====&lt;br /&gt;
Note: to learn more about pooled resources, there is a dedicated [[Tutorial:Pooled Resources Updated|guide]] to them.&lt;br /&gt;
&lt;br /&gt;
In this example, you can see how two effects are set up to affect the dark elf slave pooled resource, one effect modifies the base amount and another is a percentage multiplier.&lt;br /&gt;
[[File:Effect bonus value pooled resource factor junctions table.png|center|978x978px|effect_bonus_value_pooled_resource_factor_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ARCHIVE:&lt;br /&gt;
&lt;br /&gt;
Below is the old guide. I didn't want to delete it.&lt;br /&gt;
&lt;br /&gt;
==== Anatomy of an Effect ====&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file. This table defines a few important things - the '''key''' of the effect, to link it up to other data objects and the localised text. It will also define some UI details here, typical - such as '''icon''', '''priority''' (which determines the order effects show up, or whether it is hidden from view with 0), and the '''category''', which determines where an effect shows up on a Character Details panel for example. Also mind the boolean in here, '''positive_is_good'''. This means that, if your value is a positive integer and this bool is set to true, the text will show up as green; if your value is negative and this bool is set to false, the text will show up as red.&lt;br /&gt;
&lt;br /&gt;
An effect defined in just this table has no, well, effect - it has to be linked to another game object called &amp;lt;code&amp;gt;bonus_values&amp;lt;/code&amp;gt;. Bonus values are the game object that ''actually do a thing.'' Effects just enable those bonus values to be applied elsewhere. Bonus values can do a bunch, from increasing recruited lords' ranks, to adding charge bonus to a unit set, and far beyond, varying greatly based on the individual game. It's important to note here: '''no, you can't make new bonus_values.''' They are defined in the underlying game engine, and have code attached to them that actually make stuff happen. You can only use existing bonus_values, ever.&lt;br /&gt;
&lt;br /&gt;
The bonus_values are defined in data in dummy tables called &amp;lt;code&amp;gt;campaign_bonus_value_ids_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. For instance, the &amp;lt;code&amp;gt;basic&amp;lt;/code&amp;gt; bonus_values are found in the tables &amp;lt;code&amp;gt;campaign_bonus_value_ids_basic&amp;lt;/code&amp;gt;. Do note that you won't find these tables in RPFM; they're dummy tables, meaning they're not actually used to build data in the game and can't be edited.&lt;br /&gt;
&lt;br /&gt;
The links between an effect is defined in tables called &amp;lt;code&amp;gt;effect_bonus_value_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. These tables are typically either two or three columns - you link an effect key to the bonus_value dummy key, and a potential third piece of data needed for the effect. For instance, &amp;lt;code&amp;gt;effect_bonus_value_ids_unit_sets&amp;lt;/code&amp;gt; has three columns - &amp;lt;code&amp;gt;effect&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bonus_value_id&amp;lt;/code&amp;gt; which defines WHAT'S being edited (upkeep, charge bonus, etc), and &amp;lt;code&amp;gt;unit_set&amp;lt;/code&amp;gt; which defines which units get this effect.&lt;br /&gt;
&lt;br /&gt;
However, not every effect ''needs'' a bonus value - it's fairly common to make a &amp;quot;dummy&amp;quot; effect, which is just UI and text, but doesn't actually have any bonus_values attached to it. This could be desired to make some clear UX about a functionality that is done through script or some other data object.&lt;br /&gt;
&lt;br /&gt;
==== Applying an Effect ====&lt;br /&gt;
From here, the effect ''works'' and is a beautiful machination, but it doesn't do anything since it isn't applied anywhere. In order to take hold, it needs to be attached into an &amp;lt;code&amp;gt;effect_bundle&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Effect bundles are another fairly common data object, and their name is pretty much their definition - they're a nice lil' package of effects. There are two types of effect_bundles - explicit, and implicit. Explicit effect bundles are defined in the table &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, and then those effect bundles can be applied through a variety of means. Implicit effect bundles are created when another effect-bundling table is used - for instance, &amp;lt;code&amp;gt;building_effects_junction&amp;lt;/code&amp;gt;. This table defines a list of effects that attach to a building, which are then '''bundled up''' in the game, thus implicitly.&lt;br /&gt;
&lt;br /&gt;
Looking first at explicit effect_bundles - you would first define the effect_bundle key in &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, which again is primarily UI information. However - there's an important bit of data in this table too, that we'll have to return to later. The &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; column is very important, as it plays a big role in a future bit that we'll cover soon. It's mostly common sense here - if the effect bundle is going to be applied to a character via an ancillary, use the &amp;lt;code&amp;gt;character&amp;lt;/code&amp;gt; bundle_target. If it's applied to an army through a stance, use the &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt; bundle_target. This is the game object that '''has''' the effect_bundle, and the effects will be applied ''from'' that object.&lt;br /&gt;
&lt;br /&gt;
From there, the next jump for making an explicit effect_bundle is the table &amp;lt;code&amp;gt;effect_bundles_to_effects_junctions&amp;lt;/code&amp;gt;. You'll never guess what it does!&lt;br /&gt;
&lt;br /&gt;
First off the bat, we have the &amp;lt;code&amp;gt;effect_bundle_key&amp;lt;/code&amp;gt; - self-explanatory. Same with &amp;lt;code&amp;gt;effect_key&amp;lt;/code&amp;gt; and, I assume, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If you're editing a numerical bonus_value - like, editing a stat - it'll just be whatever number you want to add to the stat. If you're applying some stranger effect - like attrition immunity - that doesn't use actually numbers, you'll either use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for &amp;quot;deactivate&amp;quot;, or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for &amp;quot;activate&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; is where it gets really important. Effect_scopes are defined in data, and new ones can be made - and, sometimes, are needed. Effect_scopes are composed of ''source'' and a ''target''. The '''source''' of an effect_scope will have to be the &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; defined in the effect_bundle earlier - you're applying an effect '''from''' the bundle_target's effect_bundle to something else. For example, if you wanted to add charge bonus on a character through an ancillary, you would just use the &amp;lt;code&amp;gt;character_to_character_own&amp;lt;/code&amp;gt; effect_scope - since the character has the ''effect_bundle'' and will receive the ''effect''.&lt;br /&gt;
&lt;br /&gt;
One more very important note - '''not every effect works with every effect target.''' You can't assign a charge_bonus to a &amp;lt;code&amp;gt;faction&amp;lt;/code&amp;gt;, for instance. That just doesn't make sense. 90% of the time, you can find which game objects are valid targets in the bonus value definitions (&amp;lt;code&amp;gt;campaign_bonus_value_ids_xxxxx&amp;lt;/code&amp;gt;), in the notes column. They'll say something like &amp;quot;used at character bonuses&amp;quot;, which means it's only applicable to a character. On the 10% that aren't noted in that table, you can typically find examples in vanilla for what you want to do, and you can copy what they do.&lt;br /&gt;
&lt;br /&gt;
Implicit effect_bundles are much the same - just without defining the effect_bundle on its own, and its bundle_target. This means the &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; column doesn't have a predefined effect source, so you will need to be slightly more aware of what you're using. Again, check vanilla examples as much as you can.&lt;br /&gt;
&lt;br /&gt;
Aside from using the aforementioned data structures, you can script some effect bundles as well. You can use a Lua script to apply (or remove) an explicit effect_bundle from a bundle_target - though mind it won't work for implicit effect_bundles.&lt;br /&gt;
&lt;br /&gt;
For Warhammer 2 - you can read up [https://chadvandy.github.io/tw_modding_resources/campaign/campaign_manager.html#section:campaign_manager:Effect%20Bundles here]. The same general commands should exist in all other games, with the biggest difference lying in Three Kingdoms.&lt;br /&gt;
&lt;br /&gt;
Likewise, Warhammer 2 got a GREAT new ability to completely change explicit effect_bundles dynamically while the game is going on. Instead of defining a dozen different effect bundles with 12 different values for the same effect, you can make one effect_bundle, and change its effect value dynamically. [[Custom Effect Bundles|Read up more on it here]].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;br /&gt;
[[Category:Rome 2]]&lt;br /&gt;
[[Category:Three Kingdoms]]&lt;br /&gt;
[[Category:Troy]]&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Effects&amp;diff=678</id>
		<title>Effects</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Effects&amp;diff=678"/>
		<updated>2023-06-10T16:35:35Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Whenever you pick a new skill for a character, or gain an item, or apply a banner to a unit, or build a building - you are getting and using effects.&lt;br /&gt;
&lt;br /&gt;
Effects are one of the most common game objects in all of Total War, and they drive a vast majority of any sort of dynamic/changing values throughout the game, and many game play systems. For example - the income from buildings is done through effects; attrition immunity is applied through effects; stat changes for units (ie. +Melee Attack for all archers) are done through effects.&lt;br /&gt;
&lt;br /&gt;
Learning how to create and alter effects is a fundamental part of being able to make meaningful edits to the game.&lt;br /&gt;
&lt;br /&gt;
NOTE: Written with R2/3K/WH2 in mind, this information should be valid from Empire to the present though. Please share if there are any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
=== The Effect Ecosystem: ===&lt;br /&gt;
Before we get into how to set up effect, lets take a quick look at how they are integrated into the game – at first glance, it can be a little overwhelming so lets just start simple and work our way up!&lt;br /&gt;
[[File:Effect tree.png|alt=A diagram showing the table relationship of effects|left|How an effect connects to the wider game.]]&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;
&lt;br /&gt;
&lt;br /&gt;
You define your effect in its own table.&lt;br /&gt;
&lt;br /&gt;
You can then define what it effects through the MANY effect_bonus_values_ tables, and the ones you use depend on what you want to use the effect on.&lt;br /&gt;
&lt;br /&gt;
Finally, you attach the effect to the “thing” in game that will apply it. There are two core ways of doing this.&lt;br /&gt;
&lt;br /&gt;
* Many systems in the game are built to apply effects through an effect bundle (literally a bundle of one or more effects that get applied in one go). It’s worth noting, this is the only method of applying effects via script.&lt;br /&gt;
* There are a good number of systems that forgoe effect bundles and hook up directly to the effect, skipping the need of an effect bundle, for example building levels or ancillaries.&lt;br /&gt;
&lt;br /&gt;
And that is largely it, in a nutshell!&lt;br /&gt;
&lt;br /&gt;
=== '''Anatomy of an effect:''' ===&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file.&lt;br /&gt;
[[File:Sample of the effects table.png|center|1024x1024px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table defines a few important things:&lt;br /&gt;
&lt;br /&gt;
* '''Key:''' This is the     unique key for this effect. Name it uniquely, and name it in a way so that     you can tell what it does! You will be referring to this a lot in other     tables.&lt;br /&gt;
* '''Icon | icon_negative:''' defines     the icon this effect will display when it’s having a positive effect and     negative effect.&lt;br /&gt;
* '''Description:''' This     is the text that will be displayed (note that you’re going to need to     define this in a.loc file in rPFM).&lt;br /&gt;
* '''Is_posititve_value_good:'''     This means that, if your value is a     positive integer and this bool is set to true, the text will show up as     green; if your value is negative and this bool is set to false, the text     will show up as red.&lt;br /&gt;
* '''Priority:''' 0 will     result in the effect being hidden. Otherwise, the higher the number, the     lower on a list the effect will be displayed in the UI.&lt;br /&gt;
* '''Category:'''  which determines where an effect shows up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the above table only creates the foundation for an effect, it’ll show up in the UI but nothing happens. Sometimes, this is all you may want, here are plenty of dummy effects in the game already that add a UI element to the game for things done in script!&lt;br /&gt;
&lt;br /&gt;
To make real change, we’re going to need to delve into the realm of effect_bonus_values, these allows us to hook up effects to bonus value ids, the games way to connect an effect to “stuff” in the game that the effect will impact.&lt;br /&gt;
&lt;br /&gt;
=== Bonus Value Ids: ===&lt;br /&gt;
Bonus value ids are essentially the way an effect modifies a given “thing”. Below you can see all the ways you can modify unit abilities with an effect. &lt;br /&gt;
[[File:Example bonus value ids.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot create a new bonus value id. Sorry. Just the way it is.&lt;br /&gt;
&lt;br /&gt;
With this in mind, don’t get too caught up with knowing all the Bonus Value Id’s. There are a lot of them and many of them will never show up in your modding activities, best to look at the ones tied to what you want to achieve and 99% of the time, you can just imitate what effects in the base game are already doing.&lt;br /&gt;
&lt;br /&gt;
=== Effect Bonus Value Tables: ===&lt;br /&gt;
OK, so we’re here! This is where we connect your effect to the bonus value and define the id to modify it! I’m afraid this is highly contextual and really depends on what it is you want to achieve. So I’m going to give a couple of examples to help demonstrate and hopefully that will be enough to get you started.&lt;br /&gt;
&lt;br /&gt;
==== Army Abilities: ====&lt;br /&gt;
Here you can see two effects one enables the usage of an army ability and another increases the charges of an army ability by one. This is defined in the effect_bonus_value_military_force_ability_junctions table.&lt;br /&gt;
[[File:Effect bonus value military force ability junctions example.png|center|1024x1024px|effect_bonus_value_military_force_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Units (sets): ====&lt;br /&gt;
Here you can see two effects that that give “barrier health”. One to the unit set that covers all skinks, the other to a unit set to all Saurus. &lt;br /&gt;
[[File:Effect bonus value unit set unit ability junctions tables.png|center|effect_bonus_value_ids_unit_sets_tables ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here you can see two effects that that give a redirect aura to the two same unit sets, but done in a different table. &lt;br /&gt;
[[File:Effect bonus value ids unit sets tables.png|center|effect_bonus_value_unit_set_unit_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Buildings: ====&lt;br /&gt;
And here, we can see two effects that modify the building set for high elf defences. One modifies the building cost, the other the build time. &lt;br /&gt;
[[File:Effect bonus value building set junctions tables.png|center|1024x1024px|effect_bonus_value_building_set_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Pooled Resources: ====&lt;br /&gt;
Note: to learn more about pooled resources, there is a dedicated [[Tutorial:Pooled Resources Updated|guide]] to them.&lt;br /&gt;
&lt;br /&gt;
In this example, you can see how two effects are set up to affect the dark elf slave pooled resource, one effect modifies the base amount and another is a percentage multiplier.&lt;br /&gt;
[[File:Effect bonus value pooled resource factor junctions table.png|center|978x978px|effect_bonus_value_pooled_resource_factor_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ARCHIVE:&lt;br /&gt;
&lt;br /&gt;
Below is the old guide. I didn't want to delete it.&lt;br /&gt;
&lt;br /&gt;
==== Anatomy of an Effect ====&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file. This table defines a few important things - the '''key''' of the effect, to link it up to other data objects and the localised text. It will also define some UI details here, typical - such as '''icon''', '''priority''' (which determines the order effects show up, or whether it is hidden from view with 0), and the '''category''', which determines where an effect shows up on a Character Details panel for example. Also mind the boolean in here, '''positive_is_good'''. This means that, if your value is a positive integer and this bool is set to true, the text will show up as green; if your value is negative and this bool is set to false, the text will show up as red.&lt;br /&gt;
&lt;br /&gt;
An effect defined in just this table has no, well, effect - it has to be linked to another game object called &amp;lt;code&amp;gt;bonus_values&amp;lt;/code&amp;gt;. Bonus values are the game object that ''actually do a thing.'' Effects just enable those bonus values to be applied elsewhere. Bonus values can do a bunch, from increasing recruited lords' ranks, to adding charge bonus to a unit set, and far beyond, varying greatly based on the individual game. It's important to note here: '''no, you can't make new bonus_values.''' They are defined in the underlying game engine, and have code attached to them that actually make stuff happen. You can only use existing bonus_values, ever.&lt;br /&gt;
&lt;br /&gt;
The bonus_values are defined in data in dummy tables called &amp;lt;code&amp;gt;campaign_bonus_value_ids_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. For instance, the &amp;lt;code&amp;gt;basic&amp;lt;/code&amp;gt; bonus_values are found in the tables &amp;lt;code&amp;gt;campaign_bonus_value_ids_basic&amp;lt;/code&amp;gt;. Do note that you won't find these tables in RPFM; they're dummy tables, meaning they're not actually used to build data in the game and can't be edited.&lt;br /&gt;
&lt;br /&gt;
The links between an effect is defined in tables called &amp;lt;code&amp;gt;effect_bonus_value_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. These tables are typically either two or three columns - you link an effect key to the bonus_value dummy key, and a potential third piece of data needed for the effect. For instance, &amp;lt;code&amp;gt;effect_bonus_value_ids_unit_sets&amp;lt;/code&amp;gt; has three columns - &amp;lt;code&amp;gt;effect&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bonus_value_id&amp;lt;/code&amp;gt; which defines WHAT'S being edited (upkeep, charge bonus, etc), and &amp;lt;code&amp;gt;unit_set&amp;lt;/code&amp;gt; which defines which units get this effect.&lt;br /&gt;
&lt;br /&gt;
However, not every effect ''needs'' a bonus value - it's fairly common to make a &amp;quot;dummy&amp;quot; effect, which is just UI and text, but doesn't actually have any bonus_values attached to it. This could be desired to make some clear UX about a functionality that is done through script or some other data object.&lt;br /&gt;
&lt;br /&gt;
==== Applying an Effect ====&lt;br /&gt;
From here, the effect ''works'' and is a beautiful machination, but it doesn't do anything since it isn't applied anywhere. In order to take hold, it needs to be attached into an &amp;lt;code&amp;gt;effect_bundle&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Effect bundles are another fairly common data object, and their name is pretty much their definition - they're a nice lil' package of effects. There are two types of effect_bundles - explicit, and implicit. Explicit effect bundles are defined in the table &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, and then those effect bundles can be applied through a variety of means. Implicit effect bundles are created when another effect-bundling table is used - for instance, &amp;lt;code&amp;gt;building_effects_junction&amp;lt;/code&amp;gt;. This table defines a list of effects that attach to a building, which are then '''bundled up''' in the game, thus implicitly.&lt;br /&gt;
&lt;br /&gt;
Looking first at explicit effect_bundles - you would first define the effect_bundle key in &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, which again is primarily UI information. However - there's an important bit of data in this table too, that we'll have to return to later. The &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; column is very important, as it plays a big role in a future bit that we'll cover soon. It's mostly common sense here - if the effect bundle is going to be applied to a character via an ancillary, use the &amp;lt;code&amp;gt;character&amp;lt;/code&amp;gt; bundle_target. If it's applied to an army through a stance, use the &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt; bundle_target. This is the game object that '''has''' the effect_bundle, and the effects will be applied ''from'' that object.&lt;br /&gt;
&lt;br /&gt;
From there, the next jump for making an explicit effect_bundle is the table &amp;lt;code&amp;gt;effect_bundles_to_effects_junctions&amp;lt;/code&amp;gt;. You'll never guess what it does!&lt;br /&gt;
&lt;br /&gt;
First off the bat, we have the &amp;lt;code&amp;gt;effect_bundle_key&amp;lt;/code&amp;gt; - self-explanatory. Same with &amp;lt;code&amp;gt;effect_key&amp;lt;/code&amp;gt; and, I assume, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If you're editing a numerical bonus_value - like, editing a stat - it'll just be whatever number you want to add to the stat. If you're applying some stranger effect - like attrition immunity - that doesn't use actually numbers, you'll either use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for &amp;quot;deactivate&amp;quot;, or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for &amp;quot;activate&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; is where it gets really important. Effect_scopes are defined in data, and new ones can be made - and, sometimes, are needed. Effect_scopes are composed of ''source'' and a ''target''. The '''source''' of an effect_scope will have to be the &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; defined in the effect_bundle earlier - you're applying an effect '''from''' the bundle_target's effect_bundle to something else. For example, if you wanted to add charge bonus on a character through an ancillary, you would just use the &amp;lt;code&amp;gt;character_to_character_own&amp;lt;/code&amp;gt; effect_scope - since the character has the ''effect_bundle'' and will receive the ''effect''.&lt;br /&gt;
&lt;br /&gt;
One more very important note - '''not every effect works with every effect target.''' You can't assign a charge_bonus to a &amp;lt;code&amp;gt;faction&amp;lt;/code&amp;gt;, for instance. That just doesn't make sense. 90% of the time, you can find which game objects are valid targets in the bonus value definitions (&amp;lt;code&amp;gt;campaign_bonus_value_ids_xxxxx&amp;lt;/code&amp;gt;), in the notes column. They'll say something like &amp;quot;used at character bonuses&amp;quot;, which means it's only applicable to a character. On the 10% that aren't noted in that table, you can typically find examples in vanilla for what you want to do, and you can copy what they do.&lt;br /&gt;
&lt;br /&gt;
Implicit effect_bundles are much the same - just without defining the effect_bundle on its own, and its bundle_target. This means the &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; column doesn't have a predefined effect source, so you will need to be slightly more aware of what you're using. Again, check vanilla examples as much as you can.&lt;br /&gt;
&lt;br /&gt;
Aside from using the aforementioned data structures, you can script some effect bundles as well. You can use a Lua script to apply (or remove) an explicit effect_bundle from a bundle_target - though mind it won't work for implicit effect_bundles.&lt;br /&gt;
&lt;br /&gt;
For Warhammer 2 - you can read up [https://chadvandy.github.io/tw_modding_resources/campaign/campaign_manager.html#section:campaign_manager:Effect%20Bundles here]. The same general commands should exist in all other games, with the biggest difference lying in Three Kingdoms.&lt;br /&gt;
&lt;br /&gt;
Likewise, Warhammer 2 got a GREAT new ability to completely change explicit effect_bundles dynamically while the game is going on. Instead of defining a dozen different effect bundles with 12 different values for the same effect, you can make one effect_bundle, and change its effect value dynamically. [[Custom Effect Bundles|Read up more on it here]].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;br /&gt;
[[Category:Rome 2]]&lt;br /&gt;
[[Category:Three Kingdoms]]&lt;br /&gt;
[[Category:Troy]]&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Effects&amp;diff=676</id>
		<title>Effects</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Effects&amp;diff=676"/>
		<updated>2023-06-10T16:33:35Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: Major rewrite of the effect and bonus value id aspect of the original guide. Added images. Kept old guide at bottom of page. may be worth killing off redundant content and possibly splitting off a separate guide on how to apply effects.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Whenever you pick a new skill for a character, or gain an item, or apply a banner to a unit, or build a building - you are getting and using effects.&lt;br /&gt;
&lt;br /&gt;
Effects are one of the most common game objects in all of Total War, and they drive a vast majority of any sort of dynamic/changing values throughout the game, and many game play systems. For example - the income from buildings is done through effects; attrition immunity is applied through effects; stat changes for units (ie. +Melee Attack for all archers) are done through effects.&lt;br /&gt;
&lt;br /&gt;
Learning how to create and alter effects is a fundamental part of being able to make meaningful edits to the game.&lt;br /&gt;
&lt;br /&gt;
NOTE: Written with R2/3K/WH2 in mind, this information should be valid from Empire to the present though. Please share if there are any inconsistencies.&lt;br /&gt;
&lt;br /&gt;
=== The Effect Ecosystem: ===&lt;br /&gt;
Before we get into how to set up effect, lets take a quick look at how they are integrated into the game – at first glance, it can be a little overwhelming so lets just start simple and work our way up!&lt;br /&gt;
[[File:Effect tree.png|alt=A diagram showing the table relationship of effects|left|How an effect connects to the wider game.]]&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;
You define your effect in its own table.&lt;br /&gt;
&lt;br /&gt;
You can then define what it effects through the MANY effect_bonus_values_ tables, and the ones you use depend on what you want to use the effect on.&lt;br /&gt;
&lt;br /&gt;
Finally, you attach the effect to the “thing” in game that will apply it. There are two core ways of doing this.&lt;br /&gt;
&lt;br /&gt;
* Many systems in the game are built to apply effects through an effect bundle (literally a bundle of one or more effects that get applied in one go). It’s worth noting, this is the only method of applying effects via script.&lt;br /&gt;
* There are a good number of systems that forgoe effect bundles and hook up directly to the effect, skipping the need of an effect bundle, for example building levels or ancillaries.&lt;br /&gt;
&lt;br /&gt;
And that is largely it, in a nutshell!&lt;br /&gt;
&lt;br /&gt;
=== '''Anatomy of an effect:''' ===&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file.&lt;br /&gt;
[[File:Sample of the effects table.png|center|1024x1024px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table defines a few important things:&lt;br /&gt;
&lt;br /&gt;
* '''Key:''' This is the     unique key for this effect. Name it uniquely, and name it in a way so that     you can tell what it does! You will be referring to this a lot in other     tables.&lt;br /&gt;
* '''Icon | icon_negative:''' defines     the icon this effect will display when it’s having a positive effect and     negative effect.&lt;br /&gt;
* '''Description:''' This     is the text that will be displayed (note that you’re going to need to     define this in a.loc file in rPFM).&lt;br /&gt;
* '''Is_posititve_value_good:'''     This means that, if your value is a     positive integer and this bool is set to true, the text will show up as     green; if your value is negative and this bool is set to false, the text     will show up as red.&lt;br /&gt;
* '''Priority:''' 0 will     result in the effect being hidden. Otherwise, the higher the number, the     lower on a list the effect will be displayed in the UI.&lt;br /&gt;
* '''Category:'''  which determines where an effect shows up.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the above table only creates the foundation for an effect, it’ll show up in the UI but nothing happens. Sometimes, this is all you may want, here are plenty of dummy effects in the game already that add a UI element to the game for things done in script!&lt;br /&gt;
&lt;br /&gt;
To make real change, we’re going to need to delve into the realm of effect_bonus_values, these allows us to hook up effects to bonus value ids, the games way to connect an effect to “stuff” in the game that the effect will impact.&lt;br /&gt;
&lt;br /&gt;
=== Bonus Value Ids: ===&lt;br /&gt;
Bonus value ids are essentially the way an effect modifies a given “thing”. Below you can see all the ways you can modify unit abilities with an effect. &lt;br /&gt;
[[File:Example bonus value ids.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You cannot create a new bonus value id. Sorry. Just the way it is.&lt;br /&gt;
&lt;br /&gt;
With this in mind, don’t get too caught up with knowing all the Bonus Value Id’s. There are a lot of them and many of them will never show up in your modding activities, best to look at the ones tied to what you want to achieve and 99% of the time, you can just imitate what effects in the base game are already doing.&lt;br /&gt;
&lt;br /&gt;
=== Effect Bonus Value Tables: ===&lt;br /&gt;
OK, so we’re here! This is where we connect your effect to the bonus value and define the id to modify it! I’m afraid this is highly contextual and really depends on what it is you want to achieve. So I’m going to give a couple of examples to help demonstrate and hopefully that will be enough to get you started.&lt;br /&gt;
&lt;br /&gt;
==== Army Abilities: ====&lt;br /&gt;
Here you can see two effects one enables the usage of an army ability and another increases the charges of an army ability by one. This is defined in the effect_bonus_value_military_force_ability_junctions table.&lt;br /&gt;
[[File:Effect bonus value military force ability junctions example.png|center|1024x1024px|effect_bonus_value_military_force_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Units (sets): ====&lt;br /&gt;
Here you can see two effects that that give “barrier health”. One to the unit set that covers all skinks, the other to a unit set to all Saurus. &lt;br /&gt;
[[File:Effect bonus value unit set unit ability junctions tables.png|center|effect_bonus_value_ids_unit_sets_tables ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here you can see two effects that that give a redirect aura to the two same unit sets, but done in a different table. &lt;br /&gt;
[[File:Effect bonus value ids unit sets tables.png|center|effect_bonus_value_unit_set_unit_ability_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Buildings: ====&lt;br /&gt;
And here, we can see two effects that modify the building set for high elf defences. One modifies the building cost, the other the build time. &lt;br /&gt;
[[File:Effect bonus value building set junctions tables.png|center|1024x1024px|effect_bonus_value_building_set_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
==== Pooled Resources: ====&lt;br /&gt;
Note: to learn more about pooled resources, there is a dedicated guide to them.&lt;br /&gt;
&lt;br /&gt;
In this example, you can see how two effects are set up to affect the dark elf slave pooled resource, one effect modifies the base amount and another is a percentage multiplier.&lt;br /&gt;
[[File:Effect bonus value pooled resource factor junctions table.png|center|978x978px|effect_bonus_value_pooled_resource_factor_junctions_tables]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ARCHIVE:&lt;br /&gt;
&lt;br /&gt;
Below is the old guide. I didn't want to delete it.&lt;br /&gt;
&lt;br /&gt;
==== Anatomy of an Effect ====&lt;br /&gt;
At the heart of all effects is the &amp;lt;code&amp;gt;effects_table&amp;lt;/code&amp;gt; db file. This table defines a few important things - the '''key''' of the effect, to link it up to other data objects and the localised text. It will also define some UI details here, typical - such as '''icon''', '''priority''' (which determines the order effects show up, or whether it is hidden from view with 0), and the '''category''', which determines where an effect shows up on a Character Details panel for example. Also mind the boolean in here, '''positive_is_good'''. This means that, if your value is a positive integer and this bool is set to true, the text will show up as green; if your value is negative and this bool is set to false, the text will show up as red.&lt;br /&gt;
&lt;br /&gt;
An effect defined in just this table has no, well, effect - it has to be linked to another game object called &amp;lt;code&amp;gt;bonus_values&amp;lt;/code&amp;gt;. Bonus values are the game object that ''actually do a thing.'' Effects just enable those bonus values to be applied elsewhere. Bonus values can do a bunch, from increasing recruited lords' ranks, to adding charge bonus to a unit set, and far beyond, varying greatly based on the individual game. It's important to note here: '''no, you can't make new bonus_values.''' They are defined in the underlying game engine, and have code attached to them that actually make stuff happen. You can only use existing bonus_values, ever.&lt;br /&gt;
&lt;br /&gt;
The bonus_values are defined in data in dummy tables called &amp;lt;code&amp;gt;campaign_bonus_value_ids_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. For instance, the &amp;lt;code&amp;gt;basic&amp;lt;/code&amp;gt; bonus_values are found in the tables &amp;lt;code&amp;gt;campaign_bonus_value_ids_basic&amp;lt;/code&amp;gt;. Do note that you won't find these tables in RPFM; they're dummy tables, meaning they're not actually used to build data in the game and can't be edited.&lt;br /&gt;
&lt;br /&gt;
The links between an effect is defined in tables called &amp;lt;code&amp;gt;effect_bonus_value_BONUS VALUE TYPE&amp;lt;/code&amp;gt;. These tables are typically either two or three columns - you link an effect key to the bonus_value dummy key, and a potential third piece of data needed for the effect. For instance, &amp;lt;code&amp;gt;effect_bonus_value_ids_unit_sets&amp;lt;/code&amp;gt; has three columns - &amp;lt;code&amp;gt;effect&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bonus_value_id&amp;lt;/code&amp;gt; which defines WHAT'S being edited (upkeep, charge bonus, etc), and &amp;lt;code&amp;gt;unit_set&amp;lt;/code&amp;gt; which defines which units get this effect.&lt;br /&gt;
&lt;br /&gt;
However, not every effect ''needs'' a bonus value - it's fairly common to make a &amp;quot;dummy&amp;quot; effect, which is just UI and text, but doesn't actually have any bonus_values attached to it. This could be desired to make some clear UX about a functionality that is done through script or some other data object.&lt;br /&gt;
&lt;br /&gt;
==== Applying an Effect ====&lt;br /&gt;
From here, the effect ''works'' and is a beautiful machination, but it doesn't do anything since it isn't applied anywhere. In order to take hold, it needs to be attached into an &amp;lt;code&amp;gt;effect_bundle&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Effect bundles are another fairly common data object, and their name is pretty much their definition - they're a nice lil' package of effects. There are two types of effect_bundles - explicit, and implicit. Explicit effect bundles are defined in the table &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, and then those effect bundles can be applied through a variety of means. Implicit effect bundles are created when another effect-bundling table is used - for instance, &amp;lt;code&amp;gt;building_effects_junction&amp;lt;/code&amp;gt;. This table defines a list of effects that attach to a building, which are then '''bundled up''' in the game, thus implicitly.&lt;br /&gt;
&lt;br /&gt;
Looking first at explicit effect_bundles - you would first define the effect_bundle key in &amp;lt;code&amp;gt;effect_bundles&amp;lt;/code&amp;gt;, which again is primarily UI information. However - there's an important bit of data in this table too, that we'll have to return to later. The &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; column is very important, as it plays a big role in a future bit that we'll cover soon. It's mostly common sense here - if the effect bundle is going to be applied to a character via an ancillary, use the &amp;lt;code&amp;gt;character&amp;lt;/code&amp;gt; bundle_target. If it's applied to an army through a stance, use the &amp;lt;code&amp;gt;force&amp;lt;/code&amp;gt; bundle_target. This is the game object that '''has''' the effect_bundle, and the effects will be applied ''from'' that object.&lt;br /&gt;
&lt;br /&gt;
From there, the next jump for making an explicit effect_bundle is the table &amp;lt;code&amp;gt;effect_bundles_to_effects_junctions&amp;lt;/code&amp;gt;. You'll never guess what it does!&lt;br /&gt;
&lt;br /&gt;
First off the bat, we have the &amp;lt;code&amp;gt;effect_bundle_key&amp;lt;/code&amp;gt; - self-explanatory. Same with &amp;lt;code&amp;gt;effect_key&amp;lt;/code&amp;gt; and, I assume, &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. If you're editing a numerical bonus_value - like, editing a stat - it'll just be whatever number you want to add to the stat. If you're applying some stranger effect - like attrition immunity - that doesn't use actually numbers, you'll either use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for &amp;quot;deactivate&amp;quot;, or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for &amp;quot;activate&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; is where it gets really important. Effect_scopes are defined in data, and new ones can be made - and, sometimes, are needed. Effect_scopes are composed of ''source'' and a ''target''. The '''source''' of an effect_scope will have to be the &amp;lt;code&amp;gt;bundle_target&amp;lt;/code&amp;gt; defined in the effect_bundle earlier - you're applying an effect '''from''' the bundle_target's effect_bundle to something else. For example, if you wanted to add charge bonus on a character through an ancillary, you would just use the &amp;lt;code&amp;gt;character_to_character_own&amp;lt;/code&amp;gt; effect_scope - since the character has the ''effect_bundle'' and will receive the ''effect''.&lt;br /&gt;
&lt;br /&gt;
One more very important note - '''not every effect works with every effect target.''' You can't assign a charge_bonus to a &amp;lt;code&amp;gt;faction&amp;lt;/code&amp;gt;, for instance. That just doesn't make sense. 90% of the time, you can find which game objects are valid targets in the bonus value definitions (&amp;lt;code&amp;gt;campaign_bonus_value_ids_xxxxx&amp;lt;/code&amp;gt;), in the notes column. They'll say something like &amp;quot;used at character bonuses&amp;quot;, which means it's only applicable to a character. On the 10% that aren't noted in that table, you can typically find examples in vanilla for what you want to do, and you can copy what they do.&lt;br /&gt;
&lt;br /&gt;
Implicit effect_bundles are much the same - just without defining the effect_bundle on its own, and its bundle_target. This means the &amp;lt;code&amp;gt;effect_scope&amp;lt;/code&amp;gt; column doesn't have a predefined effect source, so you will need to be slightly more aware of what you're using. Again, check vanilla examples as much as you can.&lt;br /&gt;
&lt;br /&gt;
Aside from using the aforementioned data structures, you can script some effect bundles as well. You can use a Lua script to apply (or remove) an explicit effect_bundle from a bundle_target - though mind it won't work for implicit effect_bundles.&lt;br /&gt;
&lt;br /&gt;
For Warhammer 2 - you can read up [https://chadvandy.github.io/tw_modding_resources/campaign/campaign_manager.html#section:campaign_manager:Effect%20Bundles here]. The same general commands should exist in all other games, with the biggest difference lying in Three Kingdoms.&lt;br /&gt;
&lt;br /&gt;
Likewise, Warhammer 2 got a GREAT new ability to completely change explicit effect_bundles dynamically while the game is going on. Instead of defining a dozen different effect bundles with 12 different values for the same effect, you can make one effect_bundle, and change its effect value dynamically. [[Custom Effect Bundles|Read up more on it here]].&lt;br /&gt;
[[Category:Unfinished]]&lt;br /&gt;
[[Category:Outdated]]&lt;br /&gt;
[[Category:Warhammer 2]]&lt;br /&gt;
[[Category:Rome 2]]&lt;br /&gt;
[[Category:Three Kingdoms]]&lt;br /&gt;
[[Category:Troy]]&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_bonus_value_unit_set_unit_ability_junctions_tables.png&amp;diff=675</id>
		<title>File:Effect bonus value unit set unit ability junctions tables.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_bonus_value_unit_set_unit_ability_junctions_tables.png&amp;diff=675"/>
		<updated>2023-06-10T16:29:49Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;effect_bonus_value_unit_set_unit_ability_junctions example&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_bonus_value_ids_unit_sets_tables.png&amp;diff=673</id>
		<title>File:Effect bonus value ids unit sets tables.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_bonus_value_ids_unit_sets_tables.png&amp;diff=673"/>
		<updated>2023-06-10T16:27:33Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;effect_bonus_value_ids_unit_sets example&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_bonus_value_building_set_junctions_tables.png&amp;diff=672</id>
		<title>File:Effect bonus value building set junctions tables.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_bonus_value_building_set_junctions_tables.png&amp;diff=672"/>
		<updated>2023-06-10T16:26:15Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;effect_bonus_value_building_set_junctions example&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_bonus_value_pooled_resource_factor_junctions_table.png&amp;diff=671</id>
		<title>File:Effect bonus value pooled resource factor junctions table.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_bonus_value_pooled_resource_factor_junctions_table.png&amp;diff=671"/>
		<updated>2023-06-10T16:25:20Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;effect_bonus_value_pooled_resource_factor_junctions example&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_bonus_value_military_force_ability_junctions_example.png&amp;diff=670</id>
		<title>File:Effect bonus value military force ability junctions example.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_bonus_value_military_force_ability_junctions_example.png&amp;diff=670"/>
		<updated>2023-06-10T16:22:39Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;a couple of examples of effect_bonus_value_military_force_ability_junctions_tables&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Example_bonus_value_ids.png&amp;diff=669</id>
		<title>File:Example bonus value ids.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Example_bonus_value_ids.png&amp;diff=669"/>
		<updated>2023-06-10T16:19:45Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;image showing a table of bonus value ids&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Sample_of_the_effects_table.png&amp;diff=667</id>
		<title>File:Sample of the effects table.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Sample_of_the_effects_table.png&amp;diff=667"/>
		<updated>2023-06-10T16:09:49Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;View of the effects table in Dave&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Effect_tree.png&amp;diff=666</id>
		<title>File:Effect tree.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Effect_tree.png&amp;diff=666"/>
		<updated>2023-06-10T16:04:10Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;small diagram to illustrate how to set up an effect&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Pooled_Resources_Updated&amp;diff=568</id>
		<title>Tutorial:Pooled Resources Updated</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Pooled_Resources_Updated&amp;diff=568"/>
		<updated>2022-12-09T16:30:07Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: added image&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This here tutorial is going to go over the basics of a Pooled Resource, why they’re awesome, and how to use them to their fullest potential. I’m going to try and not pigeon-hole readers into a specific usage of pooled resources, but I will try at all points to cover all realistic paths to go down, and all functionality that pooled resources have. Do note this tutorial will focus specifically on Warhammer III, and some of this may apply to Warhammer II and Troy.&lt;br /&gt;
&lt;br /&gt;
Alright! A pooled resource is a type of game object that’s becoming more prevalent in Total War – being first introduced throughout Total War Warhammer II’s development (to my knowledge), and becoming increasingly important in Three Kingdoms where it powers many systems like population and food supplies.&lt;br /&gt;
&lt;br /&gt;
A pooled resource is pretty basic, conceptually – it’s a custom resource (of whatever make or model) that is contained within a pool. In Warhammer III, pooled resources can be attached to a number of “locations”.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Pool Type&lt;br /&gt;
!Description&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|FACTION&lt;br /&gt;
|This is a  resource which is tracked at a global level.&lt;br /&gt;
|Oathgold,  chivalry, devotion, harmony&lt;br /&gt;
|-&lt;br /&gt;
|MILITARY  FORCE&lt;br /&gt;
|These types  of pools are tracked at the army level, and can be different values at each  army.&lt;br /&gt;
|Chaos  authority, winds of magic, Ogre Meat.&lt;br /&gt;
|-&lt;br /&gt;
|GEOGRAPHIC  PROVINCE&lt;br /&gt;
|Pools tracked  at the province level, values can be different at each province – but is  shared for all factions.&lt;br /&gt;
|Corruption.&lt;br /&gt;
|-&lt;br /&gt;
|REGION&lt;br /&gt;
|Assumed to  operate on specific regions&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|REGION GROUP&lt;br /&gt;
|Assumed to  operate on specific regions&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|FACTION_PROVINCE&lt;br /&gt;
|Pools tracked  at provincial level. If a province has multiple owners, each gets a separate  pool.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|CHARACTER&lt;br /&gt;
|Assumed to  operate on individual characters&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|SIEGE&lt;br /&gt;
|A pool  attached to a specific siege instance.&lt;br /&gt;
|Supplies&lt;br /&gt;
|}&lt;br /&gt;
In WH2, some modders have created pooled resources for a gromril resource for the Dwarfs, the “stored lives” mechanic and the resource “Necromantic Power” (in return of the lichemaster).&lt;br /&gt;
&lt;br /&gt;
The uses of pooled resources are far, in big part due to how absolutely versatile and moddable they are. They can stand for basically any numerical data you want on the campaign.&lt;br /&gt;
&lt;br /&gt;
== Anatomy of a pooled Resource: ==&lt;br /&gt;
Pooled resources are at the centre of a web of DB entries, and it can be quite overwhelming when first trying to learn. So to help compartmentalise things a bit, let is break it down.&lt;br /&gt;
[[File:Pooled Resource Breakdown.png|thumb]]&lt;br /&gt;
# You have setups for the pooled resource itself.&lt;br /&gt;
## You have setups to hook that resource to the game as a campaign group.&lt;br /&gt;
# You set up “factors” – essentially variables which can impact the value of a pooled resource.&lt;br /&gt;
## And tables to hook these up to effects.&lt;br /&gt;
# You set up usual modifiers making use of those effects (events, effect bundles, buildings etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is overly simplified, but it provides a good framework to learn the ropes!&lt;br /&gt;
&lt;br /&gt;
== Initial Setup: ==&lt;br /&gt;
The first place to go will be the pooled resource table. This is fairly simple to set up.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Value'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|'''Key'''&lt;br /&gt;
|Unique key  for your resource&lt;br /&gt;
|-&lt;br /&gt;
|'''Minimum/ maximum'''&lt;br /&gt;
|Lowest/highest  value this pool can be&lt;br /&gt;
|-&lt;br /&gt;
|Positive/  negative factor display name&lt;br /&gt;
|Text values  to categorise factors in UI.&lt;br /&gt;
|-&lt;br /&gt;
|description&lt;br /&gt;
|Text  description of the resource in the UI&lt;br /&gt;
|-&lt;br /&gt;
|Ai_ignored&lt;br /&gt;
|Make this a  pool the AI ignores.&lt;br /&gt;
|-&lt;br /&gt;
|Default_factor&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Optional_icon_path&lt;br /&gt;
|Icon for  resource&lt;br /&gt;
|-&lt;br /&gt;
|Income policy&lt;br /&gt;
|Determines  when the pool updates&lt;br /&gt;
|-&lt;br /&gt;
|''&amp;lt;u&amp;gt;Reset before income&amp;lt;/u&amp;gt;''&lt;br /&gt;
|Resets the  pool before recalculating new values&lt;br /&gt;
|-&lt;br /&gt;
|'''scope'''&lt;br /&gt;
|Where the  resource is attached (e.g. faction)&lt;br /&gt;
|-&lt;br /&gt;
|''&amp;lt;u&amp;gt;Has persistent factors&amp;lt;/u&amp;gt;''&lt;br /&gt;
|For resources  where it’s modifiers applyonce and stack vs adding up (tor yvress defence)&lt;br /&gt;
|-&lt;br /&gt;
|Sort order&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Battle  conversion&lt;br /&gt;
|This resource  converts into a battle resource.&lt;br /&gt;
|-&lt;br /&gt;
|Apply income  on creation&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Always  display zero factors&lt;br /&gt;
|?&lt;br /&gt;
|}&lt;br /&gt;
Usually '''these''' items are the important ones you need to define and &amp;lt;u&amp;gt;these&amp;lt;/u&amp;gt; values, are important based on what you want to do. Typically, you’re probably going to want the AI to ignore the resource, have your income policy be end of round, not reset income and not have persistent factors (although this is not always the case!)&lt;br /&gt;
&lt;br /&gt;
= Hooking up the Resource: =&lt;br /&gt;
The seed has been planted, the next thing we need to do is hook that resource up to something. To do this we need to create a campaign group to represent the pooled resource. '''It would probably be good to get a campaign group tutorial up somewhere!'''&lt;br /&gt;
&lt;br /&gt;
'''Camapign_groups:''' In this table you only have 1 value to enter, a new key for the group representing your resource.&lt;br /&gt;
&lt;br /&gt;
'''Camapign_group_members:''' Much like campaign groups, this is easy enough, create a new member to represent your resource, and attach it to the campaign group above.&lt;br /&gt;
&lt;br /&gt;
'''Campaign_group_pooled_resources:''' In this table add a new record, hook up your campaign group to your resource and set an initial value if needed. This is essentially the starting value in a pool.&lt;br /&gt;
&lt;br /&gt;
NOTE! If you have this set up for forces, provinces and other non-faction scopes, this will apply to each new army/ province you get. You may want to consider setting this to 0 and script-adding resource on turn 1.&lt;br /&gt;
&lt;br /&gt;
'''Camapign_group_member_criteria_XXX:''' These are a host of tables that you can use to help further define your resource. For this guide, I am going to assume a basic need to use these – and that you want to associate the resource to a specific culture. As such, refer to '''Camapign_group_member_criteria_cultures:''' Here you want to create a new record, attach your campaign group member created above, associate it with the culture you want to add it to and then define that cultures relationship to that member.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|ACTOR&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|ORIGINATOR&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|OWNER&lt;br /&gt;
|?&lt;br /&gt;
|}&lt;br /&gt;
With the above done, you now have a resource and have attached it to a culture!&lt;br /&gt;
&lt;br /&gt;
= Factor in the factors: =&lt;br /&gt;
Now you have a resource, you have to set up the things that modify it! When setting up a factor correctly, it ensures that when an effect bundle/ effect is used to modify a resource, the pooled resource is correctly modified and the UI categorises it/ breaks it down for the player.&lt;br /&gt;
&lt;br /&gt;
'''Pooled_resource_factors:''' Take a look at this table – hopefully much of what you want to do is already covered by the base game setups. If not, or you want to create your own versions, add a new factor for each way your pooled resource can be edited.&lt;br /&gt;
&lt;br /&gt;
NOTE: If you have any factors which can positively or negatively impact a resource, the UI will not show that breakdown – only the NET value in the UI. If you wish to show a breakdown, consider splitting your factors e.g. buildings and buildings_negative.&lt;br /&gt;
&lt;br /&gt;
'''Pooled_resource_factor_junctions:''' In this table, you are connecting your factor to the pooled resource and giving that connection a unique ID. You are also able to set the min/Max amount this factor can contribute in any one transaction. Do this for EACH factor you have set up.&lt;br /&gt;
&lt;br /&gt;
'''Effects''': Factors need to be tied to effects. Which can then be referenced by buildings/bundles. Create an effect for EACH factor you have set up.&lt;br /&gt;
&lt;br /&gt;
'''Effect_bonus_value_pooled_resource_factor_junctions''': This is the table that hooks up your factor to an effect. Noteworthy point relating to the value Bonus Value ID:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Base Amount&lt;br /&gt;
|An effect  with this increments by a base vale e.g. 10.&lt;br /&gt;
|-&lt;br /&gt;
|Income  Disabled&lt;br /&gt;
|Used by  Norsca?&lt;br /&gt;
|-&lt;br /&gt;
|Percentage  Multiplier&lt;br /&gt;
|An effect  with this will modify the resource by a percentage&lt;br /&gt;
|-&lt;br /&gt;
|Neighbouring  Area Base Amount&lt;br /&gt;
|Something to  do with corruption?&lt;br /&gt;
|}&lt;br /&gt;
'''Effect_bonus_value_pooled_resource_junctions:''' This table is a sneaky one – it’s very similar to the above, but is not tied to a specific factor. This is typically best used for when you want an effect to increase your resource cap.&lt;br /&gt;
&lt;br /&gt;
= Closing: =&lt;br /&gt;
You should not have yourself a number of effects all hooked up to your resource and its factors. From here, you can add them to effect bundles/ or junction them off to buildings/ ancillaries etc.&lt;br /&gt;
&lt;br /&gt;
Do some testing, make sure things work – and then consider how you can represent your resource in the UI.&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=Tutorial:Pooled_Resources_Updated&amp;diff=566</id>
		<title>Tutorial:Pooled Resources Updated</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=Tutorial:Pooled_Resources_Updated&amp;diff=566"/>
		<updated>2022-12-05T09:34:55Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: Created page - added first draft&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro: ==&lt;br /&gt;
This here tutorial is going to go over the basics of a Pooled Resource, why they’re awesome, and how to use them to their fullest potential. I’m going to try and not pigeon-hole readers into a specific usage of pooled resources, but I will try at all points to cover all realistic paths to go down, and all functionality that pooled resources have. Do note this tutorial will focus specifically on Warhammer III, and some of this may apply to Warhammer II and Troy.&lt;br /&gt;
&lt;br /&gt;
Alright! A pooled resource is a type of game object that’s becoming more prevalent in Total War – being first introduced throughout Total War Warhammer II’s development (to my knowledge), and becoming increasingly important in Three Kingdoms where it powers many systems like population and food supplies.&lt;br /&gt;
&lt;br /&gt;
A pooled resource is pretty basic, conceptually – it’s a custom resource (of whatever make or model) that is contained within a pool. In Warhammer III, pooled resources can be attached to a number of “locations”.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Pool Type&lt;br /&gt;
!Description&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|FACTION&lt;br /&gt;
|This is a  resource which is tracked at a global level.&lt;br /&gt;
|Oathgold,  chivalry, devotion, harmony&lt;br /&gt;
|-&lt;br /&gt;
|MILITARY  FORCE&lt;br /&gt;
|These types  of pools are tracked at the army level, and can be different values at each  army.&lt;br /&gt;
|Chaos  authority, winds of magic, Ogre Meat.&lt;br /&gt;
|-&lt;br /&gt;
|GEOGRAPHIC  PROVINCE&lt;br /&gt;
|Pools tracked  at the province level, values can be different at each province – but is  shared for all factions.&lt;br /&gt;
|Corruption.&lt;br /&gt;
|-&lt;br /&gt;
|REGION&lt;br /&gt;
|Assumed to  operate on specific regions&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|REGION GROUP&lt;br /&gt;
|Assumed to  operate on specific regions&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|FACTION_PROVINCE&lt;br /&gt;
|Pools tracked  at provincial level. If a province has multiple owners, each gets a separate  pool.&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|CHARACTER&lt;br /&gt;
|Assumed to  operate on individual characters&lt;br /&gt;
|None&lt;br /&gt;
|-&lt;br /&gt;
|SIEGE&lt;br /&gt;
|A pool  attached to a specific siege instance.&lt;br /&gt;
|Supplies&lt;br /&gt;
|}&lt;br /&gt;
In WH2, some modders have created pooled resources for a gromril resource for the Dwarfs, the “stored lives” mechanic and the resource “Necromantic Power” (in return of the lichemaster).&lt;br /&gt;
&lt;br /&gt;
The uses of pooled resources are far, in big part due to how absolutely versatile and moddable they are. They can stand for basically any numerical data you want on the campaign.&lt;br /&gt;
&lt;br /&gt;
== Anatomy of a pooled Resource: ==&lt;br /&gt;
Pooled resources are at the centre of a web of DB entries, and it can be quite overwhelming when first trying to learn. So to help compartmentalise things a bit, let is break it down.&lt;br /&gt;
&lt;br /&gt;
# You have setups for the pooled resource itself.&lt;br /&gt;
## You have setups to hook that resource to the game as a campaign group.&lt;br /&gt;
# You set up “factors” – essentially variables which can impact the value of a pooled resource.&lt;br /&gt;
## And tables to hook these up to effects.&lt;br /&gt;
# You set up usual modifiers making use of those effects (events, effect bundles, buildings etc.)&lt;br /&gt;
&lt;br /&gt;
[image here when approved &amp;amp; uploaded]&lt;br /&gt;
&lt;br /&gt;
This is overly simplified, but it provides a good framework to learn the ropes!&lt;br /&gt;
&lt;br /&gt;
== Initial Setup: ==&lt;br /&gt;
The first place to go will be the pooled resource table. This is fairly simple to set up.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Value'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
|'''Key'''&lt;br /&gt;
|Unique key  for your resource&lt;br /&gt;
|-&lt;br /&gt;
|'''Minimum/ maximum'''&lt;br /&gt;
|Lowest/highest  value this pool can be&lt;br /&gt;
|-&lt;br /&gt;
|Positive/  negative factor display name&lt;br /&gt;
|Text values  to categorise factors in UI.&lt;br /&gt;
|-&lt;br /&gt;
|description&lt;br /&gt;
|Text  description of the resource in the UI&lt;br /&gt;
|-&lt;br /&gt;
|Ai_ignored&lt;br /&gt;
|Make this a  pool the AI ignores.&lt;br /&gt;
|-&lt;br /&gt;
|Default_factor&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Optional_icon_path&lt;br /&gt;
|Icon for  resource&lt;br /&gt;
|-&lt;br /&gt;
|Income policy&lt;br /&gt;
|Determines  when the pool updates&lt;br /&gt;
|-&lt;br /&gt;
|''&amp;lt;u&amp;gt;Reset before income&amp;lt;/u&amp;gt;''&lt;br /&gt;
|Resets the  pool before recalculating new values&lt;br /&gt;
|-&lt;br /&gt;
|'''scope'''&lt;br /&gt;
|Where the  resource is attached (e.g. faction)&lt;br /&gt;
|-&lt;br /&gt;
|''&amp;lt;u&amp;gt;Has persistent factors&amp;lt;/u&amp;gt;''&lt;br /&gt;
|For resources  where it’s modifiers applyonce and stack vs adding up (tor yvress defence)&lt;br /&gt;
|-&lt;br /&gt;
|Sort order&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Battle  conversion&lt;br /&gt;
|This resource  converts into a battle resource.&lt;br /&gt;
|-&lt;br /&gt;
|Apply income  on creation&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Always  display zero factors&lt;br /&gt;
|?&lt;br /&gt;
|}&lt;br /&gt;
Usually '''these''' items are the important ones you need to define and &amp;lt;u&amp;gt;these&amp;lt;/u&amp;gt; values, are important based on what you want to do. Typically, you’re probably going to want the AI to ignore the resource, have your income policy be end of round, not reset income and not have persistent factors (although this is not always the case!)&lt;br /&gt;
&lt;br /&gt;
= Hooking up the Resource: =&lt;br /&gt;
The seed has been planted, the next thing we need to do is hook that resource up to something. To do this we need to create a campaign group to represent the pooled resource. '''It would probably be good to get a campaign group tutorial up somewhere!'''&lt;br /&gt;
&lt;br /&gt;
'''Camapign_groups:''' In this table you only have 1 value to enter, a new key for the group representing your resource.&lt;br /&gt;
&lt;br /&gt;
'''Camapign_group_members:''' Much like campaign groups, this is easy enough, create a new member to represent your resource, and attach it to the campaign group above.&lt;br /&gt;
&lt;br /&gt;
'''Campaign_group_pooled_resources:''' In this table add a new record, hook up your campaign group to your resource and set an initial value if needed. This is essentially the starting value in a pool.&lt;br /&gt;
&lt;br /&gt;
NOTE! If you have this set up for forces, provinces and other non-faction scopes, this will apply to each new army/ province you get. You may want to consider setting this to 0 and script-adding resource on turn 1.&lt;br /&gt;
&lt;br /&gt;
'''Camapign_group_member_criteria_XXX:''' These are a host of tables that you can use to help further define your resource. For this guide, I am going to assume a basic need to use these – and that you want to associate the resource to a specific culture. As such, refer to '''Camapign_group_member_criteria_cultures:''' Here you want to create a new record, attach your campaign group member created above, associate it with the culture you want to add it to and then define that cultures relationship to that member.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|ACTOR&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|ORIGINATOR&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|OWNER&lt;br /&gt;
|?&lt;br /&gt;
|}&lt;br /&gt;
With the above done, you now have a resource and have attached it to a culture!&lt;br /&gt;
&lt;br /&gt;
= Factor in the factors: =&lt;br /&gt;
Now you have a resource, you have to set up the things that modify it! When setting up a factor correctly, it ensures that when an effect bundle/ effect is used to modify a resource, the pooled resource is correctly modified and the UI categorises it/ breaks it down for the player.&lt;br /&gt;
&lt;br /&gt;
'''Pooled_resource_factors:''' Take a look at this table – hopefully much of what you want to do is already covered by the base game setups. If not, or you want to create your own versions, add a new factor for each way your pooled resource can be edited.&lt;br /&gt;
&lt;br /&gt;
NOTE: If you have any factors which can positively or negatively impact a resource, the UI will not show that breakdown – only the NET value in the UI. If you wish to show a breakdown, consider splitting your factors e.g. buildings and buildings_negative.&lt;br /&gt;
&lt;br /&gt;
'''Pooled_resource_factor_junctions:''' In this table, you are connecting your factor to the pooled resource and giving that connection a unique ID. You are also able to set the min/Max amount this factor can contribute in any one transaction. Do this for EACH factor you have set up.&lt;br /&gt;
&lt;br /&gt;
'''Effects''': Factors need to be tied to effects. Which can then be referenced by buildings/bundles. Create an effect for EACH factor you have set up.&lt;br /&gt;
&lt;br /&gt;
'''Effect_bonus_value_pooled_resource_factor_junctions''': This is the table that hooks up your factor to an effect. Noteworthy point relating to the value Bonus Value ID:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Base Amount&lt;br /&gt;
|An effect  with this increments by a base vale e.g. 10.&lt;br /&gt;
|-&lt;br /&gt;
|Income  Disabled&lt;br /&gt;
|Used by  Norsca?&lt;br /&gt;
|-&lt;br /&gt;
|Percentage  Multiplier&lt;br /&gt;
|An effect  with this will modify the resource by a percentage&lt;br /&gt;
|-&lt;br /&gt;
|Neighbouring  Area Base Amount&lt;br /&gt;
|Something to  do with corruption?&lt;br /&gt;
|}&lt;br /&gt;
'''Effect_bonus_value_pooled_resource_junctions:''' This table is a sneaky one – it’s very similar to the above, but is not tied to a specific factor. This is typically best used for when you want an effect to increase your resource cap.&lt;br /&gt;
&lt;br /&gt;
= Closing: =&lt;br /&gt;
You should not have yourself a number of effects all hooked up to your resource and its factors. From here, you can add them to effect bundles/ or junction them off to buildings/ ancillaries etc.&lt;br /&gt;
&lt;br /&gt;
Do some testing, make sure things work – and then consider how you can represent your resource in the UI.&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
	<entry>
		<id>https://tw-modding.com/index.php?title=File:Pooled_Resource_Breakdown.png&amp;diff=567</id>
		<title>File:Pooled Resource Breakdown.png</title>
		<link rel="alternate" type="text/html" href="https://tw-modding.com/index.php?title=File:Pooled_Resource_Breakdown.png&amp;diff=567"/>
		<updated>2022-12-05T09:25:19Z</updated>

		<summary type="html">&lt;p&gt;Thesniperdevil: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A very top level view of the core components that are associated with Pooled Resources&lt;/div&gt;</summary>
		<author><name>Thesniperdevil</name></author>
	</entry>
</feed>