Why doesn't this work?

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
Stilgar
Posts: 465
Joined: January 21st, 2006, 8:22 pm

Why doesn't this work?

Post by Stilgar »

Okay, this is my first attempt at coding out a scenario by hand, using some of the default ones as a reference, and I can't figure out what is wrong with it. The map appears as it should, as far as I can explore it, but as soon as I end my first turn the game ends with "You have been defeated!"

Any clue what I did wrong?

(Yes, this is somewhat incomplete, as you can see I haven't put in the "death of 3 or more henchmen" condition yet, but that's not the issue, and I don't see what's in here that's making it break.)

Code: Select all

[scenario]
id=1_VladimirsTomb
name=_"Vladimir's Tomb"
map_data="{@campaigns/Jaeger/maps/1_VladimirsTomb}"
next_scenario=dont_know
[music]
	name=underground.ogg
	ms_before=500
[/music]

{UNDERGROUND}

victory_when_enemies_defeated=no
{TURNS 24 24 24}

[event]
name=prestart
	[objectives]
		side=1
		[objective]
			description= _ "Search the tomb for loot"
			condition=win
		[/objective]
		[objective]
			description= _ "Death of Jaeger"
			condition=lose
		[/objective]
		[objective]
			description= _ "Death of 3 or more henchmen"
			condition=lose
		[/objective]
		[objective]
			description= _ "Turns run out"
			condition=lose
		[/objective]
	[/objectives]
[/event]

[side]
	side=1
	type=Rogue 
	description=Jaeger
	user_description=_"Jaeger"
	unrenamable=yes
	{IS_HERO}
	team_name=a
	controller=human
	fog=no
	shroud=yes
	{GOLD 125 100 80}
	canrecruit=0
	[unit]
		description=Ralph
		user_description=_"Ralph"
		type=Thug
		side=1
		x=4
		y=15
		[modifications]
			{TRAIT_STRONG}
			{TRAIT_LOYAL}
		[/modifications]
	[/unit]
	[unit]
		description=Gunnar
		user_description=_"Gunnar"
		type=Footpad
		side=1
		x=5
		y=15
		[modifications]
			{TRAIT_QUICK}
			{TRAIT_LOYAL}
		[/modifications]
	[/unit]
	[unit]
		description=Bruno
		user_description=_"Bruno"
		type=Footpad
		side=1
		x=6
		y=15
		[modifications]
			{TRAIT_RESILIENT}
			{TRAIT_LOYAL}
		[/modifications]
	[/unit]
	[unit]
		description=Ian
		user_description=_"Ian"
		type=Footpad
		side=1
		x=7
		y=15
		[modifications]
			{TRAIT_QUICK}
			{TRAIT_LOYAL}
		[/modifications]
	[/unit]
	[unit]
		description=Sven
		user_description=_"Sven"
		type=Thug
		side=1
		x=6
		y=16
		[modifications]
			{TRAIT_RESILIENT}
			{TRAIT_LOYAL}
		[/modifications]
	[/unit]
[/side]

[side]
	side=2
	#ifdef EASY
	type=Skeleton Archer
	#endif
	#ifdef NORMAL
	type=Bone Shooter
	#endif
	#ifdef HARD
	type=Bone Shooter
	#endif
	description=Vladimir
	user_description=_"Vladimir"
	unrenamable=yes
	team_name=b
	fog=yes
	shroud=yes
	canrecruit=0
	[unit]
		type=Vampire Bat
		side=2
		x=9
		y=19
	[/unit]
	[unit]
		type=Vampire Bat
		side=2
		x=14
		y=12
	[/unit]
	[unit]
		type=Vampire Bat
		side=2
		x=10
		y=5
	[/unit]
[/side]

	[item]
	x=18
	y=2
	image=items/ankh_necklace.png
	[/item]
	
	[event]
		name=moveto
		[filter]
			x=18
			y=2
			side=1
			description=Jaeger
		[/filter]
			[message]
				speaker=unit
				message= _ "What a strange looking amulet..."
			[/message]
			[message]
				speaker=narrator
				message= _ "Jaeger pockets the mysterious amulet."
			[/message]
			[message]
				speaker=unit
				message= _ "Okay men, let's leave this place."
			[/message]
		[removeitem]
			x=18
			y=2
		[/removeitem]
		[endlevel]
			result=continue
		[/endlevel]
	[/event]
	
	[item]
	x=2
	y=5
	image=items/chest_plain_closed.png
	[/item]
	
	[event]
		name=moveto
		[filter]
			x=2
			y=5
			side=1
		[/filter]
			[message]
				speaker=unit
				message= _ "I found 100 pieces of gold in this box!"
			[/message]
			[gold]
				side=1
				amount=100
			[/gold]
		[removeitem]
			x=2
			y=5
		[/removeitem]
	[/event]

	[item]
	x=6
	y=18
	image=items/chest_plain_closed.png
	[/item]
	
	[event]
		name=moveto
		[filter]
			x=6
			y=18
			side=1
		[/filter]
			[message]
				speaker=unit
				message= _ "I found 100 pieces of gold in this box!"
			[/message]
			[gold]
				side=1
				amount=100
			[/gold]
		[removeitem]
			x=6
			y=18
		[/removeitem]
	[/event]
	
	[item]
	x=18
	y=17
	image=items/chest_plain_closed.png
	[/item]
	
	[event]
		name=moveto
		[filter]
			x=18
			y=17
			side=1
		[/filter]
			[message]
				speaker=unit
				message= _ "I found 100 pieces of gold in this box!"
			[/message]
			[gold]
				side=1
				amount=100
			[/gold]
		[removeitem]
			x=18
			y=17
		[/removeitem]
	[/event]
	
	[event]
		name=die
		[filter]
			description=Vladimir
		[/filter]
		[message]
			speaker=second_unit
			message= _ "Die again wretch, and stay dead!"
		[/message]
	[/event]

	[event]
		name=die
		[filter]
			description=Jaeger
		[/filter]
		[message]
			description=Jaeger
			message= _ "Unh...  I don't think I can make it...  Save yourselves, my comrades, and leave me behind..."
		[/message]
		[endlevel]
			result=defeat
		[/endlevel]
	[/event]
	
	[event]
	name=time over
		[message]
			description=Jaeger
			message= _ "I think we've got all we're going to find.  Let's get out of this place."
		[/message]
	[/event]
	
[/scenario]
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

My guess is that it's because of the canrecruit=0 of side 1. Change it to canrecruit=1 to see if it was really the cause. You can have an empty recruit list, so there's really no great drawbacks to setting it to 1, even if you don't want the player to be able to recruit anything in the scenario.

You probably also want to add controller=ai to the definition of side 2.
Stilgar
Posts: 465
Joined: January 21st, 2006, 8:22 pm

Post by Stilgar »

Yes, I made both those changes and it works now. Thanks.
Post Reply