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.
User avatar
bigkahuna
Posts: 657
Joined: September 11th, 2010, 6:24 pm
Location: In your mind.

Re: Question about "Unknown Scenario" error

Post by bigkahuna »

Matherton wrote:...I am not sure that I should upload this scenario, because a) it is painfully uninteresting and b) it references the works of P.G. Wodehouse... and though I know that some of the Blandings Castle novels are in the public domain, I would hate to find out that there was a snag somewhere...
Campaign Help
If it is painfully uninteresting, trash it or (even better) revise it. We need an English campaign :lol2:
Now I don't know about you, but would you read a book about someone stealing an Englishman's pig? This just sounds like a kindergartener book (if you read it, my apologies :augh: )

What I would do is:

A. Read ESR (Author of Hammer of Thursagan)'s great Campaign Design How-to and storyboard the campaign beforehand.

B. Find a better topic, please...

What I usually do is:
A. Come up with the entire basic campaign plot

B. Write the scenario setting, basics, and gameplay

C. Write the scenario code and design the map.

NOTE: You generally want to design the map first, because you WILL have a lot of x and y placements if you are like me.
Copyright Info
Generally speaking, if it is copyrighted or you have a doubt about it, DON'T DO IT. Several people have made quasi-spoofs or near copies of books and movies into campaigns, and have been thorougly rebuffed and warned. If you want to do a campaign around that setting, ONLY take settings and basic stuff, change the names. If its an obscurish book I doubt anyone will mind.
Check out my campaign Sweet Revenge!
Join the new R2D forum!
Matherton
Posts: 62
Joined: August 2nd, 2010, 6:01 am

Re: Question about "Unknown Scenario" error

Post by Matherton »

Thanks for the advice! But actually P.G. Wodehouse wrote several humorous books for grown-ups about pig-theft, and I promise you they are hilarious. Check out, for example, Pigs Have Wings (I think that is the title) if you don't believe me. I am not planning to upload this scenario as an add-on, because it was really just for practice. I have never coded ANYTHING before, but I have a (totally unrelated) campaign idea, and so this scenario was just a test for me, to make sure I could write something basic that would run. And it does! This is exciting. I am really excited about writing a campaign, because it is a new way to tell a story and because I love playing Battle for Wesnoth. I actually have an MFA in Creative Writing/Fiction, and I think I can tell a story effectively (of course, the degree is no guarantee...)
I did look at the Campaign Design How-To, and I thought it made several good points, especially about variety of objectives and of enemies and allies.
I have worked out the basic arc of the plot and some specific scenes/scenarios... I tend to write/plot in no particular order once I have my plot worked out in broad, general outlines, but I know exactly what I want to happen in my first scenario and I am trying to code that now.
I will probably be posting lots of questions very soon.
User avatar
Neuromancer
Posts: 204
Joined: September 10th, 2010, 9:49 pm

Re: Question about "Unknown Scenario" error

Post by Neuromancer »

Hi, I'am working on scenario, doing it from A Simple Scenario template. I keep getting unknown scenario error. Tried everything, 99% sure paths are ok.

Here is _main.cfg:

Code: Select all

# The textdomain tells the engine where to look for translations.
[textdomain]
	name="wesnoth-Oppression"
	path="data/add-ons/Oppression/translations"
[/textdomain]

# Use the translation files from this campaign's /translations subdirectory for this file:
# textdomain wesnoth-Opression


[campaign]
	id=Oppression # Needed to connect savefiles with their campaign.
	name=_ "Oppression" # Displayed name to the user.
	abbrev=_"OPP" # Abbreviation used in savefiles.
	define=OPPRESSION # This symbol is defined once the player chooses to play the campaign.

	difficulties=EASY,NORMAL,HARD # which various difficulties the campaign shall have 
	difficulty_descriptions=_"&units/undead-necromancers/adept-magic-3.png=Easy;*&units/undead-necromancers/dark-sorcerer-attack-staff-2.png=Medium;&units/undead-necromancers/ancient-lich-magic-3.png=Difficult" # sets up the difficulties selection menu

	icon=misc/qmark.png # image in the campaign list
	image=portraits/elves/sorceress.png # campaign image right of the campaign list when selected
	description=_ "This is a stub of a campaign, intended to make life easier in creating a campaign. Contains about the bare minimum that's needed for a campaign and some helpful comments." # campaign description right of the campaign list when selected

	first_scenario=01_The_Incident # Scenario that gets chosen first from the scenario list. It looks for a scenario with this id, not with this filename.
