First time making complex terrain graphics, pls 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
BajMic
Posts: 46
Joined: January 24th, 2023, 1:22 am

First time making complex terrain graphics, pls help.

Post by BajMic »

Hello,

I am trying to implement some big pieces into my terrain graphics, but the matter is particularly confusing to me. Could you please take a look if there is anything obvious that I am doing wrong?

Code: Select all

[terrain_graphics]
        map="
* , * , * , * , * , 1 , * , * , * , * , * , * 
, * , * , * , 1 , 1 , 1 , 1 , * , * , * , * , * 
* , * , 1 , 1 , 1 , * , 1 , 1 , 1 , * , * , *
, 1 , 1 , 1 , * , * , * , * , 1 , 1 , 1 , * , *
* , 1 , * , * , * , * , * , * , * , 1 , 1 , *
, * , * , * , * , * , * , * , * , * , * , 1 , *
* , 1 , * , * , * , * , * , * , * , * , * , 1
, * , * , * , * , * , * , * , * , * , * , * , 1
"
        [tile]
            pos=1
            type=Rb^Qov
            set_no_flag=overlay
        [/tile]

        probability=100

	[image]
 		name="terrain/Dam.png"
            	layer=0
            	base=90,160
            	center=90,144
    	[/image]
[/terrain_graphics]
gnombat
Posts: 722
Joined: June 10th, 2010, 8:49 pm

Re: First time making complex terrain graphics, pls help.

Post by gnombat »

terrain/Dam.png should probably just be Dam.png.
https://wiki.wesnoth.org/TerrainGraphicsWML wrote:In terrain graphics, all images are assumed to be relative to images/terrain/. For example, writing 'image=grassland.png' means that the image file is images/terrain/grassland.png.
I'm not sure about the rest of it...
BajMic
Posts: 46
Joined: January 24th, 2023, 1:22 am

Re: First time making complex terrain graphics, pls help.

Post by BajMic »

I checked the pathway. I had a "scenario/images/terrain/dam.png" directory, then moved the file to "scenario/images/dam.png", changed the directory accordingly and now it works. Strange, but at least it works now. Thanks, gnombat.
gnombat
Posts: 722
Joined: June 10th, 2010, 8:49 pm

Re: First time making complex terrain graphics, pls help.

Post by gnombat »

That still doesn't sound right - what is "scenario/"? Is that just supposed to represent the name of your add-on?

Also, is it "Dam.png" (uppercase first letter) or "dam.png" (lowercase)? It may not matter on Windows, but if the name does not match exactly you may end up with an add-on that does not work for Linux users (because Linux uses a case-sensitive filesystem).
BajMic
Posts: 46
Joined: January 24th, 2023, 1:22 am

Re: First time making complex terrain graphics, pls help.

Post by BajMic »

The name of the file matches. I was just sloppy upper/lowercase in the post.

Ok, so my add-on is currently in the
wesnoth/data/campaigns/Test_campaign
folder. Inside that folder I also have
Test_campaign/images/terrain
folder.

If I were to hazard a guess, this directory is similar to the one in core data. I.e.,
wesnoth/data/core/images/terrain
. Would it be possible, that the game confused the folders?
User avatar
Ravana
Forum Moderator
Posts: 3070
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: First time making complex terrain graphics, pls help.

Post by Ravana »

[binary_path] specifies where game looks for images.

No addon can be in wesnoth/data. Addons can be found in userdata folder.
BajMic
Posts: 46
Joined: January 24th, 2023, 1:22 am

Re: First time making complex terrain graphics, pls help.

Post by BajMic »

If I may, I have another question.

I can't find it in the documentation - how am I supposed to deal with overlapping tilesets, like here below? The tiles overlap and concaves are missing, but I can't really understand how flags work. How can I fix it?

Code: Select all

[terrain_graphics]
        map="
, *
*
, 1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=tl
        [/tile]

        probability=50
	[image]
 		name="chasm/regular-convex-tl.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
, *
*
, 1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=tl
        [/tile]

        probability=100
	[image]
 		name="chasm/regular-convex2-tl.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
*
,  *
1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=tr
        [/tile]

        probability=50
	[image]
 		name="chasm/regular-convex-tr.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
*
,  *
1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=tr
        [/tile]

        probability=100
	[image]
 		name="chasm/regular-convex2-tr.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
*
,  1
1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=br
        [/tile]

        probability=50
	[image]
 		name="chasm/regular-concave-br.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
*
,  1
1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=br
        [/tile]

        probability=100
	[image]
 		name="chasm/regular-concave2-br.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
, *
1
, 1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=bl
        [/tile]

        probability=50
	[image]
 		name="chasm/regular-concave-bl.png"
    	[/image]

[/terrain_graphics]

[terrain_graphics]
        map="
, *
1
, 1
"
        [tile]
            pos=1
            type=*^Qov
            set_no_flag=bl
        [/tile]

        probability=100
	[image]
 		name="chasm/regular-concave2-bl.png"
    	[/image]

[/terrain_graphics]
Attachments
Concaves are missing, because they are to close and overlap, but I don't understand how to prevent it with the flags.
Concaves are missing, because they are to close and overlap, but I don't understand how to prevent it with the flags.
Post Reply