Campaign Problems
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.
Campaign Problems
Okay, so I've been working on a practice campaign before attempting to make a real one. I've been able to get up to the difficulty choice screen, but when I choose one, i get an error.
First off: the campaign file
Now here is the error i receive:
It would be highly appreciated if someone could help me. Thanks
First off: the campaign file
Code: Select all
[campaign]
#textdomain wesnoth-Simple_Campaign
id=SIMPLE_CAMPAIGN
name=_ "A Simple Campaign"
define=CAMPAIGN_SIMPLE_CAMPAIGN
difficulties=EASY,NORMAL,HARD
difficulty_descriptions={MENU_IMG_TXT2 "units/human-loyalists/peasant.png~TC(1,magenta)" _"Civilian" _"(trivial)"} +
";" + {MENU_IMG_TXT2 "units/human-loyalists/spearman.png~TC(1,magenta)" _"Soldier" _"(simple)"} +
";" + {MENU_IMG_TXT2 "units/human-loyalists/pikeman.png~TC(1,magenta)" _"Veteran" _"(easy)"}
icon="units/human-loyalists/spearman.png~TC(1,magenta)"
image="units/human-loyalists/speraman.png~TC(1,magenta)"
description=_ "This is the description ahah"
first_scenario=the_first_scenario
[/campaign]
[binary_path]
path=data/campaigns/Simple_Campaign/external_binary_data/
[/binary_path]
#ifdef CAMPAIGN_SIMPLE_CAMPAIGN
[binary_path]
path=data/campaigns/Simple_Campaign
[/binary_path]
{@campaigns/Simple_Campaign/scenarios}
{@campaigns/Simple_Campaign/maps}
#endif
It would be highly appreciated if someone could help me. Thanks
-
- Posts: 837
- Joined: April 14th, 2005, 4:17 am
I was aiming for a very simple scenario, just to get the campaign running. I might have made it too simple, perhaps leaving something out.
Code: Select all
[scenario]
#textdomain wesnoth-Simple_Campaign
id=the_first_scenario
next_scenario=the_second_scenario
name=The First Scenario
map_data="{campaigns/Simple_Campaign/maps/testmap1
turns=30
{DAWN}
{MORNING}
{AFTERNOON}
{DUSK}
{FIRST_WATCH}
{SECOND_WATCH}
music=wesnoth-1.ogg
[event]
name=prestart
[objectives]
side=1
[objective]
description=_ "Defeat Enemy Leader"
condition=win
[/objective]
[objective]
description=_ "Death of Maple"
condition=lose
[/objective]
[objective]
description=_ "Turns Run Out"
condition=lose
[/objective]
[/objectives]
[/event]
[side]
side=1
controller=human
team_name=maple
type=Elvish Hero
description=Maple
canrecruit=1
recruit=Horseman,Mage,Bowman,Spearman
{GOLD 300 250 200}
{INCOME 10 5 0}
[/side]
[side]
side=2
controller=ai
team_name=Orcs
type=Orcish Warrior
description=Urug-Telfak
canrecruit=1
recruit=Orcish Grunt,Orcish Archer,Wolfrider,Troll Whelp
{GOLD 50 75 100}
{INCOME 0 1 2}
[/side]
[/scenario]
My mistake (duh), for some reason I thought SimpleCampaign.cfg was the first scenario.
What we are looking for is the scenario.cfg file with [scenario] tag and with id=the_first_scenario. This is so that we can exclude the scenario file as the source for the error. BfW usually incorrectly reports closing tag errors when other syntax errors are present.
Edit: And of course as I type this you already respond. =)
What we are looking for is the scenario.cfg file with [scenario] tag and with id=the_first_scenario. This is so that we can exclude the scenario file as the source for the error. BfW usually incorrectly reports closing tag errors when other syntax errors are present.
Edit: And of course as I type this you already respond. =)
Here is the likely cause of your problems:
This is also the most common cause for receiving an incorrect missing closing tag error. You open a string and never close it so the parser thinks all the remaining text in all subsequent files are part of the above parameter - possibly even the [/campaign] tag in SimpleCampaign.cfg.
To resolve this:
or (preferred solution)
Code: Select all
map_data="{campaigns/Simple_Campaign/maps/testmap1
To resolve this:
Code: Select all
map_data="{@campaigns/Simple_Campaign/maps/testmap1}"
Code: Select all
map_data={@campaigns/Simple_Campaign/maps/testmap1}
Perhaps I should post this to elswere, but...
(The number above is just my fast guess. I don't know if eg. story can have longer strings)
Couldn't the string be limited to let's say 9000 chars? The screen cannot even display long texts. If there are more than 9000 chars the parser would cast an error. Perhaps not a good way, but at least you would get an error message, where is mentioned that you have a problem with a string at line X.governor wrote: You open a string and never close it so the parser thinks all the remaining text in all subsequent files are part of the above parameter
(The number above is just my fast guess. I don't know if eg. story can have longer strings)
I'm using version 1.6
What I posted was not entirely correct. The parser would parse a string until it sees " again, and from this points onward the the interpreter will fail as the contents of the file are no longer properly formatted WML.
Take the above example:
Take the above example:
Code: Select all
[scenario]
#textdomain wesnoth-Simple_Campaign
id=the_first_scenario
next_scenario=the_second_scenario
name=The First Scenario
map_data="string"Defeat Enemy Leader"string"Death of Maple"string"Turns Run Out"string_starts_and_doesnt_end
Last edited by governor on May 5th, 2007, 5:47 pm, edited 1 time in total.