Stationary units

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

Stationary units

Post by EaldenNW »

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 »

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 »

I'm just wondering what makes them stationary
Ealden
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Stationary units

Post by zookeeper »

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 »

Thanks
Ealden
Post Reply