Little problem
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.
- Casual User
- Posts: 475
- Joined: March 11th, 2005, 5:05 pm
Little problem
Good afternoon!
I've defined a little custom macro, and it doesn't work. It's supposed to generate alternativly a ghoul, a blood bat, a soulless and then a ghoul again. The rune and the first ghoul pop out all right, but it doesn't do anything from then on. I've racked my brain trying to figure out how to make it work. Here's the macro:
Thanks in advance
I've defined a little custom macro, and it doesn't work. It's supposed to generate alternativly a ghoul, a blood bat, a soulless and then a ghoul again. The rune and the first ghoul pop out all right, but it doesn't do anything from then on. I've racked my brain trying to figure out how to make it work. Here's the macro:
Code: Select all
#define RUNE_GHOUL SIDE X Y
[event]
name=start
{IMAGE item-rune4.png {X} {Y}}
[set_variable]
name=rotate
equals=1
[/set_variable]
[unit]
side={SIDE}
type=Ghoul
x={X}
y={Y}
[/unit]
[/event]
[event]
name=new turn
first_time_only=no
[if]
[variable]
name=rotate
equals=1
[/variable]
[then]
[unit]
side={SIDE}
type=Blood Bat
x={X}
y={Y}
[/unit]
[set_variable]
name=rotate
equals=2
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=rotate
equals=2
[/variable]
[then]
[unit]
side={SIDE}
type=Soulless
x={X}
y={Y}
[/unit]
[set_variable]
name=rotate
equals=3
[/set_variable]
[/then]
[/if]
[if]
[variable]
name=rotate
equals=3
[/variable]
[then]
[unit]
side={SIDE}
type=Ghoul
x={X}
y={Y}
[/unit]
[set_variable]
name=rotate
equals=1
[/set_variable]
[/then]
[/if]
[/event]
#enddef
This does not give the variable a new value. The equals, greater_than etc. keys should only be used in an [if] [variable], not in [set_variable]. Use value instead to set a new value:Casual User wrote:Code: Select all
[set_variable] name=rotate equals=2 [/set_variable]
Code: Select all
[set_variable]
name=rotate
value=2
[/set_variable]