Unknown scenario error

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Unknown scenario error

Post by Turgon » February 5th, 2012, 5:31 pm

Hello lads,
I am working on a new campaign about some people from small villages fighting undead in the age of "UTBS". Unfortunately I can't make the first scenario work. The WML is basically based on another mission I wrote before for a different campaign which works allright. I checked for some standard errors, but I am not really experienced. So maybe one of you have an idea about what is wrong here. (btw, I used Notepad for these WMLs)

This is the WML for the main.cfg

Code: Select all

#textdomain wesnoth-sotv
[textdomain]
    name="wesnoth-sotv"
[/textdomain]

# wmlscope: set export=no
[campaign]
    id=story_of_three_villages
    icon="units/human-peasants/woodsman-defend.png~TC(1,magenta)"
    name= _ "The story of three villages"
    abbrev= _ "SOTV"
    rank=420
    first_scenario=1_An_adventure_in_winter
    difficulties="EASY,NORMAL,HARD"
    define="CAMPAIGN_STORY_OF_THREE_VILLAGES"
    description=_ "In the far and dark future, after the fall of Wesnoth, the lifes of innocent peasants are in danger. See the desperate struggle of the villages Flussweiler, Waldort and Hangkaff against the dark forces of vampires, wolves and undead.

"+ _"(Expert level, 6 scenarios.)"
[/campaign]

#ifdef CAMPAIGN_STORY_OF_THREE_VILLAGES
[+units]
    {~add-ons\the story of three villages\units}
[/units]
[binary_path]
    path=data\add-ons\the story of three villages
[/binary_path]
{~add-ons\the story of three villages\utils}
{~add-ons\the story of three villages\scenarios}
#endif

and this is the code for the first scenario:

Code: Select all

[scenario]
	id="1_An_adventure_in_winter"
    name=_ "An adventure in winter"
    map_data="{~add-ons\the story of three villages\maps\An_adventure_in_winter}"
    turns=30
    next_scenario=2_Return_to_home
    {DEFAULT_SCHEDULE}

    {SCENARIO_MUSIC vengeful.ogg}
    {EXTRA_SCENARIO_MUSIC wanderer.ogg}
    {EXTRA_SCENARIO_MUSIC sad.ogg}

    [side]
        type="Fighter"
        id="Tyrell"
        canrecruit=yes
        name=_ "Tyrell"

        side=1
        controller=human
        {GOLD 100 60 40}
        income=2
        team_name="Young guys"
        user_team_name=_ "Young guys"
        fog=yes
        shroud=no
        recruit="Fighter, Footpad"
    [/side]

    {STARTING_VILLAGES 1 3}
	
	[side]
        type="Goblin Impaler"
        id="Kollin"
        name=_ "Kollin"
        canrecruit=yes

        side=2
        {GOLD 25 55 75}
        team_name="Bad Guys"
        user_team_name=_ "Bad Guys"
        controller=ai
        fog=yes
        shroud=no
        income=0
        recruit="Goblin Spearman, Rouser, Wolf Rider"
        [ai]
            grouping=offensive
            attack_depth=5
        [/ai]
    [/side]
	
    [story]
        [part]
            story= _ "In the far future, the king of Wesnoth wanted to abolish the night forever. To do so, he ordered his magicians to create a secound sun by lifting a mountain up into the sky. But they failed and the mountain fell down upon Weldyn. After the destruction of Wesnoth's capital there was chaos and confusion."
        [/part]
        [part]
            story= _ "This event led to the destruction of any centralised organisation. Local warlords, barons and dictators arose and peaceful villagers had to grab their weapons and defend their homes."
        [/part]
        [part]
            story= _ "So did the citizens of the small villages Flussweiler, Waldort and Hangkaff as well. While Flussweiler was a rather wealthy village, holding good farmland, Waldort sold timber and berries from the nearby forest and Hangkaff was the home of Shepherds and a recently founded monastery."
        [/part]
        [part]
            story= _ "To keep the young men strong, all boys of a certain age were sent into the forest for one winter. They had to survive as a group so only the strongest boys survived this rite of initiation. Usually the strongest boy was accepted as their leader. This is the story of Tyrell, leader of the hopeful boys from Flussweiler."
        [/part]
     
    [/story]

    [event]
        name=prestart

        [objectives]

            [objective]
                description=_ "Defeat your enemy"
                condition=win
            [/objective]
            [objective]
                description=_ "Death of Tyrell"
                condition=lose
            [/objective]
            [objective]
                description=_ "Time runs out"
                condition=lose
            [/objective]
        [/objectives]

		[move_unit_fake]
            type="Cavalryman"
            x=15,14,14,13,12,11,10
            y=18,18,19,20,20,20,20
        [/move_unit_fake]
		
        {NAMED_LOYAL_UNIT 1 "Cavalryman" 15 18 "Gunther" (_ "Gunther")} # wmllint: recognize Gunther
    [/event]

    [event]
        name=start

        [message]
            id=Gunther
            message=_ "It's a damn cold winter. Hey, you young guys over there! May a peaceful traveler share meat, wine and tales with you?"
        [/message]
        [message]
            id=Tyrell
            message=_ "A stranger! Lay down your sword traveler and you may come to our fire."
        [/message]
        [message]
            id=Gunther
            message=_ "Allright, I want no fight. Just a place for the night. My name is Gunther, envoy of the horselord Garanthos. What are you guys doing here? Why do you have a camp in this haunted forest?"
        [/message]
        [message]
            id=Tyrell
            message=_ "We boys have to survive the winter. When the snow smelts, we will return as men. But we haven't seen a rider for ages. We hardly hear anything from beyound our little villages. For the moment, share our fire with us. My name is Tyrell, I am the one in charge."
        [/message]
        [message]
            id=Gunther
            message=_ "I have business to do. A message for the leader of Flussweiler. They are in danger. And by the way, you guys will have some trouble, too. Goblins are gathering besides that wicked stone to the east."
        [/message]
		[message]
            id=Tyrell
            message=_ "Flussweiler? These are our families. Can we help?"
        [/message]
		[message]
            id=Gunther
            message=_ "This is a man's business. Take care of yourselves. You have fine swords and quick boys around you. I think you can handle the goblins quickly. I will help you."
        [/message]
        
    [/event]

    [event]
        name=turn 2

        [message]
            id=Tyrell
            message=_ "We have tested our swords only in training yet. I am eager to see me and my friends in a real fight."
        [/message]
    [/event]

    [event]
        name=time over

        [message]
            race=human
            message=_ "Oh, no. We were not even able to defeat these goblins. We will never be real warriors."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Tyrell
        [/filter]

        [message]
            id=Tyrell
            message=_ "Ugh..."
        [/message]
        [message]
            id=Kollin
            message=_ "Got him!"
        [/message]
        [message]
            speaker=narrator
            message=_ "Our young fighter died in his first winter out there. Certainly there was no hope for the men and women of Flussweiler now."
            image=wesnoth-icon.png
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Kollin
        [/filter]
        [message]
            speaker=unit
            message=_ "Argh! NOOOO!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            id=Kollin
        [/filter]
        [message]
            id=Tyrell
            message=_ "Now, that was a fight! I am eager to see what will happen next."
        [/message]

    [/event]
