Walkable chasm terrain -- need help

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
arobinson
Posts: 208
Joined: June 6th, 2010, 12:05 am

Walkable chasm terrain -- need help

Post by arobinson »

I am trying to write a new user campaign where a mage can turn a chasm (Qxu terrain) into a walkable terrain (a magical barrier of air to let the unit walk across) . Basically I want it to look exactly like Qxu, was probably going to submerge the unit but have a different movement and defense type than Qxu (probably mirror a cave tile - Uu)

I have tried a few things, but it never seems to want to pick up the chasm transitions, and I always get a void terrain with chasm wall transitions on the sides. Here is what I have at the moment that is not working (some lines I tried commented out).

Code: Select all

[terrain_type]
    id=airbridge
    #symbol_image=chasm-tile
    name= _ "Passable bridge of air"
    string=Qa
    aliasof=Qxu
    mvt_alias=Uu
    #mvt_alias="+,Uu"
    #def_alias="-,Uu"
    #submerge=0.4
    #unit_height_adjust=-4
    editor_group=RotE
[/terrain_type]
Is there an easier way to do this (maybe just change the movement type of a terrain in a scenario file)? If not, what must I do to get my custom tile to look like a chasm tile but with a different movement and defense value?

I may have to go with putting in a bridge instead if I cannot get this determined, but I would prefer, for story reasons, to have it be a chasm.

Thank you

Edit of course right after I posted, I got it to work like this:

Code: Select all

[terrain_type]
    id=airbridge
    symbol_image=chasm
    name= _ "Passable bridge of air"
    string=^Ba
    aliasof=Qxu
    mvt_alias="+,Uu"
    def_alias="-,Uu"
    submerge=0.4
    unit_height_adjust=-4
    editor_group=RotE
[/terrain_type]
But please let me know if there is a way to improve on this code (for example the aliasof, should I be setting this?)

Thanks
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Walkable chasm terrain -- need help

Post by zookeeper »

arobinson wrote:

Code: Select all

[terrain_type]
    id=airbridge
    symbol_image=chasm
    name= _ "Passable bridge of air"
    string=^Ba
    aliasof=Qxu
    mvt_alias="+,Uu"
    def_alias="-,Uu"
    submerge=0.4
    unit_height_adjust=-4
    editor_group=RotE
[/terrain_type]
But please let me know if there is a way to improve on this code (for example the aliasof, should I be setting this?)
That's the best best method of doing what you want that I can think of, and it looks about right to me. That's the way the impassable overlay (^Xo) works, too. The + and - in the alias definitions are redundant though.
User avatar
arobinson
Posts: 208
Joined: June 6th, 2010, 12:05 am

Re: Walkable chasm terrain -- need help

Post by arobinson »

Thank you for the feedback, that is all I wanted to know
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
dystroy
Posts: 4
Joined: July 2nd, 2023, 10:19 am

Re: Walkable chasm terrain -- need help

Post by dystroy »

Hi.
Willing to experiment for a similar problem, I copied arobinson's terrain_type block in a terrain/Terrain.cfg file in my campaign folder:

Code: Select all

[terrain_type]
    id=airbridge
    symbol_image=chasm
    name= _ "Passable bridge of air"
    string=^Ba
    aliasof=Qxu
    mvt_alias="+,Uu"
    def_alias="-,Uu"
    submerge=0.4
    unit_height_adjust=-4
    editor_group=RotE
[/terrain_type]
The terrain characteristics are right but the terrain appears as a black hexagon. How can I fix that ?
User avatar
Celtic_Minstrel
Developer
Posts: 2241
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Walkable chasm terrain -- need help

Post by Celtic_Minstrel »

What's the issue with placing your walkable chasm terrain on top of the base chasm terrain that provides the correct appearance?
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
dystroy
Posts: 4
Joined: July 2nd, 2023, 10:19 am

Re: Walkable chasm terrain -- need help

