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. |
| 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. 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. |
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 || |