Error with custom terrain
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.
-
- Posts: 110
- Joined: November 15th, 2005, 5:26 am
Error with custom terrain
I'm trying to implement a custom terrain based on the roving ship keep idea in the Useful WML Fragments wiki.
Here's the page in question:
http://www.wesnoth.org/wiki/WML_Scenari ... rom_a_ship
So I've implemented the following code, but I keep getting error messages. Note that the previous two custom terrains work fine. Here's the block of code that, when included in my campaign, breaks the whole thing.
The error message is:
ERROR DETAILS:
Missing closing tag for terrain at /Users[...]/Age_of_Axes.cfg:36 at /Users[...]/Age_of_Axes.cfg:50
I figure I'm not doing something right with the terrain, but since I copy-pasted it from the fragments page, I really don't know what could be wrong.
Here's the page in question:
http://www.wesnoth.org/wiki/WML_Scenari ... rom_a_ship
So I've implemented the following code, but I keep getting error messages. Note that the previous two custom terrains work fine. Here's the block of code that, when included in my campaign, breaks the whole thing.
Code: Select all
#ifdef CAMPAIGN_AGE_OF_AXES
[terrain]
symbol_image=swampwater
id=troll_spawn
name= _ "Spawning Grounds"
char=y
aliasof=w
recruit_onto=true
recruit_from=true
[/terrain]
{TERRAIN_BASE y swampwater}
[terrain]
symbol_image=dirt
id=summoning_dirt
name= _ "Summoning Circle"
char=x
aliasof=g
recruit_onto=true
recruit_from=true
[/terrain]
{TERRAIN_BASE x dirt}
# THIS IS THE PART THAT BREAKS
# \/\/\/\/
[terrain]
id=ship_keep
name= _ "Dock"
image=coast.png
char=z
aliasof=c
submerge=0.4
unit_height_adjust=-4
recruit_from=true
[/terrain]
{TERRAIN_BASE_PROB z coast3 30}
{TERRAIN_BASE_PROB z coast2 30}
{TERRAIN_BASE z coast}
{TERRAIN_ADJACENT -202 z !cz coast}
{@campaigns/Age_of_Axes/scenarios}
{@campaigns/Age_of_Axes/maps}
{@campaigns/Age_of_Axes/utils.cfg}
[+units]
{@campaigns/Age_of_Axes/units}
{@campaigns/Age_of_Axes/race.cfg}
[/units]
#endif
[binary_path]
path=data/campaigns/Age_of_Axes/
[/binary_path]
ERROR DETAILS:
Missing closing tag for terrain at /Users[...]/Age_of_Axes.cfg:36 at /Users[...]/Age_of_Axes.cfg:50
I figure I'm not doing something right with the terrain, but since I copy-pasted it from the fragments page, I really don't know what could be wrong.
you probably need to close:
with
at the end of the code
Code: Select all
#ifdef CAMPAIGN_AGE_OF_AXES
Code: Select all
#endef (or something like that, rusty on that bit of WML)
Actually, #endif, and he already has it.Ranger M wrote:Code: Select all
#endef (or something like that, rusty on that bit of WML)
Even as the fingers of the two hands are equal, so are human beings equal to one another. No one has any right, nor any preference to claim over another. You are brothers. - Muhammed
Code: Select all
[+units]
(path)
[/units]
Code: Select all
[units]
(path)
[/units]
First read, then think. Read again, think again. And then post!
-
- Posts: 110
- Joined: November 15th, 2005, 5:26 am
It appears that the macro that I had copy-pasted into the scenario as part of the ship thing didn't work, for some reason. I re-wrote it from scratch since it wasn't exactly what I wanted anyway, and it now works. Sort of.zookeeper wrote:I must say that I don't have any idea why it breaks. I can't see anything wrong with it. Perhaps you could try to isolate the problem a bit more?
The scenario now force quits the application at turn 5-7 with no warning or error message, and I have no idea why.
Time for more debugging...
-
- Posts: 110
- Joined: November 15th, 2005, 5:26 am
If I fail to figure out the source of what's going wrong, I'll take you up on that offer. For now I'm going to use the tried and true method of deleting chunks of WML until it stops crashing. Like I said, I essentially re-wrote your code from scratch although I use the same ideas. Mostly I took out the cleverest parts, so you may be disappointed by my version.
The major differences are I don't use the whole "get back on the ship and into the recall list" idea and instead of actually examining the terrain to see if nearby hexes are castle hexes I have a [filter] with every single hex the player can recruit from listed.
The major differences are I don't use the whole "get back on the ship and into the recall list" idea and instead of actually examining the terrain to see if nearby hexes are castle hexes I have a [filter] with every single hex the player can recruit from listed.