lipk's TerrainWML problems

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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

Postby lipk » January 8th, 2012, 7:32 am

I'm working on some custom terrain.
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]

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?
Last edited by lipk on January 15th, 2012, 3:58 pm, edited 1 time in total.
User avatar
lipk
Developer
 
Posts: 631
Joined: July 18th, 2011, 1:42 pm
Location: Here and there and everywhere

Re: engine ignores 'center' key inside 'image' tag?

Postby Alarantalara » January 8th, 2012, 4:31 pm

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.
User avatar
Alarantalara
macOS Packager
 
Posts: 780
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: engine ignores 'center' key inside 'image' tag?

Postby lipk » January 8th, 2012, 6:36 pm

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 :wink: )
User avatar
lipk
Developer
 
Posts: 631
Joined: July 18th, 2011, 1:42 pm
Location: Here and there and everywhere

Re: lipk's TerrainWML problems

Postby lipk » January 15th, 2012, 4:47 pm

Now this really smells like a bug.

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]

wesnoth-terrain-bug.png


As you can see, image centering works fine for every direction but north-east.
User avatar
lipk
Developer
 
Posts: 631
Joined: July 18th, 2011, 1:42 pm
Location: Here and there and everywhere

Re: lipk's TerrainWML problems

Postby Alarantalara » January 15th, 2012, 8:43 pm

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)
User avatar
Alarantalara
macOS Packager
 
Posts: 780
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: lipk's TerrainWML problems

Postby lipk » January 16th, 2012, 4:02 pm

Here you go.
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 64 times
User avatar
lipk
Developer
 
Posts: 631
Joined: July 18th, 2011, 1:42 pm
Location: Here and there and everywhere

Re: lipk's TerrainWML problems

Postby Alarantalara » January 21st, 2012, 5:59 pm

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]
User avatar
Alarantalara
macOS Packager
 
Posts: 780
Joined: April 23rd, 2010, 8:17 pm
Location: Canada


Return to WML Workshop

Who is online

Users browsing this forum: No registered users and 2 guests