[/scenario]
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Unknown scenario error

Post by Ceres » February 5th, 2012, 5:36 pm

IIRC WML doesn't like spaces in file paths. Better use underscores.

User avatar
shadowm
Site Administrator
Posts: 6545
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Unknown scenario error

Post by shadowm » February 5th, 2012, 5:45 pm

Please use forward slashes ‘/’ instead of backslashes ‘\’ too. You’ll also want to respect letter case (i.e. ‘a’ versus ‘A’) for paths before distributing.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.

User avatar
Elvish_Hunter
Developer
Posts: 1380
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Unknown scenario error

Post by Elvish_Hunter » February 5th, 2012, 5:47 pm

From a quick look I see two things that ought to be fixed:

Code: Select all

map_data="{~add-ons\the story of three villages\maps\An_adventure_in_winter}"
Check if, by chance, your map file has the .map extension, and if yes correct the above line. Do you have the "hide extensions for known file types" option disabled in Windows?

Code: Select all

recruit="Fighter, Footpad"
recruit="Goblin Spearman, Rouser, Wolf Rider"
What unit do you mean as "Fighter" exactly? The Spearman? And it's not Rouser, it's "Goblin Rouser" - unless you are using some custom units, of course.
Also, using a proper text editor (Notepad++ or JEdit) will really help against inconsistent indentation. :)
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 5th, 2012, 7:34 pm

Okay, thanks for all the help. I embedded all the hints. The "Fighter" is taken from HTTT, I copied the relevant files, because this unit fits so extremely well into this scenario. Now I come closer to the solution, but another error occurs:

Condition '!(Header_offset == std::string::npos II comma_offset < header=offset)' failed at src\map.cpp:163 in function 'read'.

And I have really no idea what this could mean, exept for the fact that this error seems to be connected to the map somehow. Maybe an experienced programmer could even explain what's wrong about this or where to find more information so I won't make this mistake again.

My map is saved in:
(...)Battle for Wesnoth 1.8.6\userdata\data\add-ons\the_story_of_three_villages\maps
as
An_adventure_in_winter.map

and my scenario file says:

Code: Select all

map_data="{~add-ons/the_story_of_three_villages/maps/An_adventure_in_winter}"
Furthermore I have to excuse my limited knowledge of English, but I don't understand what this hint from Shadowmaster means:
You’ll also want to respect letter case (i.e. ‘a’ versus ‘A’) for paths before distributing.
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

