Changes between Version 2 and Version 3 of Aura_Templates


Ignore:
Timestamp:
Jun 9, 2014, 8:00:35 PM (10 years ago)
Author:
sanderd17
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Aura_Templates

    v2 v3  
    1 Aura templates are the [wiki:JSON 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 [wiki:Technology_Templates Technology Templates], but a lot less complicated. The files are put in [source:/ps/trunk/binaries/data/mods/public/simulation/data/auras simulation/data/auras].
    2 
    31The auras can be used on an entity by including the following part in the entity XML:
    42
     
    64#!xml
    75  <Auras>
    8     <heal>
     6    <Aura1>
    97      <Type>range</Type>
    10       <Radius>40</Radius>
    11     </heal>
     8      <Radius>60</Radius>
     9      <Affects>Worker</Affects>
     10      <Modifications>
     11        <Builder.Rate> <Multiply>1.15</Multiply> </Builder.Rate>
     12      </Modifications>
     13      <AuraName>Builder Aura</AuraName>
     14      <AuraDescription>Buildings construct 15% faster within his vision.</AuraDescription>
     15    </Aura1>
     16    <Aura2>
     17      <Type>global</Type>
     18      <Affects>Temple</Affects>
     19      <Modifications>
     20        <Cost.Resources.stone> <Add>-50</Add> </Cost.Resources.stone>
     21      </Modifications>
     22      <AuraName>Acropolis Aura</AuraName>
     23      <AuraDescription>Temples are 50 stone cheaper during his lifetime.</AuraDescription>
     24    </Aura2>
    1225  </Auras>
    1326}}}
    1427
    15 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, ...).
     28The '''Type''' can currently be '''range, global, formation, garrison or garrisonedUnits'''. 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. The garrison aura has an effect on the garrisoning structure (arrows the structure shoots, speed of a ship, ...). And as last one, the garrisonedUnits aura influences the units that are visibly garrisoned (giving units on a wall extra armor f.e.).
    1629
    1730
    18 The format of the aura template itself is like
    19 {{{
    20 #!js
    21 {
    22     "affects":["Unit"],
    23     "affectedPlayers":["Player"],
    24     "modifications":[{"value":"Health/RegenRate","add":1}]
    25 }
    26 }}}
     31'''Affects''' determines 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.
    2732
    28 '''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.
     33'''AffectedPlayers''' 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.
    2934
    30 '''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.
     35'''Modifications''' are list of modifications that will be applied. Similarly structured as with technologies. A modification consists out of key, which presents the name of the value 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.
    3136
    32 '''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.
     37Note that the list of modifiable unit properties is the same as with the Technologies (see TechModifications), but as '/' is not valid as an XML key, the '/' signs are replaced with dots. So Health.Max instead of Health/Max.
     38
     39'''AuraName''' and '''AuraDescription''' are not mandatory, but will appear in various UI elements.
    3340
    3441