Playing with terrains

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
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Playing with terrains

Post by Geos »

I made a new terrain, which I attach here

Code: Select all

[terrain]
	symbol_image=cementery
	id=cementery
	name= _ "Cementery"
	recruit_onto=true
	recruit_from=true
	string = Cm
[/terrain]

{TERRAIN_BASE Cm cementery}
Is working fine, but units can't move through the terrain. I went through the WML documentation about terrain, but saw no attribute related with movement cost of the terrain.
By the way, will there be a way to make this terrain to recruit ONLY undead?

Thank you
That's ridiculous, dragons have no windows...
User avatar
Espreon
Inactive Developer
Posts: 630
Joined: June 9th, 2007, 4:08 am

Re: Playing with terrains

Post by Espreon »

You need an "aliasof=(then the terrain code that it is an alias of)".

Are you trying to make the Cemetery a place to recruit things?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Playing with terrains

Post by AI »

So, if you want it to be castle, you want it to be an alias of 'Ch', in case it shouldn't be so defensible, maybe grassland? ('Gg')
User avatar
Geos
Posts: 115
Joined: March 20th, 2008, 1:58 pm
Location: Italy

Re: Playing with terrains

Post by Geos »

Yes, now I works.
I made it allias of Savanna, that is like saying grassland. That's the idea, having a recruiting not defendable place. My only issue would be to find a way to allow only certain units to be recruited there. Maybe altering the recruiting list in an event in the scnario, I don't know... Any idea?
That's ridiculous, dragons have no windows...
megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: Playing with terrains

Post by megane »

Yes, you need an event that changes the leader's recruit list, so a moveto filtered on terrain.

Edit: also, I believe it's standard for custom terrains to have y's and z's in them (so yours would be Gy or maybe Yc), just in case mainline makes an, uh, merman castle would be Cm I guess? Yeah. :|
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl
User avatar
Iris
Site Administrator
Posts: 6799
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Playing with terrains

Post by Iris »

Geos wrote:Yes, now I works.
I made it allias of Savanna, that is like saying grassland. That's the idea, having a recruiting not defendable place. My only issue would be to find a way to allow only certain units to be recruited there. Maybe altering the recruiting list in an event in the scnario, I don't know... Any idea?
It's not good practice to double-alias a terrain.

Double-aliasing: aliasing a terrain to other type that is by itself an alias.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Dratsab
Posts: 11
Joined: August 7th, 2007, 3:24 am

Re: Playing with terrains

Post by Dratsab »

I've had some problems with terrains myself. I put a new terrain I made (wooden deck of a pirate ship) in the images/terrain folder, and then entered in a line like the OP did in terrains.cpg, but the game will not recognize the terrain, and the map just won't work.

More wierd than that, I try putting the terrain in the main terrain images file and try to use the editor, and every time I try to make a map using the "deck.png" I created, it shows it correctly in the minimap in the top right of the editor, and when I press the mouse button to place it, I see the tile and it looks like the deck, but when I let go of the map button so it tosses it in there, the editor still inserts the graphics of "void", even though if I scroll my cursor over it the thing says "Deck (Grassland) in the top right".

However, if I give the image file of deck the name of an already existing terrain type (like dirt.png), it works, but I don't want to replace the name of a stock terrain for Wesnoth.

I literally spent five hours yesterday trying to figure out the knacks of this terrain stuff and trying new things, and I'm stumped. Do I have to make certain transition terrain graphics first? (I thought I tested that).

Anyways, ideas?
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Re: Playing with terrains

Post by Mist »

You did not write config file describing the terrainand how it's supposed to be drawn. See [w]TerrainWML[/w]
Somewhere, between the sacred silence and sleep.
Disorder.
Dratsab
Posts: 11
Joined: August 7th, 2007, 3:24 am

Re: Playing with terrains

Post by Dratsab »

The link took me to the stuff regarding the "terrain" tag, which I did do. I filled in values wherever possible, even if its just to declare certain things as "false" even though that appears to be default. The map works until I replace any tile with a "Y9" string (i.e. my new "deck" tile) and the terrain.cfg I am using does appear to be read as it is in the main cfg file.

Is there a different sort of config file I need to write besides the terrain.cfg showing the code like so:

Code: Select all


[terrain]
    symbol_image=deck
    editor_image=deck
    id=deck
    name= _ "Deck"
    string=Y9
    unit_height_adjust=1
    light=false
    heals=false
    gives_income=false
    recruit_onto=false
    recruit_from=false
    editor_group=flat
    aliasof=Gg
[/terrain]

{TERRAIN_BASE       Gg                  deck}

edited to change: noticed error, though same problem persists
User avatar
Mist
Inactive Developer
Posts: 753
Joined: February 15th, 2007, 8:44 am
Location: Milton Keynes, UK

Re: Playing with terrains

Post by Mist »

I'm pretty sure you can't use 'Y9' as terrain string, IIRC numbers are reserved for player sides and string itself can consist of mixed case letters only and overlay symbol(^). Try replacing the string with 'Ydck' or something and see if it works.
Somewhere, between the sacred silence and sleep.
Disorder.
Dratsab
Posts: 11
Joined: August 7th, 2007, 3:24 am

Re: Playing with terrains

Post by Dratsab »

Oh well, didnt work, wonder what the heck is wrong with it, geez I've tried everything, have spent at least 8 hours tinkering with this stuff.

edited to add: appreciated the help btw
Post Reply