Now that we have:
1. Created a .pack file
2. Properly added a script to it
3. Created a basic framework for our code
4. Added logs to make sure our code is running
5. Enabled logging
6. Checked the logs to see if the code is actually running
It's time to create our
Effect Bundle!
These are a type of game data, which contains various effects. We can create an effect bundle, and assign to it things such as disable/enable/decrease/increase casualty replenishment, +/- leadership, things like that. And we don't have to touch any code for that, outside of adding the effect bundle to the faction (targets can be anything; units, characters, regions, settlements, etc) itself.
What we are going to do, is something nifty. We're going to create an effect bundle with no effects attached, as a way to tell if we've already i
To do this, we need to create 2 db tables:
effects_bundles
And
effect_bundles_to_effect_junctions
To do this: Right-click on the .pack file ->
Create... ->
Create DB -> Type in effect_bundles in the bottom text entry bit, to filter out 99% of the table names -> Select
effect_bundles_tables from the drop-down
This will create the
effect_bundles db table. The name by default is the same as your .pack file. Select the db table, and you'll see it on the right-hand pane. There will be nothing in it, so you can either add a blank row (right-click ->
Add Row) and copy-paste the text below into it. Or just copy the text and press ctrl+shift+v in rpfm to add a new row and paste the code at the same time.
Code: Select all
aaafyty_high_ranked_chaos_armies 0 1 true true false
Notice the tab spacing in that line of text. The db table is basically a collection of strings, with each column's string being separated by a tab. If we select a row (or even multiple rows!) we copy that exact formatting. And we can paste data back with the same formatting too. Which saves having to manually enter everything.
Keep note of the effect bundle key. In my case, I have it as
aaafyty_high_ranked_chaos_armies but you may have something different. We will be using this in our code when applying the effect bundle to the chaos factions.
Now, time to do the same process but for the
effect_bundles_to_effect_junctions db table.
And here's the text, to save you some time:
Code: Select all
aaafyty_high_ranked_chaos_armies wh_main_effect_force_all_campaign_experience_base_all faction_to_force_own 9.0000 start_turn_completed
Looks really arcane, huh? Let's break it down.
The first entry is the key of the effect bundle we created earlier. The second is the key of the effect we want. There are lots of effects, and you can see them by double-clicking on the
Effect Key entry, which will present a drop-down list you can pick from.
The third key is the
Effect Scope. It's a jargon term for source -> destination. Our effect bundle will be applied to a faction, and we want it to effect every army in that same faction. So we use the scope of
faction to force own: Add the bundle to the faction -> Apply the effect to the faction's army forces.
Finally, we move onto the last stage.