Terrain - Removing village healing

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
Aucrin-Ix-Seis
Posts: 12
Joined: July 8th, 2023, 6:22 pm

Terrain - Removing village healing

Post by Aucrin-Ix-Seis »

Hello there.
I want to modify the current definition of some terrains inside my custom campaign, specifically the villages definition to remove their healing effects. But I don't know what would be the preferred approach: should I modify (in some way which I haven't clear) the core definition of the terrain? Or should I define a new terrain type altogether using the same images of the core villages?

Aucrin-Ix-Seis
User avatar
beetlenaut
Developer
Posts: 2827
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Terrain - Removing village healing

Post by beetlenaut »

Village healing is set in the [terrain_type] tags. You can see them in /data/core/terrain.cfg. You will have to define your own [terrain_type] for each kind of village you need without the line that sets the healing.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Aucrin-Ix-Seis
Posts: 12
Joined: July 8th, 2023, 6:22 pm

Re: Terrain - Removing village healing

Post by Aucrin-Ix-Seis »

Thanks a lot. It worked like a charm. I needed to add the last macro to ensure the terrain kept the appearance.
This is the result:

Code: Select all

	[terrain_type]
		symbol_image=village/human-city-tile
		id=MfaW_City_Village
		name= _"Village"
		editor_name= _"Human City (no healing)"
		string=^Zhc
		aliasof=_bas, Vt
		default_base=Rr
		editor_group="wesnoth-MfaW"
	[/terrain_type]
	{NEW:VILLAGE_TOD *^Zhc village/human-city}
User avatar
Celtic_Minstrel
Developer
Posts: 2233
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Terrain - Removing village healing

Post by Celtic_Minstrel »

That's not even a village anymore, since you removed not only heals=8 but also gives_income=yes. If that's what you wanted, then that's fine, it just didn't sound like it was.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
Aucrin-Ix-Seis
Posts: 12
Joined: July 8th, 2023, 6:22 pm

Re: Terrain - Removing village healing

Post by Aucrin-Ix-Seis »

Celtic_Minstrel wrote: February 13th, 2024, 4:22 am That's not even a village anymore, since you removed not only heals=8 but also gives_income=yes. If that's what you wanted, then that's fine, it just didn't sound like it was.
Yeah, to tell you the truth it's behaving exactly as I intended. I removed the income per village for each 'side' to prevent them to affect the gold values, but this is a better solution.
I only have this weird error now:

Code: Select all

20240216 10:46:52 error config: Error while loading the map: Unknown tile in map: (Rr^Zhc) 'Rr^Zhc
But it's not fatal, the scenarios are usable.
User avatar
beetlenaut
Developer
Posts: 2827
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Terrain - Removing village healing

Post by beetlenaut »

Aucrin-Ix-Seis wrote: February 16th, 2024, 4:47 pm I only have this weird error now
It's usually a bad idea to ignore errors that don't seem to affect the game. It might work on your system, but not somebody else's, or it may only work most of the time.

It sounds to me like you are loading the scenarios before you load the terrain_type definition. If that's the problem, you probably just need to change the order in _main.cfg.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Aucrin-Ix-Seis
Posts: 12
Joined: July 8th, 2023, 6:22 pm

Re: Terrain - Removing village healing

Post by Aucrin-Ix-Seis »

beetlenaut wrote: February 16th, 2024, 6:08 pm It sounds to me like you are loading the scenarios before you load the terrain_type definition. If that's the problem, you probably just need to change the order in _main.cfg.
Done. No related errors now in the add-on. Thank you.
Post Reply