my campaign doesn't start

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
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

my campaign doesn't start

Post by fearbear »

hello everyone,

I 'm new to campaign creating, and my first try ended very bad:
when I started my campaign and set the difficulty, the game crashed. I don't know what I did wrong.

This is the scenario code:

Code: Select all

[scenario]

id=Strijd_Der_ElementenSC1
next_scenario=null

name=Strijd Der Elementen
map_data="{campaigns/Strijd_Der_Elementen/maps/Strijd_Der_Elementen}"
turns=100

{DAWN}
{AFTERNOON}
{SECOND_WATCH}
{SECOND_WATCH}
{SECOND_WATCH}

music=wesnoth-1.ogg

[event]
name=prestart
 [objectives]
 side=1
 [objective]
   description=_ "Versla Murdock"
   condition=win
 [/objective]
 [objective]
   description=_ "Krodar verslagen"
   condition=lose
  [/objective]
 [/objectives]
[/event]

[side]
side=1
controller=human
team_name=1

type=Lieutenant
description=Krodar
canrecruit=1

recruit=Cavalryman, Dark Adept, Fencer, Footpad, Heavy Infantryman, Spearman, Bowman, Thief, Thug

{GOLD 500 200 100}
{INCOME 10 5 2}
[/side]
[side]
side=2
controller=ai
team_name=1

type=Lieutenant
description=Drokar
canrecruit=1

recruit=Heavy

{GOLD 200 100 50}
{INCOME 5 2 1}
[/side]
[side]
side=3
controller=ai
team_name=2

type=Lieutenant
description=Murdock
user_description=_ "Murdock"
canrecruit=1

recruit=
{GOLD 200 500 1000}
{INCOME 2 5 10}
[/side]


[/scenario]
(i've put this in the folder Wesnoth/data/campaigns/Strijd_Der_Elementen/scenarios)

this is the file located in wesnoth/data/campaigns:

Code: Select all

[campaign]
id=Strijd_Der_Elementen
name=_ "Strijd Der Elementen"
define=CAMPAIGN_STRIJD_DER_ELEMENTEN
first_scenario=Strijd_Der_ElementenSC1
difficulties=EASY,NORMAL,HARD

difficulty_descriptions="*&units/human-loyalists/fencer.png=Easy;&units/human-loyalists/duelist.png=Medium;&units/human-loyalists/master-at-arms.png=Hard"
icon=units/human-loyalists/lieutenant.png
description="Beschrijving"

[/campaign]

[binary_path]
path=data/campaigns/Strijd_Der_Elementen
[/binary_path]
My map works fine, i tested it in multiplayer mode.

I hope i've given enough information for you to solve my problem

thanks,

fearbear[/code]
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I found two things:
the side key does not exist for the tag [objectives].
Heavy is no official unit. You probably wanted Heavy Infanterymans.
First read, then think. Read again, think again. And then post!
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

Post by fearbear »

I have corrected the things you said (thanks for that)
but it still doesn't work. Any other suggestions?
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Set the music name under quote marks please. I don´t know if it hurts without them, but they are commonly used.

Other...nothing found.

I don´t know if the difficulty descriptions are right, but you better use the MENU_IMG_TXT macro.
First read, then think. Read again, think again. And then post!
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

fearbear wrote:this is the file located in wesnoth/data/campaigns:

Code: Select all

[campaign]
id=Strijd_Der_Elementen
name=_ "Strijd Der Elementen"
define=CAMPAIGN_STRIJD_DER_ELEMENTEN
first_scenario=Strijd_Der_ElementenSC1
difficulties=EASY,NORMAL,HARD

difficulty_descriptions="*&units/human-loyalists/fencer.png=Easy;&units/human-loyalists/duelist.png=Medium;&units/human-loyalists/master-at-arms.png=Hard"
icon=units/human-loyalists/lieutenant.png
description="Beschrijving"

[/campaign]

[binary_path]
path=data/campaigns/Strijd_Der_Elementen
[/binary_path]
You need to include your scenarios inside an #ifdef, otherwise the game doesn't ever read in your scenario files. So, this is what you add to the bottom of that file:

Code: Select all

#ifdef CAMPAIGN_STRIJD_DER_ELEMENTEN
    {@campaigns/Strijd_Der_Elementen/scenarios/}
#endif
You probably should move the [binary_path] inside that #ifdef, too, although it's in no way required. Also, if you have .cfg files elsewhere than campaigns/Strijd_Der_Elementen/scenarios/, include them or the directories in the same manner.
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

Post by fearbear »

thank you very much,
now the game doesn't crash anymore, and that's a big step.

now, there only appears an error message, saying: the game couldn't start, invalid position for leader (0,0)

what can i do about that?
User avatar
Ranger M
Art Contributor
Posts: 1965
Joined: December 8th, 2005, 9:13 pm
Location: England

Post by Ranger M »

To decide where the leader starts, a 1 (if side 1) is put in the map file, wherever you want his keep (and 2 for 2, etc)

you probably haven't put one in.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Ranger M wrote:To decide where the leader starts, a 1 (if side 1) is put in the map file, wherever you want his keep (and 2 for 2, etc)

you probably haven't put one in.
Yep. If you're using the map editor, just remember to place the starting positions for all sides with it.
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

thank you

Post by fearbear »

thank you so much for helping me out. I really appreceated it.
If I can ever do something for you, just tell me.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: thank you

Post by zookeeper »

fearbear wrote:If I can ever do something for you, just tell me.
How about a good campaign? :P
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

Post by fearbear »

yes, i'm trying, but again, i have a problem:

I made a new unit for the enemy, but each time i start my campaign, its says: error: can't find unit "Olivian" (thats the name of my unit)

in the caller script, i put this:

Code: Select all

#ifdef CAMPAIGN_STRIJD_DER_ELEMENTEN
    {@campaigns/Strijd_Der_Elementen/scenarios/}
    {@campaigns/Strijd_Der_Elementen/units/}
#endif
so i told where my unit is located, but it still doesn't work.
:?: :?: :?:


fearbear
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

fearbear wrote:yes, i'm trying, but again, i have a problem:

I made a new unit for the enemy, but each time i start my campaign, its says: error: can't find unit "Olivian" (thats the name of my unit)

in the caller script, i put this:
so i told where my unit is located, but it still doesn't work.
:?: :?: :?:


fearbear
It sounds like you are missing a [+units] tag. Try this:

Code: Select all

#ifdef CAMPAIGN_STRIJD_DER_ELEMENTEN
[+units]
    {@campaigns/Strijd_Der_Elementen/units/}
[/units]
    {@campaigns/Strijd_Der_Elementen/scenarios/}
#endif
Hope springs eternal.
Wesnoth acronym guide.
fearbear
Posts: 6
Joined: May 3rd, 2006, 5:16 pm

Post by fearbear »

thank you, that helped
Post Reply