Changes between Version 4 and Version 5 of Triggers


Ignore:
Timestamp:
Jun 22, 2014, 1:34:06 PM (10 years ago)
Author:
sanderd17
Comment:

start table

Legend:

Unmodified
Added
Removed
Modified
  • Triggers

    v4 v5  
    4242=== Action functions ===
    4343
    44 Actions are regular JavaScript functions, registered under the `Trigger` prototype. Actions called by triggers always receive a data object with more information about the event that just happened. How the data looks depends on the actual event. See the table below (TODO ''guess we need to make a table'').
     44Actions are regular JavaScript functions, registered under the `Trigger` prototype. Actions called by triggers always receive a data object with more information about the event that just happened. How the data looks depends on the actual event. See the table below.
    4545
    4646{{{
     
    117117}}}
    118118
    119 The first parameter of the trigger is the event on which it will be executed. In the example, the trigger will be executed for every player command. See the table below for a list of all possible events (TODO ''we do need that table''). The second parameter is the name of the action, which has to be defined under the Trigger prototype. And the third part is a data object. For most triggers, this data will be just enabled = true or false. But for more complicated triggers (range triggers, time triggers, ...) this data can contain other elements, such as the the distance of the range trigger, or the interval of the timer. Again, see the data in the table below.
     119The first parameter of the trigger is the event on which it will be executed. In the example, the trigger will be executed for every player command. See the table below for a list of all possible events. The second parameter is the name of the action, which has to be defined under the Trigger prototype. And the third part is a data object. For most triggers, this data will be just enabled = true or false. But for more complicated triggers (range triggers, time triggers, ...) this data can contain other elements, such as the the distance of the range trigger, or the interval of the timer. Again, see the data in the table below.
    120120
    121121The combination of event and action name must be unique. This combination can be used to enable and disable triggers. Registering a trigger twice isn't possible, and tou will be warned when you do that.
     
    132132
    133133
    134 || == Event name == || == Accepted data format == || == Returned data format == ||
    135 || `OnStructureBuilt` || `{"enabled": bool}` || `{"building": constructedBuilding}` ||
     134== Reference Table ==
     135
     136||= Event name            =||= Accepted data format                  =||= Returned data format =||
     137|| `OnStructureBuilt`      || `{"enabled": bool}`                     || `{"building": constructedBuilding}` ||
     138|| `OnConstructionStarted` || `{"enabled": bool}`                     || TODO ||
     139|| `OnTrainingFinished`    || `{"enabled": bool}`                     || TODO ||
     140|| `OnTrainingQueued`      || `{"enabled": bool}`                     || TODO ||
     141|| `OnResearchFinished`    || `{"enabled": bool}`                     || TODO ||
     142|| `OnResearchQueued`      || `{"enabled": bool}`                     || TODO ||
     143|| `OnPlayerCommand`       || `{"enabled": bool}`                     || TODO ||
     144|| `OnInterval`            || `{"delay": number, "interval": number, "enabled": bool}` || TODO ||
     145|| `OnRange`               || `{"entities": [entityId], "players": [playerId], "minRange": number, "maxRange": number, "requiredComponent": componentId, "enabled": bool}` || TODO ||