Turn problems

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
Nicolas
Posts: 349
Joined: May 18th, 2005, 4:41 pm
Location: In the isle of Anduin,chasing the Undead.

Turn problems

Post by Nicolas »

I have a scenario with this code

Code: Select all

[scenario]
	id=Snow3
	name= _ "The Encampement"
	next_scenario=Snow4
	map_data="HSHSSHSHSSSSHSHHSHSS
2SHSHSSSSSSSSSSSSSHH
SHSSSSSSSSSSSHSSSSSH
SHSSSSHSHSHSSSHSSHSS
SSSHHSSSSSSSSSSSSHSS
SSHSHHSSHSHSSSHSHHSS
SSSHSSSSSSSSSSHSHSHS
SSSSSSHSSHSSHHSSHHHS
HSSSSSSSnKnSSHSSSHHS
SSSSSSHSK3KSHSSSSSSS
SSHSHSSSnSnHHSHSSHHS
SSSSSHHSHHSSHSSSSHSS
SHSSSSSSSSSSHHSHSSSS
SSHHSSSSSSSHSSSSSSHS
SSSHSSHSHSHSSSSSSHHS
HSHHSSSHSSSSSSHSS1SH
HSHHSHHHHHHSSHSHSSHH
HHHHSSHSSSHSHSHSSSSH
SHHHSSSHSSHSSSHHSHHS
SSHSSSHHHSSHHSSSHSSS"
	music="wesnoth-1.ogg"
	victory_when_enemies_defeated=no
	{TURNS 30 25 18}

	{DUSK}
	{FIRST_WATCH}
	{FIRST_WATCH}
	{SECOND_WATCH}
	{SECOND_WATCH}
	{DAWN}
	{MORNING}
	{AFTERNOON}
	{DUSK}
	{FIRST_WATCH}
	{SECOND_WATCH}
	{DAWN}
	{MORNING}
	{MORNING}
	{AFTERNOON}
	{AFTERNOON}
	[event]
	name=prestart
		[objectives]
		side=1
		note= _ "Capture the Wolves by making them move on a trap"
			[objective]
				description= _ "Capture four Wolves"
				condition=win
			[/objective]
			[objective]
				description= _ "Death of Lenwe Isilra"
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of the Encampement Leader "
				condition=lose
			[/objective]
			[objective]
				description= _ "Death of Aredhel"
				condition=lose
			[/objective]
		[/objectives]
	[/event]
	[side]
	team_name=ally
	type=hero1
	description=Lenwe Isilra
	user_description= _ "Lenwe Isilra"
	unrenamable=yes
	side=1
	canrecruit=0
	controller=human
	[/side]
	[side]
	type=Wolf
	description=Wolf
	user_description= _ "Wolf"
	side=2
	canrecruit=0
	{GOLD 0 0 0}
	{INCOME 0 0 0}
	[/side]
	[side]
	team_name=ally
	type=Spearman
	description=Ghouras
	user_description= _ "Ghouras"
	side=3
	canrecruit=0
	{GOLD 0 0 0}
	{INCOME 0 0 0}
	[/side]
	[event]
	name=prestart
	[recall]
	description=Aredhel
	[/recall]
	[recall]
	description=Ciryan
	[/recall]
	[terrain]
	letter=S
	x=1
	y=2
	[/terrain]
	[unit]
	description=Aredhel
	x=20
	y=20
	side=1
	type=hero2
	[/unit]
	[terrain]
	letter=S
	x=18
	y=16
	[/terrain]
	[set_variable]
	name=captures
	value=0
	[/set_variable]
	[item]
	x,y=7,6
	image=items/trap1.png
	[/item]
	[item]
	x,y=11,6
	image=items/trap1.png
	[/item]
	[item]
	x,y=5,9
	image=items/trap1.png
	[/item]
	[item]
	x,y=8,7
	image=items/trap1.png
	[/item]
	[item]
	x,y=13,8
	image=items/trap2.png
	[/item]
	[item]
	x,y=6,10
	image=items/trap2.png
	[/item]
	[item]
	x,y=2,10
	image=items/trap2.png
	[/item]
	[item]
	x,y=14,5
	image=items/trap2.png
	[/item]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[unit]
	type=Wolf
	side=2
	description=A pesky Wolf
	user_description= _ "A pesky Wolf"
	x=2
	y=2
	[/unit]
	[/event]
	[event]
	name=die
	[filter]
	description=Aredhel
	[/filter]
	[message]
	description=Lenwe Isilra
	message= _ "My dear Aredhel! Dead! No it can't be!"
	[/message]
	[endlevel]
	result=defeat
	bonus=no
	[/endlevel]
	[/event]
	[event]
	name=die
	[filter]
	description=Ghouras
	[/filter]
	[message]
	description=Lenwe Isilra
	message= _ "I Didnt managed to capture enough wolves AND i brought his death..."
	[/message]
	[endlevel]
	result=defeat
	bonus=no
	[/endlevel]
	[/event]
	[event]
	name=end of turns
	[message]
	description=Lenwe Isilra
	message= _ "We cant wait anymore... We must absolutely go. This encampement is destined to die."
	[/message]
	[endlevel]
	result=defeat
	bonus=no
	[/endlevel]
	[/event]
	[event]
	name=die
	[filter]
	description=Lenwe Isilra
	[/filter]
	[message]
	description=Ghouras
	message= _ "May the Wolves be damned!"
	[/message]
	[endlevel]
	result=defeat
	bonus=no
	[/endlevel]
	[/event]
	[event]
	name=variable
	[filter]
	variable=captures
	equals=4
	[/filter]
	[message]
	description=Lenwe Isilra
	message= _ "Ok, we got enough wolves."
	[/message]
	[message]
	description=Ghouras
	message= _ "Thanks man! I' ll send my mans to take the wolves from the traps. We are with you!"
	[/message]
	[message]
	description=Aredhel
	message= _ "Great! Now we shouldent have problems for the rest of the travel"
	[/message]
	[endlevel]
	result=victory
	bonus=yes
	[/endlevel]
	[/event]
	[event]
	name=start
	[message]
	description=Ghouras
	message= _ "Hi adventurer, i am happy to see you but our provisions are low... if we dont capture at least four wolves to eat before the supplies arrive we will die"
	[/message]
	[message]
	description=Lenwe Isilra
	message= _ "Ok, i'll manage it. Can i use the traps you placed?"
	[/message]
	[message]
	description=Ghouras
	message= _ "Yes, just make the wolves walk on them and they will be captured. Thanks for helping, if you need any type of help we will help you!"
	[/message]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=7
	y=6
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=8
	y=7
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=11
	y=6
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=5
	y=9
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=2
	y=10
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=13
	y=8
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]
	[event]
	name=moveto
	[filter]
	side=2
	x=6
	y=10
	[/filter]
	[set_variable]
	name=captures
	add=1
	[/set_variable]
	[/event]	
[/scenario]
Ignore all the other errors;
I play my scenario: it starts "it's your turn". I move my units, i press end turn and suddently it says "you lost" before switching turn to side 2. Why?
Great Mage Nicolas
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

If you don't have a unit with canrecruit=1 on your team, you lose once you end your turn. ;)
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Nicolas
Posts: 349
Joined: May 18th, 2005, 4:41 pm
Location: In the isle of Anduin,chasing the Undead.

Post by Nicolas »

lol :lol: thanks didnt thought about it... thx

and... what u say if you care about the other errors?
Great Mage Nicolas
Post Reply