Stationary units

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
EaldenNW
Posts: 18
Joined: August 6th, 2014, 5:51 pm

Stationary units

Post by EaldenNW » August 27th, 2014, 1:30 am

Hey,

Does anyone know how to make enemy units stationary unless they see you, like in hide and seek in liberty.
Help is appreciated.
Thanks in advance,
Ealden
Ealden

Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Stationary units

Post by Max » August 27th, 2014, 12:04 pm

if you like what you saw in liberty you might just copy the relevant parts...

there's even some in-line documentation related to the guard units:
https://github.com/wesnoth/wesnoth/blob ... d_Seek.cfg

or are you looking for something less complicated?

EaldenNW
Posts: 18
Joined: August 6th, 2014, 5:51 pm

Re: Stationary units

Post by EaldenNW » August 27th, 2014, 12:25 pm

I'm just wondering what makes them stationary
Ealden

User avatar
zookeeper
WML Wizard
Posts: 9740
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Stationary units

Post by zookeeper » August 27th, 2014, 1:03 pm

The usual way is to give ai_special=guardian to the units you only want to move/attack if they can reach an enemy in one turn. Hide and Seek does things in a lot more complicated way, by switching the units from the completely idle side to a normal side, and vice versa.

EaldenNW
Posts: 18
Joined: August 6th, 2014, 5:51 pm

Re: Stationary units

Post by EaldenNW » August 27th, 2014, 1:09 pm

Thanks
Ealden

Post Reply