lipk's TerrainWML problems
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.
lipk's TerrainWML problems
I'm working on some custom terrain.
I have the following code:
Now the problem is: the center key inside image seems to be completely ignored, the overlay is put on the top left corner. If I include the image tag directly in terrain_graphics, it just works fine. Why it does not this way?
I have the following code:
Code: Select all
[terrain_graphics]
[tile]
x,y=0,0
type=Zzzz
has_flag=Custom_flag
[image]
name=anim-1.png,anim-2.png,anim-3.png
center=36,36
[/image]
[/tile]
[/terrain_graphics]
Last edited by lipk on January 15th, 2012, 3:58 pm, edited 1 time in total.
- Alarantalara
- Art Contributor
- Posts: 786
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: engine ignores 'center' key inside 'image' tag?
I'm not sure what the reason is, but it is a deliberate decision and not a bug (check out line 383-386 of builder.cpp if you're interested). It should probably be documented though - I'll go do that now.
Re: engine ignores 'center' key inside 'image' tag?
Ummm.... bad news for me. Btw, the water animation macros do use tile-image-center structures, so those should be changed then too. (Although it certainly doesn't make a difference there, or we'd have noticed it already )
Re: lipk's TerrainWML problems
Now this really smells like a bug.
As you can see, image centering works fine for every direction but north-east.
Code: Select all
[terrain_graphics]
map="
, 2,
1, 1
, 2
1, 1
, 2,"
probability=1
[tile]
pos=2
type=Qxga
set_no_flag=comet
[/tile]
rotations=n,ne,se,s,sw,nw
[image]
name=comet-@R0.png
[/image]
[/terrain_graphics]
- Alarantalara
- Art Contributor
- Posts: 786
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: lipk's TerrainWML problems
Given the probability = 1 you have there, I am assuming that what you posted is not a copy of what's producing the results.
Can you post a copy of the relevant pieces of the add-on in an archive? (terrain, terrain graphics and images)
Can you post a copy of the relevant pieces of the add-on in an archive? (terrain, terrain graphics and images)
Re: lipk's TerrainWML problems
Here you go.
Just extract it to your add-on folder, the incriminated terrain should appear in the editor.
Just extract it to your add-on folder, the incriminated terrain should appear in the editor.
- Attachments
-
- terrain_bug_addon.tar.gz
- (12.71 KiB) Downloaded 123 times
- Alarantalara
- Art Contributor
- Posts: 786
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: lipk's TerrainWML problems
This prevents the problem you're having.
Code: Select all
#comet overlays
[terrain_graphics]
map="
1,
,.
1
,.
1"
probability=50
[tile]
pos=1
type=Qxga
set_no_flag=comet
[/tile]
rotations=n,ne,se,s,sw,nw
[image]
name=comet_t-@R0-7.png
[/image]
[/terrain_graphics]