Please help troubleshoot on my first scenario.

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.
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Please help troubleshoot on my first scenario.

Post by kirby_freak »

Hello. I've been trying to learn WML and have been using a tutorial and picking out lines and putting them in my scenario/campaign. I got the campaign to show up, yet when I run it, it says Unknown Scenario. Here's my WML. Any help would be appreciated, thanks in advance. ~kirby_freak

Code: Select all

Campaign:
#textdomain wesnoth-Kirbys_Test_Campaign
[textdomain]	
	name=wesnoth-Kirbys_Test_Campaign
[/textdomain]

[campaign]
	id=Kirby’s Test Campaign
	icon=”units/human-magi/mage-arch.png”
	name= _ "Kirby's Test Campaign"
	abbrev= _ “KTC”
	define=KIRBYS_TEST_CAMPGAIGN

	description= _ "A test campaign by kirby_freak.  My first attempt at WML, and what I will use to test new things I learn.  :)"

	difficulties=VERYEASY,EASY,MEDIUM
    	difficulty_descriptions={MENU_IMG_TXT2 "units/human-magi/mage.png"( _ "male^Mage") (_ "(Very Easy)")} + 
";*" +
 {MENU_IMG_TXT2 "units/human-magi/red-mage.png"( _ "male^Red Mage") (_ "(Easy)")} +
    ";" + 
{MENU_IMG_TXT2 "units/human-magi/arch-mage.png" (_ "male^Arch Mage") (_ "(Medium)")}

	
	image=”portraits/humans/mage-arch.png”
	first_scenario=”01_Cave_Fight”	
[/campaign]

#ifdef KIRBYS_TEST_CAMPAIGN
	[binary path]
		path=”data/add-ons/Kirby’s_Test_Campaign”	
	[/binary path]
{~add-ons/Kirby’s_Test_Campaign/scenarios}
#endif
Here's my scenario:

Code: Select all

#textdomain wesnoth-Kirbys_Test_Campaign

[scenario]
	id=”01_Cave_Fight”
	name= _ ”01-Cave Fight”
	map_data=”{~add-ons/Kirby’s_Test_Campaign/maps/01_Cave_Fight}”

	{UNDERGROUND}
	{DEFAULT_MUSIC_PLAYLIST}

	turns=-1

	next_scenario=null

	[story]
		[part]
			story= _ “Tylre the mage heads into a dark cave to try and find a new place for his magic school.  He is followed by his many young students.”
		[/part]
	[/story]

	[side]
		side=1
		controller=human
		canrecruit=yes
		recruit=Mage,Spearman
		team_name=Tylre
		gold=100	
		type=Red Mage
		name= _ “male^Tylre”
		id=Tyler
		gender=male
		unrenamable=yes
	[modifications]
		{TRAIT_LOYAL}
		{TRAIT_RESILIENT}
	[/modifications]
	[/side]

	[side]
		side=2
		controller=ai
		canrecruit=yes
		recruit=Footpad

		team_name=Enemy	
		unrenamable=yes

		{GOLD 40 60 80}

		type=Outlaw
		id=Largo
		name= _ “Largo”
		unrenamable=yes
	[/side]

	[event]
		name=prestart

		[objectives]
			side=1
			[objective]
				condition=win
				description= _ “Defeat Largo”
			[/objective]
			[objective]
				condition=loseProxy-Connection: keep-alive
Cache-Control: max-age=0

				description= _ “Death of Tylre”
			[/objecProxy-Connection: keep-alive
Cache-Control: max-age=0

ve]
		[/objectives]
	[/event]

	[event]
		name=start
		[message]
		speaker=Tylre
		message= _ “’Tis dark and gloomy in this cavern.  Let us hope we can see well enough to walk.”
		[/message]
		[message]
		speaker=Largo
		message= _ “Prepare to die!”
		[/message]
		[message]
		speaker=Tylre
		message= _ “It seems we will have to use magic to strike down our opponent.  Let us procede with caution.”
		[/message]

	[event]
		name=victory
		[message]
			speaker=Tylre
			message= _ “Huzzah, we won! Let us continue further in!”
		[/message]
	[/event]

	[event]
		name=last breath
		[filter]
			id=Tylre
		[/filter]
		[message]
			speaker=unit
			message= _ “Alas, I have failed.”
		[/message]
		[endlevel]
			result=defeat
		[/endlevel]
