Changing border tiles within a scenario

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
User avatar
Jamie
Posts: 48
Joined: October 30th, 2011, 5:08 pm

Changing border tiles within a scenario

Post by Jamie »

I am trying to change a few border tiles within a scenario following the instructions on this page:http://wiki.wesnoth.org/TerrainMaskWML and I am having no success at all after trying many different configurations. Here's my latest effort (with most of the map redacted):

Code: Select all

    [terrain_mask]
    x,y=0,0
    mask="border_size=1
    usage="map"

 _f    , _f    , _f    , _f    , _f   
 _f    , Wog   , Wo    , Wog   , _f      # original map line is  _f  , Uh    ,Wwr    Uh  , _f
 "
	[rule]
	   old=Uh
	   new=Wog
	   terrain=Wog
	[/rule]
	[rule]
	   old=Wwr
	   new=Wo
	   terrain=Wo
	[/rule]
	[/terrain_mask]
I see there is no link to [rule] in the wml reference though there is a place-holder for one. So I have two questions:
  • 1) can this code be made to work with some tweak?
    2) is there another way to change the map border from within a scenario?
Here's what I have tried so far:
  • the whole map with x,y=1,1 instead of 0,0
    a smaller piece with border=0 with x,y set to cover just this patch
    putting the "old" codes in the mask instead of the new ones
    with and without rules
    moving the location of the final quote mark
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Changing border tiles within a scenario

Post by Anonymissimus »

Yeah, [terrain_mask] is difficult to grasp, badly documented and possibly buggy.
I think [store_locations] stores border tiles as well. (At least the code in the engine has a with_border parameter.) Then you could just use {FOREACH ...} and make the changes you want with a [switch][case] list and [terrain].
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Changing border tiles within a scenario

Post by 8680 »

Jamie wrote:I see there is no link to [rule] in the wml reference though there is a place-holder for one.
If by “wml reference” you mean the “WML Tags” sidebar, that means that you are on the page that defines [rule].
User avatar
Jamie
Posts: 48
Joined: October 30th, 2011, 5:08 pm

Re: Changing border tiles within a scenario

Post by Jamie »

Anonymissimus wrote:I think [store_locations] stores border tiles as well.
Thanks for the tip. I'll look into that.
8680 wrote:If by “wml reference” you mean the “WML Tags” sidebar, that means that you are on the page that defines [rule].
Oh, I see. Yes I found that definition left something to be desired and was looking for something more on the index and syntax pages. I didn't realize it's not linked from the "terrain_mask" page because that's where it's defined! It's helpful to know that it works that way, thanks!
Post Reply