Complex(?) Terrain Filter

The place to post your WML questions and answers.

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.
Post Reply
Mabuse
Posts: 2239
Joined: November 6th, 2007, 1:38 pm

Complex(?) Terrain Filter

Post by Mabuse »

Hey, im getting mad at terrain filtering.

i have basical tried EVERYTHING, but nothing helps.
since im mostly doing try and error here, why not ask the pros to save a few valueable hours.

so what i want is to store (les say) all Grasslands, that dont have a Mountain inside a range of 5 hexes.
how would i do that?

some tries are this:

tried this but wasnt working(?)

Code: Select all

[store_locations]
        variable=XXX
        [and]
        terrain=G*
        radius=5
        [/and]
[not]
        terrain=M*
[/not]
[/store_locations]
so which one is the correct useage?

Code: Select all

[store_locations]
        variable=XXX
        terrain=G*
        [and]
        radius=5
[not]
        terrain=M*
[/not]
        [/and]
[/store_locations]
also tried this

Code: Select all

[store_locations]
        variable=XXX
        terrain=G*
        [and]
        radius=5
        terrain=!,M*
        [/and]
[/store_locations]
wont work, it loves mountains

Code: Select all

[store_locations]
        variable=XXX
        [and]
        terrain=G*
        radius=5
        [/and]
[filter_adjacent_location]
        terrain=!,M*
        count=1-6
[/filter_adjacent_location]
[/store_locations]
wont work, it loves mountains

Code: Select all

[store_locations]
        variable=XXX
        [and]
        terrain=G*
        radius=5
        [/and]
[not]
[filter_adjacent_location]
        terrain=M*
        count=1-6
[/filter_adjacent_location]
[/not]
[/store_locations]

so really, im stuck here.

ofc there may be also other sources of failure involved, but i just ask a wml pro to help me out with this

the next step would be then to store all gresses with no mountans in 5 hexes and no enemies of side 1 in a radius of 10, but the latter can be solved, however, atm i have problem with the mountains, all i generate seem to make mountrain the preferred terrain :roll: :augh:



so i want a pro that says:

hey, pal, THIS is the correct useage CODE: ........

then i continue try and error with this approach :)
The best bet is your own, good Taste.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Complex(?) Terrain Filter

Post by tekelili »

Mabuse wrote:so what i want is to store (les say) all Grasslands, that dont have a Mountain inside a range of 5 hexes.
how would i do that?
I have not read all your code examples, just in base to your desires I would try this (not tested)

Code: Select all

[store_locations]
    terrain=G*
    [not]
        terrain=M*^*
        radius=5
    [/not]
    variable=terrain_to_change
[/store_locations]
Edit: Btw I hope we are talking about 1.12 because 1.13 is not a good field when you are not sure how things should be done and wich is expected behavior ;)
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
Mabuse
Posts: 2239
Joined: November 6th, 2007, 1:38 pm

Re: Complex(?) Terrain Filter

Post by Mabuse »

yes talking about 1.12.

so thx for your advice, i think i already tried that, but it was in one of the most early stages where other errors occured as well, logically it seems the best solution, so i try it out and hopefully can solve that - and give you a postive feedback :)
The best bet is your own, good Taste.
Mabuse
Posts: 2239
Joined: November 6th, 2007, 1:38 pm

Re: Complex(?) Terrain Filter

Post by Mabuse »

Hey, it works. :D

thx for your post, i also had to root out a lot of other things that caused bugs. :)
The best bet is your own, good Taste.
Post Reply