So you want to implement your "Create Armor-Ripping Flesh-Eating Mars-Humanoid-Trap" spell in Tactical combat and want your creation to only be able to grow in tactical forest tiles. But adding <ValidTerrainType>Tactical_Forest</ValidTerrainType> to your spell is just not working no matter what else you try and it's giving you hypertension, constipation, and an aneurysm ... so what do you do???
Sit sown. Breathe. Have a cup of chamomile tea. Relax. Because it works -- it really does.
VaildTerrainType? Hunhh??
Aren't all terrain types valid by default? The short answer is YES, and so is the long answer. So adding ValidTerrainType to a spell def just doesn't make logical sense. One might postulate that if one starts with all types being valid, then one might think to add tags that INVALIDATE target terrain types as you please. But, really, what do I know?
How It Works -- But Don't Ask Why It Works This Way
Terrain Categories are like buckets, each containing one ore more Terrain Types, or blocks. For instance, the Land Category contains the Types Land, DesertTerrain, Rugged_Land, HillsTerrain, SwampTerrain, etc.
Lets looks at the spell Lower Land. It's a strategic layer spell from the terraform book and it works. Here's a bit of code:
<ValidTerrainType>HillsTerrain</ValidTerrainType>
<ValidTerrainCategory>Mountain</ValidTerrainCategory>
Well that's odd; if you look at TerrainTypes.xml you see that indeed HillsTerrain is part of the Land category:
<TerrainType InternalName="HillsTerrain">
<DisplayName>Hills</DisplayName>
<MaxHeight>120</MaxHeight>
<MinHeight>55</MinHeight>
<MovementCost>20</MovementCost>
<Category>Land</Category> ...
Here's how it works: when you specifically VALIDATE a category (remember though, it's already valid by default,) you are also INVALIDATING all of the other categories, unless you specifically VALIDATE them again.
So in our Lower Land example above, what is actually happening is this: we are VALIDATING the Mountain category, thus INVALIDATING all other terrain categories, so we then have to VALIDATE the HillsTerrain type -- so now this spell may only target hills and mountains!! Yay!
...And Tactical Mode, you ask?
All tactical terrain types are in the Land category. So if you want your man-eating plant from above to only be cast in tactical forest tiles, add this to your SpellDef:
<ValidTerrainType>Tactical_Forest</ValidTerrainType>
<ValidTerrainCategory>Mountain</ValidTerrainCategory>
It works.
Don't ask me how.