Version 2 (modified by leper, 10 years ago) ( diff )

Fix link

Aura templates are the JSON part of auras. They define what effect the aura will have on certain unit types. The same aura files can be reused on different auras to apply differently to units. The format is similar to the Technology Templates, but a lot less complicated. The files are put in simulation/data/auras.

The auras can be used on an entity by including the following part in the entity XML:

  <Auras>
    <heal>
      <Type>range</Type>
      <Radius>40</Radius>
    </heal>
  </Auras>

Where "heal" is the name of the aura (the filename without the .json extension), the Type can currently be range, global, formation or garrison. The range type also requires an extra Radius (as in the example), all entities in this Radius will be affected by the aura. Global auras work on all entities (like technologies, but the working is reverted when the entity with an aura dies). Global and range auras also affect the unit itself when applicable. Formation auras affect all members of the same formation as the unit. Note that formation auras aren't very usefull currently, as the formations cease to exist when the units stop walking. The last aura is the garrison aura which has an effect on the garrisoning structure (arrows the structure shoots, speed of a ship, ...).

The format of the aura template itself is like

{
    "affects":["Unit"],
    "affectedPlayers":["Player"],
    "modifications":[{"value":"Health/RegenRate","add":1}]
}

affects: The classes it affects, listed as ["Class1 Class2","Class3"], which means Class3 OR (Class1 And Class2). The aura will only have an effect on the listed classes. If the list is empty, the aura will have no effect.

affectedPlayers: This defines on which players it will act (a hero might cause the enemy to have less armour). The possible values are Player (yourself), Ally, MutualAlly or Enemy. This value defaults to Player.

modifications: This is a list of modifications that will be applied. Similarly structured as with technologies. A modification consists out of the value name that will be changed, and either add or multiply to resp. add or multiply the value of the affected entity with something. Note that the actions should be reversible (they are reversed when the aura carrying entity is killed), so multiplications with 0 are not allowed. All other values are supported.

Note: See TracWiki for help on using the wiki.