[/scenario]
Last edited by Gambit on September 25th, 2010, 12:30 pm, edited 1 time in total.
Reason: added code tags
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

[/objecProxy-Connection: keep-alive
Cache-Control: max-age=0

ve]

That stuff isn't actually in the file, it got messed up when I copied and posted it, lol. :)
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Please help troubleshoot on my first scenario.

Post by monochromatic »

Code: Select all

define=KIRBYS_TEST_CAMPGAIGN

Code: Select all

#ifdef KIRBYS_TEST_CAMPAIGN
There you go. They should be the same.
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: Please help troubleshoot on my first scenario.

Post by Astoria »

Code: Select all

difficulties=VERYEASY,EASY,MEDIUM
This doesn't work, try

Code: Select all

difficulties=EASY,NORMAL,HARD
Else several macros won't work.
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

Thank you so much everyone! :D Oh, and lightfighter, that's how the tutorial put it in their campaign and got it to work... Huh. Ah well, I'll change mine. Thanks again!
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: Please help troubleshoot on my first scenario.

Post by Astoria »

kirby_freak wrote:Thank you so much everyone! :D Oh, and lightfighter, that's how the tutorial put it in their campaign and got it to work... Huh. Ah well, I'll change mine. Thanks again!
This is how the gold macro works:

Code: Select all

#ifdef EASY
#endif
#ifdef MEDIUM
#endif
#ifdef HARD
#endif
So, nobody will recruit on very easy. It will require a lot of macro-changing to change that.
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

Hm. Still not working. I'll look over it again and if I'm still having problems, I'll post again.
User avatar
Golden_Soldier
Posts: 265
Joined: July 20th, 2010, 10:26 pm
Location: Roanoke

Re: Please help troubleshoot on my first scenario.

Post by Golden_Soldier »

what is your error message? that could be helpful :)
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Please help troubleshoot on my first scenario.

Post by SkyOne »

If you have not changed since your first post, there are two missing [/event] at your last breath and start event.
Each of them causes to a missing closing tag error.
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

@ Golden_Soldier: I load the campaign, and it says 'Unknown Scenario and then it exits back to the main menu of the game. :/

@ SkyOne: Yeah, I noticed those, but thanks for helping. :)
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

Correction: It says Unknown Scenario: ' and then quits. :(
User avatar
Pentarctagon
Project Manager
Posts: 5564
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Please help troubleshoot on my first scenario.

Post by Pentarctagon »

note the 'edit post' button, which can be used to avoid double posting :wink:
also the contents of the stderr.txt file might be more useful than the on-screen message.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
kirby_freak
Posts: 14
Joined: September 24th, 2010, 2:47 am

Re: Please help troubleshoot on my first scenario.

Post by kirby_freak »

Oh, whoops, sorry. :)
What's a stderr.txt file...?
Here's what I have so far.
_main.cfg:
#textdomain wesnoth-Kirby’s_Test_Campaign
[textdomain]
name=wesnoth-Kirby’s_Test_Campaign
[/textdomain]

[campaign]
id=Kirby’s Test Campaign
icon=”units/human-magi/arch-mage.png”
name= _ "Kirby's Test Campaign"
abbrev= _ “KTC”
define=KIRBY’S_TEST_CAMPAIGN

description= _ "A test campaign by kirby_freak. My first attempt at WML, and what I will use to test new things I learn. :)"

difficulties=EASY,MEDIUM,HARD
difficulty_descriptions={MENU_IMG_TXT2 "units/human-magi/mage.png"( _ "male^Mage") (_ "(Easy)")} +
";*" +
{MENU_IMG_TXT2 "units/human-magi/red-mage.png"( _ "male^Red Mage") (_ "(Medium)")} +
";" +
{MENU_IMG_TXT2 "units/human-magi/arch-mage.png" (_ "male^Arch Mage") (_ "(Hard)")}


