What this tutorial will show you?
- How to add different effects to various ground types affecting various stats of your units during a battle.
Why?
- In the moment, terrain is effecting only the speed of a unit, even if the terrain tooltip during battles is telling you something different.
Wouldnīt it be nice if Archers standing in a forest would suffer an accuracy penalty? And charging in a dense forest shouldnīt be as effective as on flat ground like grass etc.
Tables we are working with:
DB->ground_type_to_stat_effects_tables->ground_type_to_stat_effects
and
DB->ui_unit_stats_tables->ui_unit_stats
Tools you need:
PFM 3.03 (I donīt explain how to use it, daniu description does that by far better)
Letīs get started:
1. open the data_rome2.pack with PFM
2. navigate to DB ==> expand DB ==> look for ground_type_to_stat_effects_tables ==> expand it ==> ground_type_to_stat_effects
Explanation:
affected_stat ==> well itīs the unit_stat that will be changed
ground_type ==> it the terrain that triggers the stat change
multiplier ==> defines if a stat recieves a bonus or a malus
As you can see, the only thing terrain or ground types are currently effecting are the unit speed and thats the reason there is only a unit_ground_type_movement_modifiers_tables in the DB
The difference between these two tables:
ground_type_to_stat_effects defines the stat changed without making any difference between the different unit types available, so the effect you set here is set for ALL UNITS!
unit_ground_type_movement_modifiers_tables defines the effect of terrain for different unit types, so you can finetune the universal stat effect from ground_type_to_stat_effects but itīs limited to movement speed.
For all other effects we would need unit_ground_type_(enter a stat)_modifiers_tables. Donīt know if itīs possible to add new ones.
3. Extract the table with PFM
4. Create a new mod PFM (name it, choose a folder/directory etc.)
5. Add the extracted table with PFM to your new mod
To add new stat_effect you must know the names of the different stat_effects for units that are available
You can find these here:
data_rome2.pack-> DB-> ui_unit_stats_tables-> ui_unit_stats
All available unit_stats
In our example we will add a new stat for the terrain type forest and the effect should be, that all units that have a bonus_vs_cavalry (spear units mostly) should be more effective fighting Cavalry in wood.
6. Add a new row and do the following entries:
affected_stat ==> stat_bonus_vs_cavalry
ground_type ==> forest
multiplier ==> 1,3
Now all units with a bonus_vs_cavalry will receive an additional bonus if they fight cavalry in a forest, thats it. By the way, bonus_vs_cavalry is a bonus applied to a weapon and not a unit, and the base bonus_vs_cavalry can be set under db==> melee_weapons_tables ==> melee_weapons
7. Add whatever you like, save and copy the new mod in your data folder activate it with the modmanager if you saved it as mod.pack type.
8 Enjoy your changes!
The nice thing, you will see all terrain type effects during a battle, point your mouse over a forest and wait a sec till the tooltip expands and you see that your changes are active.
As always, feel free to use the example mod in your own, play around with it and crediting me would be nice.
Download example mod:
http://www.2shared.com/file/KZbkgs_G..._terrain_.html