Need a macro...

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
dantheperson
Posts: 18
Joined: November 18th, 2005, 10:23 pm

Need a macro...

Post by dantheperson »

Can someone make a macro that allows a human controlled side's leader to be at a certain space depending on a variable.

An if statement for the map doesn't seam to work.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Uh... I'm not sure what you mean...

Do you mean, you want the map to be different depending on a variable? That's easy - create two versions of the map, have one be the default, and [if] the [variable] is set to the trigger, do a [terrain_overlay] to replace the map with the old one.
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
dantheperson
Posts: 18
Joined: November 18th, 2005, 10:23 pm

Post by dantheperson »

No I want the starting position for team 1 to be different depending on a variable.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Code: Select all

[event]
name=prestart

[if]
[variable]
name=the_variable
numerical_equals=1
[/variable]

[then]

#Erase the old castle and keep (this overwrites it with grass)

[terrain]
x=10-15
y=3-6
letter=g
[/terrain]

#Make the new castle and keep

[terrain]
x=32-34
y=13-14
letter=C
[/terrain]
[terrain]
x=33
y=13
letter=K
[/terrain]

# Move the leader to the new keep location
[teleport]
[filter]
side=2
[/filter]
x=33
y=13
[/teleport]

[/then]
[else]

# Do nothing or whatever

[/else]

[/if]
It would actually be easier to make the map with both castles already on the map and overwrite the one you don't want.
Hope springs eternal.
Wesnoth acronym guide.
dantheperson
Posts: 18
Joined: November 18th, 2005, 10:23 pm

Post by dantheperson »

Alright, thanks.
Post Reply