terrain graphics file

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
inuyasha35
Posts: 32
Joined: September 24th, 2020, 2:57 am

terrain graphics file

Post by inuyasha35 »

I am trying to make a new type of terrain, I have succeeded but I can't seem to add a graphic to it, I only wan't to add one image. please help me, thank you in advance.
Pilauli
Posts: 115
Joined: August 18th, 2020, 12:56 pm

Re: terrain graphics file

Post by Pilauli »

This post and the following thread might be useful to you.
https://forums.wesnoth.org/viewtopic.ph ... 13#p493613
inuyasha35
Posts: 32
Joined: September 24th, 2020, 2:57 am

Re: terrain graphics file

Post by inuyasha35 »

I tried copy/pasting the code, but it said that the BASE_TERRAIN macro was not defined
Pilauli
Posts: 115
Joined: August 18th, 2020, 12:56 pm

Re: terrain graphics file

Post by Pilauli »

Innnteresting...

Wait, I don't see anything about a BASE_TERRAIN macro in the thread I linked to. What code do you have? Could you have meant TERRAIN_BASE instead of BASE_TERRAIN?

I think I was probably thinking of Alarantalara's second post, where "Complete code for example" says this:
Alarantalara wrote: June 22nd, 2011, 6:01 pm

Code: Select all

#ifdef EDITOR
[editor_group]
    id=terrain_tutorial
    name= _ "Terrain Tutorial"
    icon="group_custom3"
[/editor_group]
#endif

# A simple signpost
[terrain_type]
    symbol_image=../scenery/signpost
    editor_name= _ "Signpost"
    editor_group=terrain_tutorial
    id=tutorial_signpost
    string=^Esz
    aliasof=_bas
[/terrain_type]
{OVERLAY *^Esz (../scenery/signpost)}
Which means if you already have the terrain type defined, you would just need the OVERLAY part. Probably.

I am not any great expert. Or am I? I once managed to make some terrain where the graphics mostly worked, but it was for 1.10. Let me just do a quick-and-dirty copy-paste job... It works!
It looks like I made my overlays like this:

Code: Select all

{OVERLAY                 *^Ryp                                                       paper/road}
I also used transitions for the road, so when it transitions to itself, it draws more road, but the base image is a single overlaid dot. You can see an example to the left of the village in this image.
I was going to make a campaign where a storybook was bleeding into the real world, so you had a bunch of paper monsters running around and you could have patches of paper terrain:
I hope some of this helps, somehow!
inuyasha35
Posts: 32
Joined: September 24th, 2020, 2:57 am

Re: terrain graphics file

Post by inuyasha35 »

just so you know, I wan't it to be a base terrain, not an overlay.
Pilauli
Posts: 115
Joined: August 18th, 2020, 12:56 pm

Re: terrain graphics file

Post by Pilauli »

Ah, I see. Sorry.

It looks like you should use TERRAIN_BASE (not quite the same as BASE_TERRAIN :D ) if you just have one image.

If you have multiple image variants, you can use TERRAIN_BASE_RANDOM. For example, my paper terrain has several variations - one is plain paper, another has some sort of dark blot or smudge, and so on. Image files are named paper.png, paper2.png, paper3.png, and so on. (NOTE: the first image is paper.png, NOT paper1.png. I don't know why it works like that, but it does.)

Code: Select all

{TERRAIN_BASE_RANDOM     Gyp                                                        paper/paper}
If you only have one image, but you plan to add more variations later, you can still use TERRAIN_BASE_RANDOM. It will randomly choose one image from your set of one image, but you can easily add another variation by dropping an image in the folder.
Post Reply