Author Topic: Help with <attack-skills> tags  (Read 898 times)

ChupaReaper

  • Guest
Help with <attack-skills> tags
« on: 1 March 2012, 01:21:59 »
I read on the wiki that attack commands can use multiple attack skills like this:
<attack-skills>
    <attack-skill value="attack_skill">
         <flags>
etc.

On the wiki it lists some flags that can be used like <whenever-possible /> which is pretty self explanatory, what do the other flags do?
Can this be used to make a ranged unit use a melee attack instead if enemies are too close?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Help with <attack-skills> tags
« Reply #1 on: 2 March 2012, 06:58:33 »
Firstly, I don't know if these are properly working (if the implementation was even completed), but scroll down a bit further on XML/Commands and there's the description. But to quote:

A GAE only alternative method of specifying the attack skill, this allows the attacks to be chosen based on the target. This uses a system of flags such as <whenever-possible /> or <at-max-range /> to specify circumstances in which to choose different skills. This is read from the top down (so the first one will be followed if the tag evaluates as true, even if the second one does too) and allows the AI to, for example, use a long ranged bow when the foe is far away, but otherwise use a short ranged sword.

Possible flags are: <whenever-possible />, <at-max-range />, <on-large />, <on-building />, and <when-damaged />. The attack-skill value is the attack skill to use when that flag is active. There can be multiple flags per attack-skill.

I never tested them myself, but they were on a page created by daniel some time back and was written as though they were implemented (I didn't record the ones that were stated as "not implemented", namely the undead flag -- which would be better done with tags anyway).
« Last Edit: 18 June 2016, 13:38:54 by filux »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything