macro is not found

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
Anagkai
Posts: 58
Joined: February 12th, 2012, 10:05 am

macro is not found

Post by Anagkai »

I have the problem that one of my macros isn't found when preprocessing the scenario. The macro is in the same file, above where it's called, it's spelled correctly and the number of arguments is correct. Therefore, I'm pretty sure there is a mistake inside the macro but so far I wasn't able to find it...

Here's the code:

Code: Select all

#define LOST_MONEY_EVENT X Y
	[event]
		name=moveto
		[filter]
			x,y={X},{Y}
			id=Rodolf
		[/filter]
		[message]
			speaker=Rodolf
			message=_"I can see something glitter on the bottom of the oasis! It looks like coins!"
		[/message]
		[message]
			speaker=Rodolf
			message=_"Probably just a mirage. Or not... There's only one way to find out!"
		[/message]
		[message]
			speaker=narrator
			image="wesnoth-icon.png"
			message=_"Rodolf jumps into the cold water and is completely baffled when he actually finds gold on the bottom of the pond."
		[/message]
		[gold]
			side=1
			amount=25
		[/gold]
		[message]
			speaker=narrator
			image="wesnoth-icon.png"
			message=_"You receive XXX golden coins."
		[/message]
	[/event]
#enndef

#define LOST_MONEY X1 Y1 X2 Y2 X3 Y3
	[set_variable]
		name=rand_val
		rand=1..3
	[/set_variable]
	[switch]
		variable=rand_val
		[case]
			value=1
			{LOST_MONEY_EVENT {X1} {Y1}}
		[/case]
		[case]
			value=2
			{LOST_MONEY_EVENT {X2} {Y2}}
		[/case]
		[else]
			{LOST_MONEY_EVENT {X3} {Y3}}
		[/else]
	[/switch]
	{CLEAR_VARIABLE rand_val}
#enddef
It's the second one. My other macros don't show this problem. Any help is appreciated.
My campaigns: Princess Nilwyn (available) & Home of the Undead (available)

User avatar
Ravana
Forum Moderator
Posts: 2312
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: macro is not found

Post by Ravana »

enndef -> enddef.

Post Reply