Changes between Version 8 and Version 9 of Triggers


Ignore:
Timestamp:
Jun 23, 2014, 11:14:15 AM (10 years ago)
Author:
sanderd17
Comment:

Syntax highlighting in the reference table

Legend:

Unmodified
Added
Removed
Modified
  • Triggers

    v8 v9  
    131131You can enable and disable triggers as often as you want.
    132132
    133 
    134133== Reference Table ==
    135134
    136 ||= Event name            =||= Accepted data format                  =||= Returned data format =||= Notes =||
    137 || `OnStructureBuilt`      || `{"enabled": bool}`                     || `{"building": constructedBuilding}` || Happens when a foundation gets finished or a building gets completely repaired ||
    138 || `OnConstructionStarted` || `{"enabled": bool}`                     || `{"foundation": entityId, "template": this.templateName}` || Happens when the building of the foundation starts ||
    139 || `OnTrainingFinished`    || `{"enabled": bool}`                     || `{"entities": [entityId], "owner": playerId, "metadata": metadata}` || Happens when training of some units is finished ||
    140 || `OnTrainingQueued`      || `{"enabled": bool}`                     || `{"playerid": playerId, "unitTemplate": templateName, "count": number, "metadata": metadata, "trainerEntity": entityId}` || ||
    141 || `OnResearchFinished`    || `{"enabled": bool}`                     || `{"player": playerId, "tech": templateName}` || ||
    142 || `OnResearchQueued`      || `{"enabled": bool}`                     || `{"playerid": playerId, "technologyTemplate": templateName, "researcherEntity": entityId}` || ||
    143 || `OnPlayerCommand`       || `{"enabled": bool}`                     || `{"player": playerId, "cmd": unitCommand}` || Any command a player sends. The "cmd" part of a command always have a type, and per type can have different other atributes. Check the documentation in the source file ([source:ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js Commands.js]) for documentation ||
    144 || `OnInterval`            || `{"delay": number, "interval": number, "enabled": bool}` || TODO || ||
    145 || `OnRange`               || `{"entities": [entityId], "players": [playerId], "minRange": number, "maxRange": number, "requiredComponent": componentId, "enabled": bool}` || `{"added": [entityId], "removed": [entityId], "currenctCollection": [entityId]}` ||  ||
     135{{{#!th
     136Event name
     137}}}
     138{{{#!th
     139Accepted Data format
     140}}}
     141{{{#!th
     142Returned data format
     143}}}
     144{{{#!th
     145Notes
     146}}}
     147|----------------
     148{{{#!td
     149`OnStructureBuilt`
     150}}}
     151{{{#!td
     152  {{{#!js
     153    {"enabled": bool}
     154  }}}
     155}}}
     156{{{#!td
     157  {{{#!js
     158    {"building": constructedBuilding}
     159  }}}
     160}}}
     161{{{#!td
     162Happens when a foundation gets finished or a building gets completely repaired
     163}}}
     164|----------------
     165{{{#!td
     166`OnConstructionStarted`
     167}}}
     168{{{#!td
     169  {{{#!js
     170    {"enabled": bool}
     171  }}}
     172}}}
     173{{{#!td
     174  {{{#!js
     175    {
     176      "foundation": entityId,
     177      "template": this.templateName
     178    }
     179  }}}
     180}}}
     181{{{#!td
     182Happens when the building of the foundation starts
     183}}}
     184|----------------
     185{{{#!td
     186`OnTrainingFinished`
     187}}}
     188{{{#!td
     189  {{{#!js
     190    {"enabled": bool}
     191  }}}
     192}}}
     193{{{#!td
     194  {{{#!js
     195    {
     196      "entities": [entityId],
     197      "owner": playerId,
     198      "metadata": metadata
     199    }
     200  }}}
     201}}}
     202{{{#!td
     203Happens when training of some units is finished
     204}}}
     205|----------------
     206{{{#!td
     207`OnTrainingQueued`
     208}}}
     209{{{#!td
     210  {{{#!js
     211    {"enabled": bool}
     212  }}}
     213}}}
     214{{{#!td
     215  {{{#!js
     216    {
     217      "playerid": playerId,
     218      "unitTemplate": templateName,
     219      "count": number,
     220      "metadata": metadata,
     221      "trainerEntity": entityId
     222    }
     223  }}}
     224}}}
     225{{{#!td
     226
     227}}}
     228|----------------
     229{{{#!td
     230`OnResearchFinished`
     231}}}
     232{{{#!td
     233  {{{#!js
     234    {"enabled": bool}
     235  }}}
     236}}}
     237{{{#!td
     238  {{{#!js
     239    {
     240      "player": playerId,
     241      "tech": templateName
     242    }
     243  }}}
     244}}}
     245{{{#!td
     246
     247}}}
     248|----------------
     249{{{#!td
     250`OnResearchQueued`
     251}}}
     252{{{#!td
     253  {{{#!js
     254    {"enabled": bool}
     255  }}}
     256}}}
     257{{{#!td
     258  {{{#!js
     259    {
     260      "playerid": playerId,
     261      "technologyTemplate": templateName,
     262      "researcherEntity": entityId
     263    }
     264  }}}
     265}}}
     266{{{#!td
     267
     268}}}
     269|----------------
     270{{{#!td
     271`OnPlayerCommand`
     272}}}
     273{{{#!td
     274  {{{#!js
     275    {"enabled": bool}
     276  }}}
     277}}}
     278{{{#!td
     279  {{{#!js
     280    {
     281      "player": playerId,
     282      "cmd": unitCommand
     283    }
     284  }}}
     285}}}
     286{{{#!td
     287Any command a player sends. The "cmd" part of a command always have a type, and per type can have different other atributes. Check the documentation in the source file ([source:ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js Commands.js]) for documentation
     288}}}
     289|----------------
     290{{{#!td
     291`OnInterval`
     292}}}
     293{{{#!td
     294  {{{#!js
     295    {
     296      "delay": number,
     297      "interval": number,
     298      "enabled": bool
     299    }
     300  }}}
     301}}}
     302{{{#!td
     303TODO
     304}}}
     305{{{#!td
     306
     307}}}
     308|----------------
     309{{{#!td
     310`OnRange`
     311}}}
     312{{{#!td
     313  {{{#!js
     314    {
     315      "entities": [entityId],
     316      "players": [playerId],
     317      "minRange": number,
     318      "maxRange": number,
     319      "requiredComponent": componentId,
     320      "enabled": bool
     321    }
     322  }}}
     323}}}
     324{{{#!td
     325  {{{#!js
     326    {
     327      "added": [entityId],
     328      "removed": [entityId],
     329      "currenctCollection": [entityId]
     330    }
     331  }}}
     332}}}
     333{{{#!td
     334
     335}}}