[/campaign]

# Enter the following code block only if the player has chosen to play the campaign, thus preventing overwrite conflicts and speeding wesnoth up during startup:
#ifdef OPPRESSION

# Makes images available as subpaths of the .../Oppression/images/ directory.
[binary_path]
        path=data/add-ons/Oppression/
[/binary_path]

# {filepath} loads files from filepath
# ~ tells to look in the userdata directory, otherwise the wesnoth engine would look in the main data directory
# The order of these commands is important. Macros, which are defined in ~add-ons/Oppression/macros, are needed in the scenarios, thus they must be read previously to the scenarios.
{~add-ons/Oppression/macros}

{~add-ons/Oppression/scenarios}
# +units: Perform this command in that [units] tag which was read last - a tag in the wesnoth main data directory (I suppose...) and thus add custom units to the units known by the wesnoth engine.
[+units]
        {~add-ons/Oppression/units}
[/units]

#endif
And there is scenario file:

Code: Select all

[scenario]
	id=01_The_Incident # looked for by the engine
	name=_ "The Incident" # displayed scenario name
	map_data="{~add-ons/Oppression/maps/01_The_Incident.map}"

	turns=12



	victory_when_enemies_defeated=yes
	{DAWN}
	{MORNING}
	{AFTERNOON}
	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}

	[side]
		##:: Side Info
		side=1
		controller=human
		team_name=1 # used to determine which side is enemy or allied
		# The following line is a command for wmllint (a developer tool).
		# wmllint: local spelling foo
		user_team_name= _ "foo" # visible to the user

		##:: Leader Info
		type=Dwarvish Fighter
		id=His Awesomeness
		name=_"His Awesomeness"
		gender=male
		canrecruit=yes
		unrenamable=true

		##:: Recruit List
		recruit=Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Ulfserker,Dwarvish Guardsman

		##:: Gold and Income
		{GOLD 100 75 50}
		{INCOME 10 5 3}
	[/side]

	##|| Enemy
	[side]
		##:: Side Info
		side=2
		controller=ai
		team_name=2
		user_team_name= _ "bar"

		##:: Leader Info
		type=Elvish Fighter
		id=Lord Awesomeness
		name=_"Lord Awesomeness"
		gender=male
		canrecruit=yes
		unrenamable=true

		##:: Recruit List
		recruit=Elvish Fighter,Elvish Archer,Elvish Scout,Elvish Shaman

		##:: Gold and Income
		{GOLD 100 75 50}
		{INCOME 3 5 10}
	[/side]
	
	[event]
		name=start
		[message]
			speaker=narrator
			image=wesnoth-icon.png
			message=_"Welcome, future umc developer. This is a stub of a campaign, intended to make life easier in creating a campaign, since the by far most difficult part is the very start. This campaign contains about the bare minimum that's needed for a campaign and some helpful comments."
		[/message]
		[message]
			speaker=narrator
			image=wesnoth-icon.png
			# wmllint: local spellings wiki add-ons http wiki.wesnoth.org BuildingCampaignsTutorial FirstCampaign 
			message=_"There is a site in the wesnoth wiki related to this add-on, which also tells you where to look for this add-ons's files so you can actually read this message in the code instead of reading it on the screen: http://wiki.wesnoth.org/BuildingCampaignsTutorial/FirstCampaign"
		[/message]

		##:: Objectives
		[objectives]
			[objective]
				description= _ "Defeat the enemy leader"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of His Awesomenes"
				condition=lose
			[/objective]
			[objective]
				description= _ "Turns run out"
				condition=lose
			[/objective]
		[/objectives]
	[/event]
[/scenario]

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 »

Neuromancer wrote:Hi, I'am working on scenario, doing it from A Simple Scenario template. I keep getting unknown scenario error. Tried everything, 99% sure paths are ok.
Works just fine for me. On 1.8 it works whereas on 1.9 it dies when trying to include a directory which doesn't exist (macros/), which the error message quite clearly states.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Question about "Unknown Scenario" error

