Question about "Unknown Scenario" error

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.
Aryvan
Posts: 9
Joined: June 24th, 2010, 4:09 pm

Question about "Unknown Scenario" error

Post by Aryvan »

Hey guys :-)

As you can see, I have a problem with an error. Currently I try to make my first steps in campaign and scenario development but unfortunately I can't do it without help...
I am trying to include units from the Ageless_Era in my campagin and I guess that's where all the problems start. I don't really know how to do it and tried to fix the error for hours now. I hope you can help me :-)

The path of the campaign on my computer is: Wesnoth/userdata/data/add-ons/Rebirth

Thanks in advance!

P.S. I used "Heir to the Throne" as an example so there might be some image-pathes or something else...
Attachments
_main.cfg
(1.14 KiB) Downloaded 226 times
01_Slaves_of_Mankind.cfg
(3.59 KiB) Downloaded 222 times
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Question about "Unknown Scenario" error

Post by zookeeper »

Code: Select all

define=CAMPAIGN_REBIRTH

Code: Select all

#ifdef REBIRTH
See the mismatch?

Code: Select all

first_scenario=01_Slaves_Of_Mankind.cfg
first_scenario= wants the id of a scenario, not a filename.

Also these paths are all wrong:

Code: Select all

icon="userdata/data/add-ons/Ageless_era/images/al-kamija-enchanted-ones/enchanted.png"
path=userdata/data/add-ons/Rebirth/scenarios
{userdata/data/add-ons/Ageless_Era/units}
Look at how other add-ons include files and directories and reference their custom images.

Code: Select all

(userdata/data/add-ons/Rebirth/scenarios}

Code: Select all

(userdata/data/Ageless_Era/_main.cfg}
There's opening parentheses there, not curvy brackets. Also including a _main.cfg is exactly the same as including the directory which contains it, and doing the latter is a better habit.
Aryvan
Posts: 9
Joined: June 24th, 2010, 4:09 pm

Re: Question about "Unknown Scenario" error

Post by Aryvan »

Thank you for your help .-)

I changed everything, but I still get the same error. Maybe the paths are still wrong, but that's how I found them in another main-file...
Attachments
_main.txt
(1.31 KiB) Downloaded 221 times
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Question about "Unknown Scenario" error

Post by zookeeper »

{~add-ons/Rebirth/scenario}
You sure you have your scenario .cfg in that directory?
Aryvan
Posts: 9
Joined: June 24th, 2010, 4:09 pm

Re: Question about "Unknown Scenario" error

Post by Aryvan »

You're right, I made a mistake there...Now I get another error :-D

game_error: unknown unit type: EotF_Star_Shooter

That's the first new era unit I have in the scenario file so I guess I made a mistake with all of them...but I don't know how to correct it.
Aryvan
Posts: 9
Joined: June 24th, 2010, 4:09 pm

Re: Question about "Unknown Scenario" error

Post by Aryvan »

So...the problem is that I don't know how to include the Ageless Era add-on in my campaign.
Is it even possible? Then please tell me how to do it ;-)
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Question about "Unknown Scenario" error

Post by monochromatic »

IIRC Ageless era id's always start with AE to make sure they don't get confused with the actual era itself?
User avatar
Dixie
Posts: 1757
Joined: February 10th, 2010, 1:06 am
Location: $x1,$y1

Re: Question about "Unknown Scenario" error

Post by Dixie »

Try looking at how Bad Moon Rising includes Archaic Era, or how Count Kromire includes Era of Myth. And do the sae, but for Ageless.
Jazz is not dead, it just smells funny - Frank Zappa
Current projects: Internet meme Era, The Settlers of Wesnoth
Aryvan
Posts: 9
Joined: June 24th, 2010, 4:09 pm

Re: Question about "Unknown Scenario" error

Post by Aryvan »

Thanks for your replies :-)

Actually I already tried to look at Kromire and the Era of Myths. This era has an extra document which explains how to add it to a campaign...But this file doesn't exist for the Ageless Era and when I'm trying to do it myself, I don't get any results, so the unit_types are still not recognized...
Wakkawakka
Posts: 2
Joined: August 26th, 2010, 11:08 pm

Re: Question about "Unknown Scenario" error

Post by Wakkawakka »