Post by dystroy »

Celtic_Minstrel wrote: July 2nd, 2023, 4:11 pm What's the issue with placing your walkable chasm terrain on top of the base chasm terrain that provides the correct appearance?
If I put both in the same location in the map file, as ^Ba Qxu, then I have either the right appearance but the tile can be entered.
If I put both as Qxu ^Ba, then I have the black hexagon.

But maybe I don't understand what you mean ?

Is there an example somewhere, maybe in a standard campaign, of this kind of modified tile ?
gnombat
Posts: 710
Joined: June 10th, 2010, 8:49 pm

Re: Walkable chasm terrain -- need help

Post by gnombat »

dystroy wrote: July 2nd, 2023, 7:08 pm Is there an example somewhere, maybe in a standard campaign, of this kind of modified tile ?
You can look in the add-on campaign Rise of the Elementalist (scenario: "Further Studies") to see the walkable chasm.
dystroy
Posts: 4
Joined: July 2nd, 2023, 10:19 am

Re: Walkable chasm terrain -- need help

Post by dystroy »

Thanks a lot @gnombat, I was able to make it work with a look at this campaign.

I'll summarize for the next reader stumbling on this question.
Here are the needed parts (in the context of a campaign):

_main.cfg

Code: Select all

{~add-ons/name_of_the_campaign/terrain}
terrain/Terrain.cfg

Code: Select all

[terrain_type]
    id=airbridge
    symbol_image=chasm
    name= _ "Passable bridge of air"
    string=^Ba
    aliasof=Qxu
    mvt_alias="+,Uu"
    def_alias="-,Uu"
    submerge=0.4
    unit_height_adjust=-4
    editor_group=RotE
[/terrain_type]
terrain/Terrain_graphics.cfg

Code: Select all

{TERRAIN_BASE Qxu^Ba chasm/regular}
In maps
Use Qxu^Ba instead of the standard Qxu tile, for example:

Code: Select all

map_data="Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Gg, Ww, Gg
Gg, Gg, Gg, 1 Gg, Gg, Gg, Gg, Qxu, Ww, Gg, Ww, Ww, Gg, Ww, Gg, Gg, Gg, Gg
Gg, Gg, Gg, Gg, Gg, Gg, Qxu^Ba, Ww, Ww, Ww, Gg, Gg, Gg, Gg, Gg, Gg, Ww, Ww
"
User avatar
Celtic_Minstrel
Developer
Posts: 2241
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Walkable chasm terrain -- need help

Post by Celtic_Minstrel »

dystroy wrote: July 2nd, 2023, 7:08 pm
Celtic_Minstrel wrote: July 2nd, 2023, 4:11 pm What's the issue with placing your walkable chasm terrain on top of the base chasm terrain that provides the correct appearance?
If I put both in the same location in the map file, as ^Ba Qxu, then I have either the right appearance but the tile can be entered.
If I put both as Qxu ^Ba, then I have the black hexagon.

But maybe I don't understand what you mean ?
Are you editing the map file manually in a text editor? If so, combining a base and overlay terrain means concatenating them without a space, as Qxu^Ba. If you put a space, the first one will be taken as a location ID instead, not a terrain.

If you edit the map in the map editor, it handles this for you correctly.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
dystroy
Posts: 4
Joined: July 2nd, 2023, 10:19 am

Re: Walkable chasm terrain -- need help

Post by dystroy »

Celtic_Minstrel wrote: July 4th, 2023, 1:20 pm Are you editing the map file manually in a text editor? If so, combining a base and overlay terrain means concatenating them without a space, as Qxu^Ba. If you put a space, the first one will be taken as a location ID instead, not a terrain.
Yes, that was the main problem. That's why I added all the files in my answer, because maybe somebody as stupid as me might come later. :mrgreen:

Thanks for the detailed explanation, I didn't know about the location ID thing.
Post Reply