Two Questions (moveto radius etc)

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
User avatar
Longbow
Posts: 303
Joined: May 18th, 2008, 3:59 pm

Two Questions (moveto radius etc)

Post by Longbow »

Hi,

I would like to have the enemy leader run away when one of my units or allied units get within 2 hexes of his location but it only seems to work if they actually stand on the exact hex, not go within a 2 hex radius.

Code: Select all

[event]
      name=moveto
      first_time_only=yes
      [filter]
         side=1,2,3,4,5
         x=40
         y=4
         radius=2
[/filter]
messages etc.
[/event]
Also, I think there is a way to limit the number of a certain unit that the Ai can recruit, can anyone tell me how to do that?

Help appreciated.
My campaign, Elvish Legacy
My inventively named Era
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Two Questions (moveto radius etc)

Post by zookeeper »

There's no radius= in SUF. A SUF can have a [filter_location] though.
User avatar
Longbow
Posts: 303
Joined: May 18th, 2008, 3:59 pm

Re: Two Questions (moveto radius etc)

Post by Longbow »

I did this:

[event]
name=moveto
first_time_only=yes
[filter]
side=1,2,3,4,5
[filter_location]
x=40
y=4
radius=2
[/filter_location]
[/filter]

Like I think you said, and it worked, ty loads :)

Do you have an answer to my second question?
My campaign, Elvish Legacy
My inventively named Era
User avatar
TheJM
Posts: 130
Joined: January 9th, 2009, 6:22 pm

Re: Two Questions (moveto radius etc)

Post by TheJM »

Check the macros page for the macro named {LIMIT_CONTEMPORANEOUS_RECRUITS}..

http://www.wesnoth.org/macro-reference.xhtml
User avatar
Longbow
Posts: 303
Joined: May 18th, 2008, 3:59 pm

Re: Two Questions (moveto radius etc)

Post by Longbow »

Ty, I used {LIMIT_RECRUITS} and it's all good, thanks for the help :)
My campaign, Elvish Legacy
My inventively named Era
Post Reply