how to filter terrain groups? (all flat, all deep water etc)
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
how to filter terrain groups? (all flat, all deep water etc)
StandardLocationFilter allows filtering terrain types by terrain code, including wildcards
but that's pretty much it
is there any way to filter terrains by defense/movement category, as they are listed in unit type descriptions?
namely these 15 categories as listed in movetypes:
deep_water, shallow_water, reef, swamp_water, flat, sand, forest, hills, mountains, village, castle, cave, frozen, unwalkable, fungus, impassable
they seem to correspond 1-to-1 to values in "alias of" column of TerrainCodeTableWML table but could not find a way to filter by these either
but that's pretty much it
is there any way to filter terrains by defense/movement category, as they are listed in unit type descriptions?
namely these 15 categories as listed in movetypes:
deep_water, shallow_water, reef, swamp_water, flat, sand, forest, hills, mountains, village, castle, cave, frozen, unwalkable, fungus, impassable
they seem to correspond 1-to-1 to values in "alias of" column of TerrainCodeTableWML table but could not find a way to filter by these either
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
- beetlenaut
- Developer
- Posts: 2832
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: how to filter terrain groups? (all flat, all deep water etc)
It doesn't seem to be possible. It might be too late to make a feature request for 1.18, but I'm not sure. However, using terrain codes probably wouldn't be that hard. I think I would just make macros for each type like this:
I used the terrain code list and Ctrl^F to highlight all instances of the word "village" or "flat" on the web page.
Code: Select all
#define T_VILLAGE
*^V*
#enddef
#define T_FLAT
G*,R*,I*,Ur*,*^B*
#enddef
...
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: how to filter terrain groups? (all flat, all deep water etc)
apparently that's how it is done in mainlinebeetlenaut wrote: ↑November 5th, 2023, 10:47 pmI think I would just make macros for each type like this:
... ... ...
the problem is that it may fail on maps with custom terrains unless makers of such maps strictly adhere to mainline's style of terrain codes
also consider terrain categories like shallow water and coastal reef - they use same terrain code style while being different (and mutually exclusive) terrain categories for the purposes of determining unit's base defense and movement cost
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
- Celtic_Minstrel
- Developer
- Posts: 2290
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: how to filter terrain groups? (all flat, all deep water etc)
There isn't any general way for arbitrary terrain categories, but you can detect the key mechanical terrain categories with a formula:
Maybe filtering by terrain alias would be a reasonable feature request – something like a new "alias" key that means "match terrains that alias to these terrains".
Code: Select all
formula=keep
formula=castle
formula=village