mattsc
Posts: 1109
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: Unknown scenario error

Post by mattsc » February 5th, 2012, 7:46 pm

Turgon wrote:and my scenario file says:

Code: Select all

    map_data="{~add-ons/the_story_of_three_villages/maps/An_adventure_in_winter}"
I don't know if that will solve your problem, but try adding '.map' to that (as E_H wrote).
Turgon wrote:Furthermore I have to excuse my limited knowledge of English, but I don't understand what this hint from Shadowmaster means:
You’ll also want to respect letter case (i.e. ‘a’ versus ‘A’) for paths before distributing.
It means that capitalization matters in file and path names (from a quick look, that seems to be ok in your code).

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 5th, 2012, 9:43 pm

mattsc wrote: I don't know if that will solve your problem, but try adding '.map' to that (as E_H wrote).
That was the crucial point, thanks... Now I have to see that there is no picture to my Fighters, they are all invisible, but that might be solved by copying the right pics into the right folders. Another thing I noticed is that the Goblin leader doesn't recruit, but runs forward... maybe I should try to change something about his castle... but that's for tomorrow. Thanks so far for all the help.

EDIT: Okay, now I have solved the riddles about missing pics and no recruitment and I think I have somehow balanced the map so it is possible in all difficulties. Just one small mistake stays: In the beginning, there is this cavalryman who appears. I have this code inside of my beginning event:

Code: Select all

		[move_unit_fake]
            type="Cavalryman"
            x=0,1,2,4,4,5,6,7,8
            y=13,14,14,14,13,13,12,12,11
        [/move_unit_fake]
		
        {NAMED_LOYAL_UNIT 1 "Cavalryman" 8 11 "Gunther" (_ "Gunther")} # wmllint: recognize Gunther
The problem is, that there is just no fake unit moving along these hexes. In fact there is no fake unit.
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 6th, 2012, 3:48 pm

Oh, stupid error I can't erase. Sorry for making a new post, but only now the status of this thread is updated.
My problem is that I don't know how to put up a defeat if Gunther dies. I tried to paste an "endlevel" event in his "Last breath", I tried to define him as a hero, but it didn't work and the game went on with him being dead.
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Unknown scenario error

Post by Ceres » February 6th, 2012, 3:53 pm

It could be helpful to show us the code that didn't work then. It should look like this:

Code: Select all

[event]
	name=last breath
	[filter]
		id=Gunther
	[/filter]
	[message]
		speaker=Gunther
		message= _ "Blah blah"
	[/message]
	[endlevel]
		result=defeat
	[/endlevel]
[/event]

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 6th, 2012, 4:02 pm

It looks like this:

Code: Select all

[event]
        name=last breath
        [filter]
            id=Gunther
        [/filter]

        [message]
            id=Gunther
            message=_ "Ugh..."
        [/message]
        [message]
            race=goblin
            message=_ "Ahaha! Got that big, four-legged beast! Ahaha, will be king of goblins."
        [/message]
        [message]
            id=Tyrell
            message=_ "Oh, now we will never know which important message he had for our village..."
        [/message]
        [message]
            speaker=narrator
            message=_ "The stranger died while he was fighting at the side of the young boys. Certainly there was no hope for the men and women of Flussweiler now."
            image=wesnoth-icon.png
		[endlevel]
            result=defeat
        [/endlevel]
        [/message]
    [/event]
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Unknown scenario error

Post by Ceres » February 6th, 2012, 4:07 pm

Turgon wrote:

Code: Select all

[message]
         ...
      [endlevel]
            result=defeat
      [/endlevel]
[/message]
Rethink the order of the tags. [endlevel] is not a subtag of [message].

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 6th, 2012, 4:11 pm

That's it, allright. Now it works. BTW any idea about the fake unit movement? Maybe the unit just walks too quickly for my eyes...
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Unknown scenario error

Post by Ceres » February 6th, 2012, 4:28 pm

You can't move a fake unit on map borders. Remove the first pair of coordinates (0;13) from the fake unit path.

Turgon
Posts: 59
Joined: September 30th, 2011, 6:13 pm
Location: Germany

Re: Unknown scenario error

Post by Turgon » February 6th, 2012, 4:35 pm

A very valuable hint, thanks. Indeed it didn't work at once, but I tried a bit and found out that another problem was that the fake movement was in the "prestart" event. Now it is in the "start" event and works allright. Looks like I can start with the secound scenario, then... ;)
Looking for feedback for my dramatic campaign "A story of three villages", a late-age men vs. undead story going to include vampires and werewolves: http://forums.wesnoth.org/viewtopic.php?f=8&t=36193

Post Reply