My little terrain problem (exists again)
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.
My little terrain problem (exists again)
http://www.wesnoth.org/forum/viewtopic.php?p=152283
Please excuse the kind of meta-thread, but I did not get an answer in the OT forum about this.
Just present the problem anew in this thread. It's not strictly a meta-thread since you're trying to get a legitimate question answered independent of what happened in the other thread. This way people don't have to hunt for the question you're trying to ask. -mod
PS give your topic a better title
Please excuse the kind of meta-thread, but I did not get an answer in the OT forum about this.

Just present the problem anew in this thread. It's not strictly a meta-thread since you're trying to get a legitimate question answered independent of what happened in the other thread. This way people don't have to hunt for the question you're trying to ask. -mod
PS give your topic a better title
First read, then think. Read again, think again. And then post!
Moderator: I will consider that next time.
Same problem gets me again. I simply have no idea why this might not work. But I´m new to this part of WML, so it mustn´t be automatically a difficult issue. (all that appears are black hexes)
Anyway, here is it:
Please don´t mind odd macro names now, they are not going for real.
Same problem gets me again. I simply have no idea why this might not work. But I´m new to this part of WML, so it mustn´t be automatically a difficult issue. (all that appears are black hexes)
Anyway, here is it:
Code: Select all
#define ADJACENT_SIMPLE_MOTHERBOARD
[terrain_graphics]
map="
!xyz
1"
[tile]
pos=1
type=x
image=motherboard-@R0
[/tile]
rotations=n,ne,se,s,sw,nw
[/terrain_graphics]
#enddef
# !xyz : Terrains for y and z do not exist this time, but I don´t know how to
# make sure that it applies to void but not to x,y and z, which will exist in future.
# (does it cause a problem if they don´t exist?)
#
# The tile should be placed on the same tile as the base, I wanted that so.
#define ADJACENT_2FL_PROB_MOTHERBOARD
#this will be used for follwoing to have transistion variations
[terrain_graphics]
map="
!xyz
1
!xyz!
"
[tile]
pos=1
type=x
image=motherboard-ne-se
[/tile]
[/terrain_graphics]
[terrain_graphics]
map="
!xyz
1
!xyz
"
[tile]
pos=1
type=x
image=motherboard-nw-sw
[/tile]
[/terrain_graphics]
#enddef
{ADJACENT_MOTHERBOARD}
{ADJACENT_2FL_PROB_M}
First read, then think. Read again, think again. And then post!
I had never seen map= used like that, until now when I checked the wiki and the new wikified terrain graphics WML documentation where I saw something like that. What I'd therefore do first would be trying something a bit more...normal.
So this:
...would become:
I'm not sure whether that would work either, it was just the first thing that caught my attention.
So this:
Code: Select all
[terrain_graphics]
map="
!xyz
1"
[tile]
pos=1
type=x
image=motherboard-@R0
[/tile]
[/terrain_graphics]
Code: Select all
[terrain_graphics]
map="
2
. .
1"
[tile]
pos=2
type=!xyz
[/tile]
[tile]
pos=1
type=x
image=motherboard-@R0
[/tile]
[/terrain_graphics]
I made your change. I also changed the test file that it displays a message when the terrain is known. The message did not appear, but I can´t see something wrong.
Oh, and these are the terrain base macros I used.
Code: Select all
[terrain]
image=motherboard-1
id=mainboard
name=_"Motherboard"
char=x
aliasof=g
[/terrain]
{TERRAIN_BASE_PROB x motherboard-1 34}
{TERRAIN_BASE_PROB x motherboard-2 33}
{TERRAIN_BASE_PROB x motherboard-3 33}
First read, then think. Read again, think again. And then post!
No clues? 
EDIT:
Wait. Just the images are not found, I figured out. Seems like something must be wrong here:
{@campaigns/terrain/terrain-graphics.cfg}
{@campaigns/terrain}
{@campaigns/terrain/images}
The folder for the testing campaign is named terrain and an images subdirectory exists in it, where the images are saved.
Do I need [images] ? Or what?

