Walkable chasm terrain -- need help
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.
Walkable chasm terrain -- need help
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).
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:
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
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]
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]
Thanks
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
Campaigns:
Re: Walkable chasm terrain -- need help
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.arobinson wrote:But please let me know if there is a way to improve on this code (for example the aliasof, should I be setting 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]
Re: Walkable chasm terrain -- need help
Thank you for the feedback, that is all I wanted to know
Running Wesnoth 1.12.4 on Mac OSX 10.10
Campaigns:
Campaigns:
Re: Walkable chasm terrain -- need help
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:
The terrain characteristics are right but the terrain appears as a black hexagon. How can I fix that ?
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]
- Celtic_Minstrel
- Developer
- Posts: 2241
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Walkable chasm terrain -- need help
What's the issue with placing your walkable chasm terrain on top of the base chasm terrain that provides the correct appearance?
Re: Walkable chasm terrain -- need help
If I put both in the same location in the map file, asCeltic_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?
^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 ?
Re: Walkable chasm terrain -- need help
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
terrain/Terrain.cfg
terrain/Terrain_graphics.cfg
In maps
Use Qxu^Ba instead of the standard Qxu tile, for example:
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}
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]
Code: Select all
{TERRAIN_BASE Qxu^Ba chasm/regular}
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
"
- Celtic_Minstrel
- Developer
- Posts: 2241
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Walkable chasm terrain -- need help
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, asdystroy wrote: ↑July 2nd, 2023, 7:08 pmIf I put both in the same location in the map file, asCeltic_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?^Ba Qxu
, then I have either the right appearance but the tile can be entered.
If I put both asQxu ^Ba
, then I have the black hexagon.
But maybe I don't understand what you mean ?
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.
Re: Walkable chasm terrain -- need help
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.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, asQxu^Ba
. If you put a space, the first one will be taken as a location ID instead, not a terrain.
Thanks for the detailed explanation, I didn't know about the location ID thing.