image=”portraits/humans/mage.png”
first_scenario=”1_Cave_Fight”

[about]
title = _ “Campaign Design”
[entry]
name = “Tyler Luce”
[/entry]
[/about]
[/campaign]

#ifdef KIRBY’S_TEST_CAMPAIGN
[binary_path]
path=”data/add-ons/Kirby’s_Test_Campaign”
[/binary_path]
{~add-ons/Kirby’s_Test_Campaign/scenarios}
#endif

scenario .cfg file:
#textdomain wesnoth-Kirby’s_Test_Campaign

[scenario]
id=”1_Cave_Fight”
name= _ ”1-Cave Fight”
map_data=”{~add-ons/Kirby’s_Test_Campaign/maps/1_Cave_Fight.map}”

{UNDERGROUND}
{DEFAULT_MUSIC “underground.ogg”}

turns=-1

next_scenario=null

[story]
[part]
story= _ “Tylre the mage heads into a dark cave to try and find a new place for his magic school. He is followed by his many young students.”
[/part]
[/story]

[side]
side=1
controller=human
canrecruit=yes
recruit=Mage,Spearman
team_name=Tylre
gold=100
type=Red Mage
name= _ “male^Tylre”
id=Tyler
gender=male
unrenamable=yes
[modifications]
{TRAIT_LOYAL}
{TRAIT_RESILIENT}
[/modifications]

shroud=yes

[/side]

[side]
side=2
controller=ai
canrecruit=yes
recruit=Footpad

team_name=Enemy
unrenamable=yes

{GOLD 40 60 80}

type=Outlaw
id=Largo
name= _ “Largo”
unrenamable=yes
[/side]

[event]
name=prestart

[objectives]
side=1
[objective]
condition=win
description= _ “Defeat Largo”
[/objective]
[objective]
condition=lose
description= _ “Death of Tylre”
[/objective]
[/objectives]
[/event]

[eveProxy-Connection: keep-alive
Cache-Control: max-age=0

]
name=start
[message]
speaker=Tylre
message= _ “Tis dark and gloomy in this cavern. Let us hope we can see well enough to walk.”
[/message]
[message]
speaker=Largo
message= _ “Prepare to die!”
[/message]
[message]
speaker=Tylre
message= _ “It seems we will have to use magic to strike down our opponent. Let us procede with caution.”
[/message]
[/event]

[event]
name=victory
[message]
speaker=Tylre
message= _ “Huzzah, we won! Let us continue further in!”
[/message]
[/event]

[event]
name=last breath
[filter]
id=Tylre
[/filter]
[message]
speaker=unit
message= _ “Alas, I have failed.”
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[/scenario]
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Please help troubleshoot on my first scenario.

Post by monochromatic »

I wonder if it is this:

Code: Select all

versus

Code: Select all

"
It's especially obvious in the code tags look at the first post to see.
Otherwise, I don't really have the time to look through it carefully right now.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Please help troubleshoot on my first scenario.

Post by SkyOne »

Okay, Kirby.
Just as elvish_sovereign mentions, it seems that your quotations are something different from usual one. I mean it should be "..." (straight from north to south), but some of yours are from northeast to southwest. I am not sure what they are.
Also, the campaign title should be something "Kirbys_Test_Campaign", not Kirsy's, and [binary path] should be [binary_path].

I touched up a few of others, but at least, this one works by using A Simple Campaign.
So you just need to compare with it, okay?

P.S. I used files from the first post.
Attachments
Kirbys_Test_Campaign.zip
(40.47 KiB) Downloaded 144 times
Fate of a Princess/feedback thread: "What is in own heart that is the most important, not who you are."
Drake Campaign: Brave Wings/feedback thread, Naga Campaign: Return of the Monster, Saurian Campaign: Across the Ocean
Northern Forces - now on 1.12 server
Post Reply