Post by SkyOne »

Neuromancer wrote:Hi, I'am working on scenario, doing it from A Simple Scenario template. I keep getting unknown scenario error. Tried everything, 99% sure paths are ok.
Nothing is wrong for me, too, on BfW 1.8.x.
You have changed the campaign folder name from A_Simple_Campaign to Oppression, haven't you?
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
User avatar
Neuromancer
Posts: 204
Joined: September 10th, 2010, 9:49 pm

Re: Question about "Unknown Scenario" error

Post by Neuromancer »

Downloaded 1.8.5., still unknown scenario error. Tryied at 1.9.1 got macro error, deleted all map and scenario files but the first ones. Tryied the same deletion thing on 1.8.4, and voila, scenario works. Thanks for prompt answers.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Question about "Unknown Scenario" error

Post by SkyOne »

Well, just a minor problem, but you keep the path for translations. So this had better be fixed:

Code: Select all

# textdomain wesnoth-Opression
Rarely, it makes a scenario sensitive to work.
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
User avatar
Neuromancer
Posts: 204
Joined: September 10th, 2010, 9:49 pm

Re: Question about "Unknown Scenario" error

Post by Neuromancer »

Now i am getting
The following add-on had errors and could not be loaded:
C:/Documents and Settings/All Users/Documents/Hry/Battle For Wesnoth/userdata/data/add-ons/Oppression/_main.cfg
ERROR DETAILS:
Missing closing tag for tag scenario at ~add-ons/Oppression/scenarios/01_The_Incident.cfg:12 included from ~add-ons/Oppression/_main.cfg:36, value '' at ~add-ons/Oppression/maps/01_The_Incident.map:28 included from ~add-ons/Oppression/scenarios/01_The_Incident.cfg:15 included from ~add-ons/Oppression/_main.cfg:36

20101028 14:57:35 error general: Unknown scenario: '01_The_Incident'
also in stderr.txt:
20101028 14:57:29 error config: File not found 'TRAIT_DEXTEROUS'
Version is 1.8.4
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Question about "Unknown Scenario" error

Post by SkyOne »

Hmmm... I just copied the files you posted, then installed them in A_Simple_Campaign.
It works fine on my computer (on BfW 1.8.5 and 1.8.0).
Attachments
Oppression.zip
(44.34 KiB) Downloaded 176 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
User avatar
Neuromancer
Posts: 204
Joined: September 10th, 2010, 9:49 pm

Re: Question about "Unknown Scenario" error

Post by Neuromancer »

This is whole campaign folder: I am sure the mistake I made is very simple... Also can you please point me to tutorial on new macro system in 1.9.0? I have read http://wiki.wesnoth.org/PreprocessorRef, but dont understand it. That lines in there am I supposed to write in _main.cfg file?
Attachments
Oppression.rar
(408.94 KiB) Downloaded 159 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 »

Neuromancer wrote:This is whole campaign folder: I am sure the mistake I made is very simple...
There's no mistake, it works in 1.8 just fine. Well, besides the fact that there's no macro called TRAIT_DEXTEROUS (it's TRAIT_DEXTROUS).
Neuromancer wrote:Also can you please point me to tutorial on new macro system in 1.9.0?
The only notable change I can think of is the fact that including non-existant files or directories or calling non-existant macros is now a fatal error whereas it isn't in 1.8.
User avatar
SkyOne
Posts: 1310
Joined: January 3rd, 2009, 7:23 pm

Re: Question about "Unknown Scenario" error

Post by SkyOne »

Yes. Just make Ariadne "canrecruit=yes" on 1.8.x.:smile:
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
User avatar
Neuromancer
Posts: 204
Joined: September 10th, 2010, 9:49 pm

Re: Question about "Unknown Scenario" error

Post by Neuromancer »

Thanks for solutions. However, I added a few new lines and the same error ):

EDIT: Worked it out, mistake was in unit macro, which i copyied from different campaign.

SOLVED ...for now.
Attachments
Oppression.rar
(409.13 KiB) Downloaded 136 times
Post Reply