Hello everyone,

I have the same problem like Aryvan - this bug with 'Unknown scenario:dawn01'. I looked at the other campaigns, tried to do it as was said in wiki and i don`t know what to do :/ Here`s the source code of _main.cfg file anda part of scenario code.

Code: Select all

[textdomain]
    name="wesnoth-Snow"
	# translations directory path
#    path=""
[/textdomain]

[campaign]
	#textdomain wesnoth-Snow
	id=13
	name= _ "Snow"
	abbrev= _ "Snow"
	define=CAMPAIGN_SNOW

#	icon= 
#	description= _ ""
	difficulties=NORMAL

	first_scenario=dawn_01
	
#ifdef CAMPAIGN_SNOW
	{~add-ons/Snow/macros}
	[+units]
    {~add-ons/Snow/units}
	{~add-ons/Snow/units/orcs-steppe}
	{~add-ons/Snow/units/goblins-steppe}
	{~add-ons/Snow/units/humans}
	[/units]
	{~add-ons/Snow/scenarios}
#endif

[/campaign]

Code: Select all

id=dawn_01
	next_scenario=x

	name=Dawn of War
	map_data="{~add-ons/Snow/maps/01_dawn.map}"
	turns=18

Thanks for help.
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Question about "Unknown Scenario" error

Post by monochromatic »

Your WML is messed up. I'd say try to download Dead Water from the 1.8 add-on server and change _main.cfg and the first scenario to suit your liking. I'm not seeing an error that might have triggered the unknown scenario error, but the code is a mess. You might want to rewrite a good bit of it, having standard indentation and proper syntax. As I said, use Dead Water as a guide. In doing that you'll probably either fix the error or the error will reveal itself.

One question though: are your scenarios really in add-ons/Snow/scenarios?
Wakkawakka
Posts: 2
Joined: August 26th, 2010, 11:08 pm

Re: Question about "Unknown Scenario" error

Post by Wakkawakka »

