Unterminated!!!

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.
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Unterminated!!!

Post by dark_cleou »

When I make a Campaign, why is it there is an error like #ifdef not terminated and so...that the error comes for like this: user/library/preferences/wesnoth/data/campaigns/Campaign.cfg............It is very unclear to me...How to terminate it? I did everything like erasing extra, putting #endif or so.....Need Help......
here is a helper and a Helpless...Pls. help the helpless...like me...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Try what parts of your WML you can remove without the error disappearing, and then post the rest here.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Post! Post! Post!
Hope springs eternal.
Wesnoth acronym guide.
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Post by dark_cleou »

I just don't understand of what youre saying...but ill give you the message when im entering Wesnoth...



The following add-on campaign(s) had errors and could not be loaded:
Users/Eddie/Library/Preferences/Wesnoth/data/campaigns//Campaign.cfg
ERROR DETAILS:
ifdef not terminated,started at 31 /Users/Eddie/Library/Preferences/Wesnoth/data/campaigns//Campaign.cfg

By the way, wwhat is WML? I'm just a beginner of making a campaign...I don't know that...
here is a helper and a Helpless...Pls. help the helpless...like me...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

WML is the language you use to make campaigns and units. The one that looks like this:

Code: Select all

[campaign]
    id=my_campaign
    name= _ "My jolly good campaign"
    ...
There's an error in your WML code, and since the error messages are usually not so helpful, it's hard to help when we can't see your code.

I don't know anything about the campaign editors, so if you're using one, someone else has to help with those.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Just post the campaign config file and we can examine it for errors. The message you are getting is the result of a WML type somewhere, but we can't tell you where it is without seeing the file.
Hope springs eternal.
Wesnoth acronym guide.
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Post by dark_cleou »

:( :) But there is something more...Macro Substitution and something to do with the GAME.CFG...Is there wrong in the writings??? Or need a new GAME.CFG???
here is a helper and a Helpless...Pls. help the helpless...like me...
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

No. Just post your config file already. There is a typo in your WML somewhere. The error causes the game's WML parser to get lost, and eventually it finds itself back at the top level without knowing how it got there.
Hope springs eternal.
Wesnoth acronym guide.
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Post by dark_cleou »

Actually I have made the campaign simpler or even the simplest scenario like three tests...oh yeah!!!The ifdef is already terminated...but the macro substitution is not...How about that...well to prevent further chat, here it is...

Code: Select all


[campaign]

	id=Arimatheans
	icon=images/human-royalguard-attack.png
	name= _ "Arimatheans, a Nation"
	
	first_scenario=number1
	
	difficulties=EASY,NORMAL,HARD
	description= _ "Lead the Arimatheans to a powerful nation."
	difficulty_descriptions= _ "&undead-initiate.png=Easy;*&elvish-marshal-leading.png=Medium;&dwarf-lord.png=Hard"



[/campaign]


#ifdef

[@campaigns/Arimatheans]

#endif

it says that macro substitution unterminated....and then next time the error will not be displayed...as smooth as when opening...but I can't find my campaign on the list...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Try this:

Code: Select all

[campaign]

	id=Arimatheans
	icon=images/human-royalguard-attack.png
	name= _ "Arimatheans, a Nation"

        define=CAMPAIGN_ARIMATHEANS
	
	first_scenario=number1
	
	difficulties=EASY,NORMAL,HARD
	description= _ "Lead the Arimatheans to a powerful nation."
	difficulty_descriptions= _ "&undead-initiate.png=Easy;*&elvish-marshal-leading.png=Medium;&dwarf-lord.png=Hard"
[/campaign]


#ifdef CAMPAIGN_ARIMATHEANS

{@campaigns/Arimatheans}

#endif
#ifdef always needs a "symbol" to check. In this case, it's a symbol of your campaign (set with define=CAMPAIGN_ARIMATHEANS). Also, use the right type of brackets. Macros use {}, tags use []. You also don't need to include your campaign directory inside the #ifdef (unless you for some weird reason have your scenario files etc inside your campaigns main directory, of course).
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Post by dark_cleou »

Oh great thanks a lot but it is no use it goes on with a note: ifdef not terminated started at 23 /Eddie....and so on...how bout another alternative? Like the game.cfg or utililies...by the way im a mac user...i think of a better check

Code: Select all

[campaign]

	id=Arimatheans
	icon=images/human-royalguard-attack.png
	name= _ "Arimatheans, a Nation"
	
		define=CAMPAIGN_ARIMATHEANS

	first_scenario=number1
	
	difficulties=EASY,NORMAL,HARD
	description= _ "Lead the Arimatheans to a powerful nation."
	difficulty_descriptions= _ "&undead-initiate.png=Easy;*&elvish-marshal-leading.png=Medium;&dwarf-lord.png=Hard"
[/campaign]


#ifdef CAMPAIGN_ARIMATHEANS

{@campaigns/Arimatheans/}

#endif
here is a helper and a Helpless...Pls. help the helpless...like me...
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

That campaign file works for me. Is your campaign file named Arimatheans.cfg? Please try to isolate what's causing the problem. Is it really the #ifdef, or does the error occur without it too? What files are in the campaigns/Arimatheans directory that is included?
dark_cleou
Posts: 22
Joined: January 4th, 2006, 11:31 am

Post by dark_cleou »

Oh yeah! When it's not #ifdef unterminated, it is the macro...i dunno...the files under campaigns/Arimatheans are only 1 scenario: named number1...it already includes the map inside...im just testing if it will work...if it will work, i will make a new scenario and so on...
Lord_Aether
Posts: 127
Joined: November 11th, 2005, 9:06 am
Location: California

Post by Lord_Aether »

I sometimes have the same problem, and can't find what is going wrong. I would be very interested how to solve this. I think it may be a bug in the program or something. I also sometimes get messages like "no closing tag for tag (something)(changes to a tag I actually have)", but the tag is quite clearly closed.
Mac OS X 10.5.7
Wesnoth 1.6.2
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

I've found that such errors are usually caused by macros, which have been given the wrong number of arguments, unterminated ""'s, or something similar.
Post Reply