Help with 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.
Post Reply
cheetah1011
Posts: 24
Joined: January 14th, 2008, 5:04 pm

Help with scenario

Post by cheetah1011 »

This scenario loads up but then immediately ends and goes to the end game screen.

Code: Select all

[scenario]
  id=1_Invasion
  next_scenario=2_Retreat
  name=Invasion
  map_data="{campaigns/Cat_Campaign/maps/1_Invasion}{~campaigns/Cat_Campaign/maps/1_Invasion}"
  turns=20
  {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 Riverwind"
        condition=lose
      [/objective]
    [/objectives]
  [/event]
  [side]
    side=1
    controller=human
    team_name=1
    user_team_name= _ "Konrad's forces"
    type=Cat Warrior
    description=Riverwind
    canrecruit=1
    recruit=Cat Apprentice,Cat Apprentice Mage,Cat Deputy
    {GOLD 100 70 50}
    {INCOME 10 7 5}
  [/side] 
  [side]
    side=2
    controller=ai
    team_name=2
    user_team_name="invading humans"
    type=General
    description=Galga
    canrecruit=1
    #ifdef EASY
     recruit=Spearman,Cavalryman,Bowman
     recruitment_pattern=fighter,fighter,archer,scout
     gold=50
    #endif
    #ifdef NORMAL
     recruit=Spearman,Cavalryman,Bowman,Heavy Infantryman 
     recruitment_pattern=fighter,fighter,archer,scout
     gold=75
    #endif
    #ifdef HARD
     recruit=Spearman,Cavalryman,Bowman,Heavy Infantryman,Horseman
     recruitment_pattern=fighter,fighter,archer,scout
     gold=100
    #endif
    aggression=1.0
    village_value=1.0
    leader_value=50.0
    enemy=1
  [/side]
  [event]
    name=enemies defeated
    [endlevel]
      result=victory
      bonus=yes
    [/endlevel]
  [/event]
[/scenario]
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Post by AI »

not sure what the problem is, but AI-related keys (like aggression, recruitment_pattern and stuff) should be inside [ai][/ai] tags

also, I don't believe the key 'enemy' exists.
Derekkk
Posts: 64
Joined: April 25th, 2007, 5:43 pm

Post by Derekkk »

Did you specify the starting location for side 2?
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Post by AI »

I believe that would generate an error, rather than an immediate end of scenario.
cheetah1011
Posts: 24
Joined: January 14th, 2008, 5:04 pm

Post by cheetah1011 »

The enemy tag was in the wiki guide to building scenarios. Also, I tried putting those tags inside the [ai] tags but it didn't make a difference.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Help with scenario

Post by zookeeper »

cheetah1011 wrote:This scenario loads up but then immediately ends and goes to the end game screen.
How do you know it "loads up"? My guess would be that you got the scenario id wrong in your first_scenario= in your [campaign], which would cause the campaign to end as soon as it starts. Otherwise I can't see what could cause it.
cheetah1011
Posts: 24
Joined: January 14th, 2008, 5:04 pm

Post by cheetah1011 »

It is right in the campaign tag.

Code: Select all

    [textdomain]
         name="wesnoth-Cat_Campaign"
         path="data/campaigns/Cat_Campaign/translations"
    [/textdomain]
    [campaign]
    #textdomain wesnoth-Cat_Campaign
    name= _ "Cat Campaign"
    abbrev=CC
    define=CAMPAIGN_CAT_CAMPAIGN
    icon=orion.png
    image=orion.png
    description= _ "Lead your cats to victory against the evil human invaders!"
    difficulties=EASY,NORMAL,HARD
    difficulty_descriptions={MENU_IMG_TXT2 *&units/human-loyalists/peasant.png~TC(1,magenta)_"Civilian"} +
    ";" + {MENU_IMG_TXT2 units/human-loyalists/spearman.png~TC(1,magenta)_"Soldier"} +
    ";" + {MENU_IMG_TXT2 units/human-loyalists/pikeman.png~TC(1,magenta)_"Veteran"}
    first scenario=1_Invasion
    [/campaign]
#ifdef CAMPAIGN_CAT_CAMPAIGN

{@campaigns/Cat_Campaign/scenarios}
[+units]
{@campaigns/Cat_Campaign/units}
[/units]

#endif
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

cheetah1011 wrote:It is right in the campaign tag.

Code: Select all

    first scenario=1_Invasion
...no, it is not.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Post by AI »

Just about everything on computers is case sensitive, only windows is not.
cheetah1011
Posts: 24
Joined: January 14th, 2008, 5:04 pm

Post by cheetah1011 »

But that is exactly the same as the scenario id, isn't it?
User avatar
governor
Posts: 267
Joined: December 8th, 2006, 12:32 am

Post by governor »

From:

http://www.wesnoth.org/wiki/CampaignWML ... ign.5D_tag

# first_scenario: the ID of the first scenario in the campaign; see id in ScenarioWML

What you have is:
first scenario =

Notice that:
first scenario != first_scenario
cheetah1011
Posts: 24
Joined: January 14th, 2008, 5:04 pm

Post by cheetah1011 »

Thanks alot! It works now.
Post Reply