Yes, I have the scenario in add-ons/Snow/scenarios folder. Thanks for advices, I`ll try to fix it.

[EDIT] Nothing helps :/, source code from _main:

Code: Select all

[textdomain]
    name="wesnoth-Snow"
	path="data/add-ons/Snow/translations"
[/textdomain]

#textdomain wesnoth-Snow

[binary_path]
    path=data/add-ons/Snow/binary_patch
[/binary_path]


[campaign]
	id="Snow"
	name= _ "Snow"
	abbrev= _ "Snow"
	define=CAMPAIGN_SNOW

#	icon= 
#	description= _ ""
#	image=
	difficulties=NORMAL

	first_scenario=dawn_01
	
#ifdef CAMPAIGN_SNOW
	[binary_path]
    path=data/add-ons/Snow
	[/binary_path]
	{~add-ons/Snow/macros}
	{~add-ons/Snow/scenarios}
	[+units]
    {~add-ons/Snow/units}
	{~add-ons/Snow/units/orcs-steppe}
	{~add-ons/Snow/units/goblins-steppe}
	{~add-ons/Snow/units/humans}
	[/units]
#endif

[/campaign]
zandorius
Posts: 9
Joined: August 22nd, 2010, 4:57 pm

Ive got the same "Unknown Scenario" error, help please :)

Post by zandorius »

Hi Guys im having the same issue, been trying to fix it for 2 days now, no point in my continuing with a campaign if i cant get the basics down :-/

my _main.cfg

Code: Select all

[textdomain]
    name="wesnoth-The-Story-of-Ben"
	# translations directory path
    path="data/add-ons/The_Story_Of_Ben/translations"
[/textdomain]

[campaign]
	#textdomain wesnoth-The-Story-of-Ben
	id=The_Story_of_Ben
	name= _ "The Story of Ben"
	abbrev="TSOB"
	define=CAMPAIGN_THE_STORY_OF_BEN
#	icon= 
#	description= _ ""
	difficulties=EASY,NORMAL,HARD
	first_scenario=01_The_Escape

	#ifdef CAMPAIGN_THE_STORY_OF_BEN
	[binary_path]
		path="data/add-ons/The_Story_Of_Ben"
	[/binary_path]
	{~add-ons/The_Story_Of_Ben/scenarios}
	#endif
	
[/campaign]
01_The_Escape.cfg

Code: Select all

textdomain wesnoth-The-Story-of-Ben

[scenario]
	id=01_The_Escape
	name = _ "The Escape"
	next_scenario=02_Unlikely_Allies
	map_data="{~add-ons/The_Story_Of_Ben/maps/01_The_Escape.map}"
	turns=10
	{SECOND_WATCH}
	
	[story]
	# story stuff not important to error
               [/story]
	
	[side]
		type=Thug
		name = _ "Ben"
		id=Ben
		gender=male
		canrecruit=no
		unrenamable=yes
		side=1
		controller=human
		{GOLD 0 0 0}
		team_name = _ "Ben and co"
	[/side]
	
	[side]
		type=Orcish Leader
		name = _ "Krakk"
		id=Krakk
		gender=male
		canrecruit=no
		unrenamable=yes
		side=2
		controller=ai
		{GOLD 0 0 0}
		team_name = _ "Krakks Krew"
	[/side]
	
	[event]
    	name=prestart
    	[objectives]
      		side=1
      		[objective]
        		description= _ "Escape dungeon to Signpost"
        		condition=win
      		[/objective]
      		[objective]
        		description= _ "Death of Ben"
        		condition=lose
      		[/objective]
      		[objective]
        		description= _ "Turns run out"
        		condition=lose
      		[/objective]
    	[/objectives]
  	[/event]
  	
  	[/scenario]
	
I know the scenario isnt complete but surely it should at least load with all this info. if anyone can figure out where im going wrong please tell me :-)) and yes 01_The_Escape.cfg is in /scenarios directory
User avatar
Reepurr
Posts: 1088
Joined: August 29th, 2010, 5:38 pm

Re: Question about "Unknown Scenario" error

Post by Reepurr »

Zandorius...
The scenario isn't complete? You forgot to mention that the main.cfg isn't complete either. Your main.cfg is a DISASTER!

I'll explain this in bits, so that you can learn from your mistakes and make your coding actually work in the future.

:eng:
First of all, you shouldn't say it has easy, medium and hard and then not tell it what easy, medium and hard settings are. When we coders make a campaign, we must give it 1-4 of the 4 options: EASY, MEDIUM, HARD and NIGHTMARE. Then, we must make strange macro settings for each one. Adapt this to your needs:

Code: Select all

difficulty_descriptions={MENU_IMG_TXT2 "units/human-loyalists/fencer.png~RC(magenta>red)"( _ "Fencer") (_ "(Novice)")} + ";*" + {MENU_IMG_TXT2 "units/human-loyalists/duelist.png~RC(magenta>red)"( _ "Duelist") (_ "(Normal)")} +
    ";" +
    {MENU_IMG_TXT2 "units/human-loyalists/master-at-arms.png~RC(magenta>red)" (_ "Master at Arms") (_ "(Expert)")}
Then we come to another problem. Hashes (#) are dev ways of making comments. If you put a hash at the front of a line, Wesnoth doesn't read the line. Fix:

Code: Select all

icon="units/human-loyalists/fencer.png~RC(magenta>green)"
description= _ " "
Also, I may be wrong but as far as I understand binary paths do NOT go inside ifdefs. Put it just below the textdomain.


And now, onto the scenario!
Does it really only have one difficulty level? Easy -> Medium -> Hard difficulties must be included using this macro (if you want the easy approach):

Code: Select all

{TURNS 10 11 12}
This code makes it so that if you play on Easy, it's 10 turns, Medium 11, and so on.

Delete the [story] tags; if you don't have [part]s inside it may cause a bug and stop it from being a scenario.

Finally, your rubbish sides. The team_name is special for the game; you also need a user_team_name which is what the player sees. Unrenamable=yes is unneeded - it's a leader, it comes as standard. You don't need to specify gender either. Thugs come in all of one variety: male and male.

Code: Select all

   [side]
      type=Thug
      name = _ "Ben"
      id=Ben
      canrecruit=no
      unrenamable=yes
      side=1
      controller=human
      {GOLD 0 0 0}
      team_name=Benandco
      user_team_name= _ "Ben and co"

   [/side]
   
   [side]
      type=Orcish Leader
      name = _ "Krakk"
      id=Krakk
      canrecruit=no
      side=2
      controller=ai
      {GOLD 0 0 0}
      team_name= Krakks Krew
      user_team_name= _ "Krakks Krew"
   [/side]
If that doesn't do anything, I've missed something important. That or you didn't actually put your scenario.cfg into the scenario folder.
"What do you mean, "a dwarvish dragonguard with marksman is overpowered"?"

Story of a Drake Outcast | The Nonsense Era
Played HttT-Underground Channels? Thought it was rubbish? Help us develop it here!
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Question about "Unknown Scenario" error

Post by monochromatic »

Reepurr wrote:Zandorius...
The scenario isn't complete? You forgot to mention that the main.cfg isn't complete either. Your main.cfg is a DISASTER!

I'll explain this in bits, so that you can learn from your mistakes and make your coding actually work in the future.

:eng:
Really? It wasn't a disaster at all for me... In fact, all the problems you listed below have nothing to do with the problem!
Reepurr wrote:First of all, you shouldn't say it has easy, medium and hard and then not tell it what easy, medium and hard settings are. When we coders make a campaign, we must give it 1-4 of the 4 options: EASY, MEDIUM, HARD and NIGHTMARE. Then, we must make strange macro settings for each one. Adapt this to your needs:

Code: Select all

difficulty_descriptions={MENU_IMG_TXT2 "units/human-loyalists/fencer.png~RC(magenta>red)"( _ "Fencer") (_ "(Novice)")} + ";*" + {MENU_IMG_TXT2 "units/human-loyalists/duelist.png~RC(magenta>red)"( _ "Duelist") (_ "(Normal)")} +
    ";" +
    {MENU_IMG_TXT2 "units/human-loyalists/master-at-arms.png~RC(magenta>red)" (_ "Master at Arms") (_ "(Expert)")}
Actually I believe you don't need this. Although it is nice to have, you don't need it. It'll simply just have EASY, NORMAL, and HARD on the difficulty screen.
Reepurr wrote:Then we come to another problem. Hashes (#) are dev ways of making comments. If you put a hash at the front of a line, Wesnoth doesn't read the line. Fix:

Code: Select all

icon="units/human-loyalists/fencer.png~RC(magenta>green)"
description= _ " "
Quite obviously he doesn't want an icon/description at the moment, as he is only testing. Using # is a nice way as it keeps the tags there but won't read it.
Reepurr wrote:Also, I may be wrong but as far as I understand binary paths do NOT go inside ifdefs. Put it just below the textdomain.
Actually, the [binary_path] does go inside the #ifdef. It's the #textdomain that doesn't belong in [campaign] but outside the entire tag.
Reepurr wrote:And now, onto the scenario!
Does it really only have one difficulty level? Easy -> Medium -> Hard difficulties must be included using this macro (if you want the easy approach):

Code: Select all

{TURNS 10 11 12}
This code makes it so that if you play on Easy, it's 10 turns, Medium 11, and so on.
Look up TSoG. Doing one difficulty is really nice so it's easier to balance until the campaign is finish, in which then the other difficulties are added.
Reepurr wrote:Delete the [story] tags; if you don't have [part]s inside it may cause a bug and stop it from being a scenario.

Finally, your rubbish sides. The team_name is special for the game; you also need a user_team_name which is what the player sees. Unrenamable=yes is unneeded - it's a leader, it comes as standard. You don't need to specify gender either. Thugs come in all of one variety: male and male.

Code: Select all

   [side]
      type=Thug
      name = _ "Ben"
      id=Ben
      canrecruit=no
      unrenamable=yes
      side=1
      controller=human
      {GOLD 0 0 0}
      team_name=Benandco
      user_team_name= _ "Ben and co"

   [/side]
   
   [side]
      type=Orcish Leader
      name = _ "Krakk"
      id=Krakk
      canrecruit=no
      side=2
      controller=ai
      {GOLD 0 0 0}
      team_name= Krakks Krew
      user_team_name= _ "Krakks Krew"
   [/side]
If that doesn't do anything, I've missed something important. That or you didn't actually put your scenario.cfg into the scenario folder.
In my experience, even leaders can be renamable unless they have unrenameable=yes. But I'm not sure on that.

The reason I believe to causing the error is that the files are not where you defined them.
Post Reply