EDIT:
Wait. Just the images are not found, I figured out. Seems like something must be wrong here:
{@campaigns/terrain/terrain-graphics.cfg}
{@campaigns/terrain}
{@campaigns/terrain/images}
The folder for the testing campaign is named terrain and an images subdirectory exists in it, where the images are saved.
Do I need [images] ? Or what?
First read, then think. Read again, think again. And then post!
I´ve added the [images] tag even if I don´t know what it does.
I made a test with PLACE_IMAGE and the result was that the images are found. So I strongly suspect that it´s the WML.
I made a test with PLACE_IMAGE and the result was that the images are found. So I strongly suspect that it´s the WML.
Code: Select all
#define ADJACENT_MOTHERBOARD
[terrain_graphics]
map="
2
. .
1"
[tile]
pos=2
type=!xyz
[/tile]
[tile]
pos=1
type=x
image=motherboard-@R0
[/tile]
rotations=n,ne,se,s,sw,nw
[/terrain_graphics]
#enddef
#define ADJACENT_2FL_PROB_M
#this will be used for follwoing to have transistion variations
[terrain_graphics]
map="
2
1 .
2
"
[tile]
pos=2
type=!xyz
[/tile]
[tile]
pos=1
type=x
image=motherboard-ne-se
[/tile]
[/terrain_graphics]
[terrain_graphics]
map="
2
. 1
2
"
[tile]
pos=2
type=!xyz
[/tile]
[tile]
pos=1
type=x
image=motherboard-nw-sw
[/tile]
[/terrain_graphics]
#enddef
{ADJACENT_MOTHERBOARD}
{ADJACENT_2FL_PROB_M}
First read, then think. Read again, think again. And then post!
I took this on again. The 1.1.2 version of the game now says: "Illegal character in map found. Scenario cannot be loaded."
character is 'x'.
#ifdef CAMPAIGN_TERRAINTEST
character is 'x'.
#ifdef CAMPAIGN_TERRAINTEST
Code: Select all
{@campaigns/terraintest/images}
[terrain]
id=motherboard
image=motherboard-1
name=_"Motherboard"
char=x
aliasof=g
[/terrain]
{TERRAIN_BASE x motherboard-1}
{@campaigns/terraintest} #this loads the scenario
#endif
First read, then think. Read again, think again. And then post!
I solved the problem with invalid characters.
And I now managed to define a working motherboard terrain. Just the images did not appear.
Interesting: I inserted 'grassland' as the image in the TERRAIN_BASE macro and there is still nothing.
And I now managed to define a working motherboard terrain. Just the images did not appear.
Interesting: I inserted 'grassland' as the image in the TERRAIN_BASE macro and there is still nothing.
First read, then think. Read again, think again. And then post!
Very much sorry for the triple posting.
I do not get what is wrong here.
I do have folders scenarios and images and there are the right files in it, with matching filenames.
Just the image is not found.
I do not get what is wrong here.
Code: Select all
{@campaigns/terraintest/images}
[terrain]
image=motherboard-1
name=_"Motherboard"
aliasof=g
char=x
[/terrain]
{TERRAIN_BASE x motherboard-1}
{@campaigns/terraintest/scenarios}
Just the image is not found.
First read, then think. Read again, think again. And then post!
Terrain images are searched in images/terrain/ by default. So, putting terrain graphics (motherboard-1.png in this case) in terraintest/images/terrain/ should do the trick.toms wrote:I do have folders scenarios and images and there are the right files in it, with matching filenames.
Just the image is not found.
"WML includes" (the line {@campaigns/terraintest/images}) should also only be used on WML or maps, since it includes the contents of the file or files to the point where the include is used. Think how this is usually used in map_data and you'll see why it doesn't make sense for graphics. If you'll need to include an additional images directory for some reason, you have to use [binary_path].