factorio-types 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/classes.d.ts +11892 -17915
- package/dist/concepts.d.ts +4441 -4093
- package/dist/datacollection.d.ts +596 -0
- package/dist/defines.d.ts +1599 -1211
- package/dist/events.d.ts +2202 -738
- package/dist/global.d.ts +13 -19
- package/dist/prototypes.d.ts +5458 -5898
- package/dist/types.d.ts +6337 -5907
- package/index.d.ts +1 -0
- package/package.json +7 -8
package/dist/events.d.ts
CHANGED
|
@@ -2,2566 +2,4030 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.110
|
|
6
6
|
// API version 5
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
9
|
-
/**
|
|
10
|
-
* Base type for all events
|
|
11
|
-
* Not a member of the factorio API, added to type definitions for ease of use
|
|
12
|
-
*/
|
|
13
|
-
interface event {
|
|
14
|
-
/**
|
|
15
|
-
* Identifier of the event
|
|
16
|
-
*/
|
|
17
|
-
name: defines.events
|
|
18
|
-
/**
|
|
19
|
-
* Tick the event was generated.
|
|
20
|
-
*/
|
|
21
|
-
tick: number
|
|
22
|
-
}
|
|
23
9
|
/**
|
|
24
10
|
* Called when a {@link CustomInputPrototype | prototype:CustomInputPrototype} is activated.
|
|
25
|
-
* @example
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
11
|
+
* @example ```
|
|
12
|
+
-- This will be raised when a custom input with the name "my-potato-control" and action "lua" is pressed
|
|
13
|
+
script.on_event("my-potato-control", function(event)
|
|
14
|
+
game.print("Keyboard shortcut pressed on tick: " ..tostring(event.tick))
|
|
15
|
+
end)
|
|
16
|
+
```
|
|
33
17
|
*/
|
|
34
|
-
interface CustomInputEvent
|
|
18
|
+
interface CustomInputEvent {
|
|
35
19
|
/**
|
|
36
20
|
* The mouse cursor display location when the custom input was activated.
|
|
37
21
|
*/
|
|
38
|
-
cursor_display_location: GuiLocation
|
|
22
|
+
cursor_display_location: GuiLocation;
|
|
39
23
|
/**
|
|
40
24
|
* The mouse cursor position when the custom input was activated.
|
|
41
25
|
*/
|
|
42
|
-
cursor_position: MapPosition
|
|
26
|
+
cursor_position: MapPosition;
|
|
43
27
|
/**
|
|
44
28
|
* The prototype name of the custom input that was activated.
|
|
45
29
|
*/
|
|
46
|
-
input_name: string
|
|
30
|
+
input_name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Identifier of the event
|
|
33
|
+
*/
|
|
34
|
+
name: defines.events;
|
|
47
35
|
/**
|
|
48
36
|
* The player that activated the custom input.
|
|
49
37
|
*/
|
|
50
|
-
player_index: uint
|
|
38
|
+
player_index: uint;
|
|
51
39
|
/**
|
|
52
40
|
* Information about the prototype that is selected when the custom input is used. Needs to be enabled on the custom input's prototype. `nil` if none is selected.
|
|
53
41
|
*/
|
|
54
|
-
selected_prototype?: SelectedPrototypeData
|
|
42
|
+
selected_prototype?: SelectedPrototypeData;
|
|
43
|
+
/**
|
|
44
|
+
* Tick the event was generated.
|
|
45
|
+
*/
|
|
46
|
+
tick: uint;
|
|
55
47
|
}
|
|
56
48
|
/**
|
|
57
49
|
* Called when a unit/group completes a command.
|
|
58
50
|
*/
|
|
59
|
-
interface on_ai_command_completed
|
|
60
|
-
|
|
51
|
+
interface on_ai_command_completed {
|
|
52
|
+
/**
|
|
53
|
+
* Identifier of the event
|
|
54
|
+
*/
|
|
55
|
+
name: defines.events;
|
|
56
|
+
result: defines.behavior_result;
|
|
57
|
+
/**
|
|
58
|
+
* Tick the event was generated.
|
|
59
|
+
*/
|
|
60
|
+
tick: uint;
|
|
61
61
|
/**
|
|
62
62
|
* unit_number/group_number of the unit/group which just completed a command.
|
|
63
63
|
*/
|
|
64
|
-
unit_number: uint
|
|
64
|
+
unit_number: uint;
|
|
65
65
|
/**
|
|
66
66
|
* Was this command generated by a distraction.
|
|
67
67
|
*/
|
|
68
|
-
was_distracted: boolean
|
|
68
|
+
was_distracted: boolean;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Called when an area of the map is cloned.
|
|
72
72
|
*/
|
|
73
|
-
interface on_area_cloned
|
|
74
|
-
clear_destination_decoratives: boolean
|
|
75
|
-
clear_destination_entities: boolean
|
|
76
|
-
clone_decoratives: boolean
|
|
77
|
-
clone_entities: boolean
|
|
78
|
-
clone_tiles: boolean
|
|
79
|
-
destination_area: BoundingBox
|
|
80
|
-
destination_force?: LuaForce
|
|
81
|
-
destination_surface: LuaSurface
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
interface on_area_cloned {
|
|
74
|
+
clear_destination_decoratives: boolean;
|
|
75
|
+
clear_destination_entities: boolean;
|
|
76
|
+
clone_decoratives: boolean;
|
|
77
|
+
clone_entities: boolean;
|
|
78
|
+
clone_tiles: boolean;
|
|
79
|
+
destination_area: BoundingBox;
|
|
80
|
+
destination_force?: LuaForce;
|
|
81
|
+
destination_surface: LuaSurface;
|
|
82
|
+
/**
|
|
83
|
+
* Identifier of the event
|
|
84
|
+
*/
|
|
85
|
+
name: defines.events;
|
|
86
|
+
source_area: BoundingBox;
|
|
87
|
+
source_surface: LuaSurface;
|
|
88
|
+
/**
|
|
89
|
+
* Tick the event was generated.
|
|
90
|
+
*/
|
|
91
|
+
tick: uint;
|
|
84
92
|
}
|
|
85
93
|
/**
|
|
86
94
|
* Called when a biter migration builds a base.
|
|
87
|
-
*
|
|
95
|
+
*
|
|
88
96
|
* This will be called multiple times for each migration, once for every biter that is sacrificed to build part of the new base.
|
|
89
97
|
*/
|
|
90
|
-
interface on_biter_base_built
|
|
98
|
+
interface on_biter_base_built {
|
|
91
99
|
/**
|
|
92
100
|
* The entity that was built.
|
|
93
101
|
*/
|
|
94
|
-
entity: LuaEntity
|
|
102
|
+
entity: LuaEntity;
|
|
103
|
+
/**
|
|
104
|
+
* Identifier of the event
|
|
105
|
+
*/
|
|
106
|
+
name: defines.events;
|
|
107
|
+
/**
|
|
108
|
+
* Tick the event was generated.
|
|
109
|
+
*/
|
|
110
|
+
tick: uint;
|
|
95
111
|
}
|
|
96
112
|
/**
|
|
97
113
|
* Called when a set of positions on the map is cloned.
|
|
98
114
|
*/
|
|
99
|
-
interface on_brush_cloned
|
|
100
|
-
clear_destination_decoratives: boolean
|
|
101
|
-
clear_destination_entities: boolean
|
|
102
|
-
clone_decoratives: boolean
|
|
103
|
-
clone_entities: boolean
|
|
104
|
-
clone_tiles: boolean
|
|
105
|
-
destination_force?: LuaForce
|
|
106
|
-
destination_offset: TilePosition
|
|
107
|
-
destination_surface: LuaSurface
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
interface on_brush_cloned {
|
|
116
|
+
clear_destination_decoratives: boolean;
|
|
117
|
+
clear_destination_entities: boolean;
|
|
118
|
+
clone_decoratives: boolean;
|
|
119
|
+
clone_entities: boolean;
|
|
120
|
+
clone_tiles: boolean;
|
|
121
|
+
destination_force?: LuaForce;
|
|
122
|
+
destination_offset: TilePosition;
|
|
123
|
+
destination_surface: LuaSurface;
|
|
124
|
+
/**
|
|
125
|
+
* Identifier of the event
|
|
126
|
+
*/
|
|
127
|
+
name: defines.events;
|
|
128
|
+
source_offset: TilePosition;
|
|
129
|
+
source_positions: TilePosition[];
|
|
130
|
+
source_surface: LuaSurface;
|
|
131
|
+
/**
|
|
132
|
+
* Tick the event was generated.
|
|
133
|
+
*/
|
|
134
|
+
tick: uint;
|
|
111
135
|
}
|
|
112
136
|
/**
|
|
113
137
|
* Called when a {@link defines.command.build_base | runtime:defines.command.build_base} command reaches its destination, and before building starts.
|
|
114
138
|
*/
|
|
115
|
-
interface on_build_base_arrived
|
|
139
|
+
interface on_build_base_arrived {
|
|
116
140
|
/**
|
|
117
141
|
* The unit group the command was assigned to.
|
|
118
142
|
*/
|
|
119
|
-
group?: LuaUnitGroup
|
|
143
|
+
group?: LuaUnitGroup;
|
|
144
|
+
/**
|
|
145
|
+
* Identifier of the event
|
|
146
|
+
*/
|
|
147
|
+
name: defines.events;
|
|
148
|
+
/**
|
|
149
|
+
* Tick the event was generated.
|
|
150
|
+
*/
|
|
151
|
+
tick: uint;
|
|
120
152
|
/**
|
|
121
153
|
* The unit the command was assigned to.
|
|
122
154
|
*/
|
|
123
|
-
unit?: LuaEntity
|
|
155
|
+
unit?: LuaEntity;
|
|
124
156
|
}
|
|
125
157
|
/**
|
|
126
158
|
* Called when player builds something.
|
|
127
159
|
*/
|
|
128
|
-
interface on_built_entity
|
|
129
|
-
created_entity: LuaEntity
|
|
160
|
+
interface on_built_entity {
|
|
161
|
+
created_entity: LuaEntity;
|
|
130
162
|
/**
|
|
131
163
|
* The item prototype used to build the entity. Note this won't exist in some situations (built from blueprint, undo, etc).
|
|
132
164
|
*/
|
|
133
|
-
item?: LuaItemPrototype
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
item?: LuaItemPrototype;
|
|
166
|
+
/**
|
|
167
|
+
* Identifier of the event
|
|
168
|
+
*/
|
|
169
|
+
name: defines.events;
|
|
170
|
+
player_index: uint;
|
|
171
|
+
stack: LuaItemStack;
|
|
136
172
|
/**
|
|
137
173
|
* The tags associated with this entity if any.
|
|
138
174
|
*/
|
|
139
|
-
tags?: Tags
|
|
175
|
+
tags?: Tags;
|
|
176
|
+
/**
|
|
177
|
+
* Tick the event was generated.
|
|
178
|
+
*/
|
|
179
|
+
tick: uint;
|
|
140
180
|
}
|
|
141
181
|
/**
|
|
142
182
|
* Called when the deconstruction of an entity is canceled.
|
|
143
183
|
*/
|
|
144
|
-
interface on_cancelled_deconstruction
|
|
145
|
-
entity: LuaEntity
|
|
146
|
-
|
|
184
|
+
interface on_cancelled_deconstruction {
|
|
185
|
+
entity: LuaEntity;
|
|
186
|
+
/**
|
|
187
|
+
* Identifier of the event
|
|
188
|
+
*/
|
|
189
|
+
name: defines.events;
|
|
190
|
+
player_index?: uint;
|
|
191
|
+
/**
|
|
192
|
+
* Tick the event was generated.
|
|
193
|
+
*/
|
|
194
|
+
tick: uint;
|
|
147
195
|
}
|
|
148
196
|
/**
|
|
149
197
|
* Called when the upgrade of an entity is canceled.
|
|
150
198
|
*/
|
|
151
|
-
interface on_cancelled_upgrade
|
|
152
|
-
direction?: defines.direction
|
|
153
|
-
entity: LuaEntity
|
|
154
|
-
|
|
155
|
-
|
|
199
|
+
interface on_cancelled_upgrade {
|
|
200
|
+
direction?: defines.direction;
|
|
201
|
+
entity: LuaEntity;
|
|
202
|
+
/**
|
|
203
|
+
* Identifier of the event
|
|
204
|
+
*/
|
|
205
|
+
name: defines.events;
|
|
206
|
+
player_index?: uint;
|
|
207
|
+
target: LuaEntityPrototype;
|
|
208
|
+
/**
|
|
209
|
+
* Tick the event was generated.
|
|
210
|
+
*/
|
|
211
|
+
tick: uint;
|
|
156
212
|
}
|
|
157
213
|
/**
|
|
158
214
|
* Called when a character corpse expires due to timeout or all of the items being removed from it.
|
|
159
|
-
*
|
|
215
|
+
*
|
|
160
216
|
* This is not called if the corpse is mined. See {@link defines.events.on_pre_player_mined_item | runtime:defines.events.on_pre_player_mined_item} to detect that.
|
|
161
217
|
*/
|
|
162
|
-
interface on_character_corpse_expired
|
|
218
|
+
interface on_character_corpse_expired {
|
|
163
219
|
/**
|
|
164
220
|
* The corpse.
|
|
165
221
|
*/
|
|
166
|
-
corpse: LuaEntity
|
|
222
|
+
corpse: LuaEntity;
|
|
223
|
+
/**
|
|
224
|
+
* Identifier of the event
|
|
225
|
+
*/
|
|
226
|
+
name: defines.events;
|
|
227
|
+
/**
|
|
228
|
+
* Tick the event was generated.
|
|
229
|
+
*/
|
|
230
|
+
tick: uint;
|
|
167
231
|
}
|
|
168
232
|
/**
|
|
169
233
|
* Called when a chart tag is created.
|
|
170
234
|
*/
|
|
171
|
-
interface on_chart_tag_added
|
|
172
|
-
force: LuaForce
|
|
173
|
-
|
|
174
|
-
|
|
235
|
+
interface on_chart_tag_added {
|
|
236
|
+
force: LuaForce;
|
|
237
|
+
/**
|
|
238
|
+
* Identifier of the event
|
|
239
|
+
*/
|
|
240
|
+
name: defines.events;
|
|
241
|
+
player_index?: uint;
|
|
242
|
+
tag: LuaCustomChartTag;
|
|
243
|
+
/**
|
|
244
|
+
* Tick the event was generated.
|
|
245
|
+
*/
|
|
246
|
+
tick: uint;
|
|
175
247
|
}
|
|
176
248
|
/**
|
|
177
249
|
* Called when a chart tag is modified by a player.
|
|
178
250
|
*/
|
|
179
|
-
interface on_chart_tag_modified
|
|
180
|
-
force: LuaForce
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
251
|
+
interface on_chart_tag_modified {
|
|
252
|
+
force: LuaForce;
|
|
253
|
+
/**
|
|
254
|
+
* Identifier of the event
|
|
255
|
+
*/
|
|
256
|
+
name: defines.events;
|
|
257
|
+
old_icon?: SignalID;
|
|
258
|
+
old_player?: uint;
|
|
259
|
+
old_text: string;
|
|
260
|
+
player_index?: uint;
|
|
261
|
+
tag: LuaCustomChartTag;
|
|
262
|
+
/**
|
|
263
|
+
* Tick the event was generated.
|
|
264
|
+
*/
|
|
265
|
+
tick: uint;
|
|
186
266
|
}
|
|
187
267
|
/**
|
|
188
268
|
* Called just before a chart tag is deleted.
|
|
189
269
|
*/
|
|
190
|
-
interface on_chart_tag_removed
|
|
191
|
-
force: LuaForce
|
|
192
|
-
|
|
193
|
-
|
|
270
|
+
interface on_chart_tag_removed {
|
|
271
|
+
force: LuaForce;
|
|
272
|
+
/**
|
|
273
|
+
* Identifier of the event
|
|
274
|
+
*/
|
|
275
|
+
name: defines.events;
|
|
276
|
+
player_index?: uint;
|
|
277
|
+
tag: LuaCustomChartTag;
|
|
278
|
+
/**
|
|
279
|
+
* Tick the event was generated.
|
|
280
|
+
*/
|
|
281
|
+
tick: uint;
|
|
194
282
|
}
|
|
195
283
|
/**
|
|
196
284
|
* Called when a chunk is charted or re-charted.
|
|
197
285
|
*/
|
|
198
|
-
interface on_chunk_charted
|
|
286
|
+
interface on_chunk_charted {
|
|
199
287
|
/**
|
|
200
288
|
* Area of the chunk.
|
|
201
289
|
*/
|
|
202
|
-
area: BoundingBox
|
|
203
|
-
force: LuaForce
|
|
204
|
-
|
|
205
|
-
|
|
290
|
+
area: BoundingBox;
|
|
291
|
+
force: LuaForce;
|
|
292
|
+
/**
|
|
293
|
+
* Identifier of the event
|
|
294
|
+
*/
|
|
295
|
+
name: defines.events;
|
|
296
|
+
position: ChunkPosition;
|
|
297
|
+
surface_index: uint;
|
|
298
|
+
/**
|
|
299
|
+
* Tick the event was generated.
|
|
300
|
+
*/
|
|
301
|
+
tick: uint;
|
|
206
302
|
}
|
|
207
303
|
/**
|
|
208
304
|
* Called when one or more chunks are deleted using {@link LuaSurface::delete_chunk | runtime:LuaSurface::delete_chunk}.
|
|
209
305
|
*/
|
|
210
|
-
interface on_chunk_deleted
|
|
306
|
+
interface on_chunk_deleted {
|
|
307
|
+
/**
|
|
308
|
+
* Identifier of the event
|
|
309
|
+
*/
|
|
310
|
+
name: defines.events;
|
|
211
311
|
/**
|
|
212
312
|
* The chunks deleted.
|
|
213
313
|
*/
|
|
214
|
-
positions: ChunkPosition[]
|
|
215
|
-
surface_index: uint
|
|
314
|
+
positions: ChunkPosition[];
|
|
315
|
+
surface_index: uint;
|
|
316
|
+
/**
|
|
317
|
+
* Tick the event was generated.
|
|
318
|
+
*/
|
|
319
|
+
tick: uint;
|
|
216
320
|
}
|
|
217
321
|
/**
|
|
218
322
|
* Called when a chunk is generated.
|
|
219
323
|
*/
|
|
220
|
-
interface on_chunk_generated
|
|
324
|
+
interface on_chunk_generated {
|
|
221
325
|
/**
|
|
222
326
|
* Area of the chunk.
|
|
223
327
|
*/
|
|
224
|
-
area: BoundingBox
|
|
328
|
+
area: BoundingBox;
|
|
329
|
+
/**
|
|
330
|
+
* Identifier of the event
|
|
331
|
+
*/
|
|
332
|
+
name: defines.events;
|
|
225
333
|
/**
|
|
226
334
|
* Position of the chunk.
|
|
227
335
|
*/
|
|
228
|
-
position: ChunkPosition
|
|
336
|
+
position: ChunkPosition;
|
|
229
337
|
/**
|
|
230
338
|
* The surface the chunk is on.
|
|
231
339
|
*/
|
|
232
|
-
surface: LuaSurface
|
|
340
|
+
surface: LuaSurface;
|
|
341
|
+
/**
|
|
342
|
+
* Tick the event was generated.
|
|
343
|
+
*/
|
|
344
|
+
tick: uint;
|
|
233
345
|
}
|
|
234
346
|
/**
|
|
235
347
|
* Called when a combat robot expires through a lack of energy, or timeout.
|
|
236
348
|
*/
|
|
237
|
-
interface on_combat_robot_expired
|
|
349
|
+
interface on_combat_robot_expired {
|
|
350
|
+
/**
|
|
351
|
+
* Identifier of the event
|
|
352
|
+
*/
|
|
353
|
+
name: defines.events;
|
|
238
354
|
/**
|
|
239
355
|
* The entity that owns the robot if any.
|
|
240
356
|
*/
|
|
241
|
-
owner?: LuaEntity
|
|
242
|
-
robot: LuaEntity
|
|
357
|
+
owner?: LuaEntity;
|
|
358
|
+
robot: LuaEntity;
|
|
359
|
+
/**
|
|
360
|
+
* Tick the event was generated.
|
|
361
|
+
*/
|
|
362
|
+
tick: uint;
|
|
243
363
|
}
|
|
244
364
|
/**
|
|
245
365
|
* Called when a message is sent to the in-game console, either by a player or through the server interface.
|
|
246
|
-
*
|
|
366
|
+
*
|
|
247
367
|
* This event only fires for plain messages, not for any commands (including `/shout` or `/whisper`).
|
|
248
368
|
*/
|
|
249
|
-
interface on_console_chat
|
|
369
|
+
interface on_console_chat {
|
|
250
370
|
/**
|
|
251
371
|
* The chat message that was sent.
|
|
252
372
|
*/
|
|
253
|
-
message: string
|
|
373
|
+
message: string;
|
|
374
|
+
/**
|
|
375
|
+
* Identifier of the event
|
|
376
|
+
*/
|
|
377
|
+
name: defines.events;
|
|
254
378
|
/**
|
|
255
379
|
* The player doing the chatting, if any.
|
|
256
380
|
*/
|
|
257
|
-
player_index?: uint
|
|
381
|
+
player_index?: uint;
|
|
382
|
+
/**
|
|
383
|
+
* Tick the event was generated.
|
|
384
|
+
*/
|
|
385
|
+
tick: uint;
|
|
258
386
|
}
|
|
259
387
|
/**
|
|
260
388
|
* Called when someone enters a command-like message regardless of it being a valid command.
|
|
261
389
|
*/
|
|
262
|
-
interface on_console_command
|
|
390
|
+
interface on_console_command {
|
|
263
391
|
/**
|
|
264
392
|
* The command as typed without the preceding forward slash ('/').
|
|
265
393
|
*/
|
|
266
|
-
command: string
|
|
394
|
+
command: string;
|
|
395
|
+
/**
|
|
396
|
+
* Identifier of the event
|
|
397
|
+
*/
|
|
398
|
+
name: defines.events;
|
|
267
399
|
/**
|
|
268
400
|
* The parameters provided if any.
|
|
269
401
|
*/
|
|
270
|
-
parameters: string
|
|
402
|
+
parameters: string;
|
|
271
403
|
/**
|
|
272
404
|
* The player if any.
|
|
273
405
|
*/
|
|
274
|
-
player_index?: uint
|
|
406
|
+
player_index?: uint;
|
|
407
|
+
/**
|
|
408
|
+
* Tick the event was generated.
|
|
409
|
+
*/
|
|
410
|
+
tick: uint;
|
|
275
411
|
}
|
|
276
412
|
/**
|
|
277
413
|
* Called when a cutscene is cancelled by the player or by script.
|
|
278
414
|
*/
|
|
279
|
-
interface on_cutscene_cancelled
|
|
415
|
+
interface on_cutscene_cancelled {
|
|
416
|
+
/**
|
|
417
|
+
* Identifier of the event
|
|
418
|
+
*/
|
|
419
|
+
name: defines.events;
|
|
280
420
|
/**
|
|
281
421
|
* The player the cutscene was shown to.
|
|
282
422
|
*/
|
|
283
|
-
player_index: uint
|
|
423
|
+
player_index: uint;
|
|
424
|
+
/**
|
|
425
|
+
* Tick the event was generated.
|
|
426
|
+
*/
|
|
427
|
+
tick: uint;
|
|
284
428
|
}
|
|
285
429
|
/**
|
|
286
430
|
* Called when a cutscene finishes naturally (was not cancelled).
|
|
287
431
|
*/
|
|
288
|
-
interface on_cutscene_finished
|
|
432
|
+
interface on_cutscene_finished {
|
|
433
|
+
/**
|
|
434
|
+
* Identifier of the event
|
|
435
|
+
*/
|
|
436
|
+
name: defines.events;
|
|
289
437
|
/**
|
|
290
438
|
* The player the cutscene was shown to.
|
|
291
439
|
*/
|
|
292
|
-
player_index: uint
|
|
440
|
+
player_index: uint;
|
|
441
|
+
/**
|
|
442
|
+
* Tick the event was generated.
|
|
443
|
+
*/
|
|
444
|
+
tick: uint;
|
|
293
445
|
}
|
|
294
446
|
/**
|
|
295
447
|
* Called when a cutscene starts.
|
|
296
448
|
*/
|
|
297
|
-
interface on_cutscene_started
|
|
449
|
+
interface on_cutscene_started {
|
|
450
|
+
/**
|
|
451
|
+
* Identifier of the event
|
|
452
|
+
*/
|
|
453
|
+
name: defines.events;
|
|
298
454
|
/**
|
|
299
455
|
* The player the cutscene is being shown to.
|
|
300
456
|
*/
|
|
301
|
-
player_index: uint
|
|
457
|
+
player_index: uint;
|
|
458
|
+
/**
|
|
459
|
+
* Tick the event was generated.
|
|
460
|
+
*/
|
|
461
|
+
tick: uint;
|
|
302
462
|
}
|
|
303
463
|
/**
|
|
304
464
|
* Called when a cutscene is playing, each time it reaches a waypoint in that cutscene.
|
|
305
|
-
*
|
|
465
|
+
*
|
|
306
466
|
* This refers to an index in the table previously passed to set_controller which started the cutscene.
|
|
307
|
-
*
|
|
467
|
+
*
|
|
308
468
|
* Due to implementation omission, `waypoint_index` is 0-based.
|
|
309
469
|
*/
|
|
310
|
-
interface on_cutscene_waypoint_reached
|
|
470
|
+
interface on_cutscene_waypoint_reached {
|
|
471
|
+
/**
|
|
472
|
+
* Identifier of the event
|
|
473
|
+
*/
|
|
474
|
+
name: defines.events;
|
|
311
475
|
/**
|
|
312
476
|
* The player index of the player viewing the cutscene.
|
|
313
477
|
*/
|
|
314
|
-
player_index: uint
|
|
478
|
+
player_index: uint;
|
|
479
|
+
/**
|
|
480
|
+
* Tick the event was generated.
|
|
481
|
+
*/
|
|
482
|
+
tick: uint;
|
|
315
483
|
/**
|
|
316
484
|
* The index of the waypoint we just completed.
|
|
317
485
|
*/
|
|
318
|
-
waypoint_index: uint
|
|
486
|
+
waypoint_index: uint;
|
|
319
487
|
}
|
|
320
488
|
/**
|
|
321
489
|
* Called when the map difficulty settings are changed.
|
|
322
|
-
*
|
|
490
|
+
*
|
|
323
491
|
* It's not guaranteed that both settings are changed - just that at least one has been changed.
|
|
324
492
|
*/
|
|
325
|
-
interface on_difficulty_settings_changed
|
|
326
|
-
|
|
327
|
-
|
|
493
|
+
interface on_difficulty_settings_changed {
|
|
494
|
+
/**
|
|
495
|
+
* Identifier of the event
|
|
496
|
+
*/
|
|
497
|
+
name: defines.events;
|
|
498
|
+
old_recipe_difficulty: uint;
|
|
499
|
+
old_technology_difficulty: uint;
|
|
500
|
+
/**
|
|
501
|
+
* Tick the event was generated.
|
|
502
|
+
*/
|
|
503
|
+
tick: uint;
|
|
328
504
|
}
|
|
329
505
|
/**
|
|
330
506
|
* Called when an entity is cloned. The filter applies to the source entity.
|
|
331
507
|
*/
|
|
332
|
-
interface on_entity_cloned
|
|
333
|
-
destination: LuaEntity
|
|
334
|
-
|
|
508
|
+
interface on_entity_cloned {
|
|
509
|
+
destination: LuaEntity;
|
|
510
|
+
/**
|
|
511
|
+
* Identifier of the event
|
|
512
|
+
*/
|
|
513
|
+
name: defines.events;
|
|
514
|
+
source: LuaEntity;
|
|
515
|
+
/**
|
|
516
|
+
* Tick the event was generated.
|
|
517
|
+
*/
|
|
518
|
+
tick: uint;
|
|
335
519
|
}
|
|
336
520
|
/**
|
|
337
521
|
* Called after an entity has been recolored either by the player or through script.
|
|
338
|
-
*
|
|
522
|
+
*
|
|
339
523
|
* Automatic recoloring due to {@link LuaPlayer::color | runtime:LuaPlayer::color} will not raise events, as that is a separate mechanism.
|
|
340
524
|
*/
|
|
341
|
-
interface on_entity_color_changed
|
|
525
|
+
interface on_entity_color_changed {
|
|
342
526
|
/**
|
|
343
527
|
* The entity that was recolored.
|
|
344
528
|
*/
|
|
345
|
-
entity: LuaEntity
|
|
529
|
+
entity: LuaEntity;
|
|
530
|
+
/**
|
|
531
|
+
* Identifier of the event
|
|
532
|
+
*/
|
|
533
|
+
name: defines.events;
|
|
534
|
+
/**
|
|
535
|
+
* Tick the event was generated.
|
|
536
|
+
*/
|
|
537
|
+
tick: uint;
|
|
346
538
|
}
|
|
347
539
|
/**
|
|
348
540
|
* Called when an entity is damaged. This is not called when an entities health is set directly by another mod.
|
|
349
541
|
*/
|
|
350
|
-
interface on_entity_damaged
|
|
542
|
+
interface on_entity_damaged {
|
|
351
543
|
/**
|
|
352
544
|
* The entity that did the attacking if available.
|
|
353
545
|
*/
|
|
354
|
-
cause?: LuaEntity
|
|
355
|
-
damage_type: LuaDamagePrototype
|
|
356
|
-
entity: LuaEntity
|
|
546
|
+
cause?: LuaEntity;
|
|
547
|
+
damage_type: LuaDamagePrototype;
|
|
548
|
+
entity: LuaEntity;
|
|
357
549
|
/**
|
|
358
550
|
* The damage amount after resistances.
|
|
359
551
|
*/
|
|
360
|
-
final_damage_amount: float
|
|
552
|
+
final_damage_amount: float;
|
|
361
553
|
/**
|
|
362
554
|
* The health of the entity after the damage was applied.
|
|
363
555
|
*/
|
|
364
|
-
final_health: float
|
|
556
|
+
final_health: float;
|
|
365
557
|
/**
|
|
366
558
|
* The force that did the attacking if any.
|
|
367
559
|
*/
|
|
368
|
-
force?: LuaForce
|
|
560
|
+
force?: LuaForce;
|
|
561
|
+
/**
|
|
562
|
+
* Identifier of the event
|
|
563
|
+
*/
|
|
564
|
+
name: defines.events;
|
|
369
565
|
/**
|
|
370
566
|
* The damage amount before resistances.
|
|
371
567
|
*/
|
|
372
|
-
original_damage_amount: float
|
|
568
|
+
original_damage_amount: float;
|
|
569
|
+
/**
|
|
570
|
+
* Tick the event was generated.
|
|
571
|
+
*/
|
|
572
|
+
tick: uint;
|
|
373
573
|
}
|
|
374
574
|
/**
|
|
375
575
|
* Called after an entity is destroyed that has been registered with {@link LuaBootstrap::register_on_entity_destroyed | runtime:LuaBootstrap::register_on_entity_destroyed}.
|
|
376
|
-
*
|
|
576
|
+
*
|
|
377
577
|
* Depending on when a given entity is destroyed, this event will be fired at the end of the current tick or at the end of the next tick.
|
|
378
578
|
*/
|
|
379
|
-
interface on_entity_destroyed
|
|
579
|
+
interface on_entity_destroyed {
|
|
580
|
+
/**
|
|
581
|
+
* Identifier of the event
|
|
582
|
+
*/
|
|
583
|
+
name: defines.events;
|
|
380
584
|
/**
|
|
381
585
|
* The number returned by {@link register_on_entity_destroyed | runtime:LuaBootstrap::register_on_entity_destroyed} to uniquely identify this entity during this event.
|
|
382
586
|
*/
|
|
383
|
-
registration_number: uint64
|
|
587
|
+
registration_number: uint64;
|
|
588
|
+
/**
|
|
589
|
+
* Tick the event was generated.
|
|
590
|
+
*/
|
|
591
|
+
tick: uint;
|
|
384
592
|
/**
|
|
385
593
|
* The {@link LuaEntity::unit_number | runtime:LuaEntity::unit_number} of the destroyed entity, if it had one.
|
|
386
594
|
*/
|
|
387
|
-
unit_number?: uint
|
|
595
|
+
unit_number?: uint;
|
|
388
596
|
}
|
|
389
597
|
/**
|
|
390
598
|
* Called when an entity dies.
|
|
391
599
|
*/
|
|
392
|
-
interface on_entity_died
|
|
600
|
+
interface on_entity_died {
|
|
393
601
|
/**
|
|
394
602
|
* The entity that did the killing if available.
|
|
395
603
|
*/
|
|
396
|
-
cause?: LuaEntity
|
|
604
|
+
cause?: LuaEntity;
|
|
397
605
|
/**
|
|
398
606
|
* The damage type if any.
|
|
399
607
|
*/
|
|
400
|
-
damage_type?: LuaDamagePrototype
|
|
608
|
+
damage_type?: LuaDamagePrototype;
|
|
401
609
|
/**
|
|
402
610
|
* The entity that died.
|
|
403
611
|
*/
|
|
404
|
-
entity: LuaEntity
|
|
612
|
+
entity: LuaEntity;
|
|
405
613
|
/**
|
|
406
614
|
* The force that did the killing if any.
|
|
407
615
|
*/
|
|
408
|
-
force?: LuaForce
|
|
616
|
+
force?: LuaForce;
|
|
409
617
|
/**
|
|
410
618
|
* The loot generated by this entity if any.
|
|
411
619
|
*/
|
|
412
|
-
loot: LuaInventory
|
|
620
|
+
loot: LuaInventory;
|
|
621
|
+
/**
|
|
622
|
+
* Identifier of the event
|
|
623
|
+
*/
|
|
624
|
+
name: defines.events;
|
|
625
|
+
/**
|
|
626
|
+
* Tick the event was generated.
|
|
627
|
+
*/
|
|
628
|
+
tick: uint;
|
|
413
629
|
}
|
|
414
630
|
/**
|
|
415
631
|
* Called when one of an entity's personal logistic slots changes.
|
|
416
|
-
*
|
|
632
|
+
*
|
|
417
633
|
* "Personal logistic slot" refers to a character or vehicle's personal request / auto-trash slots, not the request slots on logistic chests.
|
|
418
634
|
*/
|
|
419
|
-
interface on_entity_logistic_slot_changed
|
|
635
|
+
interface on_entity_logistic_slot_changed {
|
|
420
636
|
/**
|
|
421
637
|
* The entity for whom a logistic slot was changed.
|
|
422
638
|
*/
|
|
423
|
-
entity: LuaEntity
|
|
639
|
+
entity: LuaEntity;
|
|
640
|
+
/**
|
|
641
|
+
* Identifier of the event
|
|
642
|
+
*/
|
|
643
|
+
name: defines.events;
|
|
424
644
|
/**
|
|
425
645
|
* The player who changed the slot, or `nil` if changed by script.
|
|
426
646
|
*/
|
|
427
|
-
player_index?: uint
|
|
647
|
+
player_index?: uint;
|
|
428
648
|
/**
|
|
429
649
|
* The slot index that was changed.
|
|
430
650
|
*/
|
|
431
|
-
slot_index: uint
|
|
651
|
+
slot_index: uint;
|
|
652
|
+
/**
|
|
653
|
+
* Tick the event was generated.
|
|
654
|
+
*/
|
|
655
|
+
tick: uint;
|
|
432
656
|
}
|
|
433
657
|
/**
|
|
434
658
|
* Called after an entity has been renamed either by the player or through script.
|
|
435
659
|
*/
|
|
436
|
-
interface on_entity_renamed
|
|
437
|
-
by_script: boolean
|
|
438
|
-
entity: LuaEntity
|
|
439
|
-
|
|
660
|
+
interface on_entity_renamed {
|
|
661
|
+
by_script: boolean;
|
|
662
|
+
entity: LuaEntity;
|
|
663
|
+
/**
|
|
664
|
+
* Identifier of the event
|
|
665
|
+
*/
|
|
666
|
+
name: defines.events;
|
|
667
|
+
old_name: string;
|
|
440
668
|
/**
|
|
441
669
|
* If by_script is true this will not be included.
|
|
442
670
|
*/
|
|
443
|
-
player_index?: uint
|
|
671
|
+
player_index?: uint;
|
|
672
|
+
/**
|
|
673
|
+
* Tick the event was generated.
|
|
674
|
+
*/
|
|
675
|
+
tick: uint;
|
|
444
676
|
}
|
|
445
677
|
/**
|
|
446
678
|
* Called after entity copy-paste is done.
|
|
447
679
|
*/
|
|
448
|
-
interface on_entity_settings_pasted
|
|
680
|
+
interface on_entity_settings_pasted {
|
|
449
681
|
/**
|
|
450
682
|
* The destination entity settings were copied to.
|
|
451
683
|
*/
|
|
452
|
-
destination: LuaEntity
|
|
453
|
-
|
|
684
|
+
destination: LuaEntity;
|
|
685
|
+
/**
|
|
686
|
+
* Identifier of the event
|
|
687
|
+
*/
|
|
688
|
+
name: defines.events;
|
|
689
|
+
player_index: uint;
|
|
454
690
|
/**
|
|
455
691
|
* The source entity settings were copied from.
|
|
456
692
|
*/
|
|
457
|
-
source: LuaEntity
|
|
693
|
+
source: LuaEntity;
|
|
694
|
+
/**
|
|
695
|
+
* Tick the event was generated.
|
|
696
|
+
*/
|
|
697
|
+
tick: uint;
|
|
458
698
|
}
|
|
459
699
|
/**
|
|
460
700
|
* Called when an entity is spawned by a EnemySpawner
|
|
461
701
|
*/
|
|
462
|
-
interface on_entity_spawned
|
|
463
|
-
entity: LuaEntity
|
|
464
|
-
|
|
702
|
+
interface on_entity_spawned {
|
|
703
|
+
entity: LuaEntity;
|
|
704
|
+
/**
|
|
705
|
+
* Identifier of the event
|
|
706
|
+
*/
|
|
707
|
+
name: defines.events;
|
|
708
|
+
spawner: LuaEntity;
|
|
709
|
+
/**
|
|
710
|
+
* Tick the event was generated.
|
|
711
|
+
*/
|
|
712
|
+
tick: uint;
|
|
465
713
|
}
|
|
466
714
|
/**
|
|
467
715
|
* Called after equipment is inserted into an equipment grid.
|
|
468
716
|
*/
|
|
469
|
-
interface on_equipment_inserted
|
|
717
|
+
interface on_equipment_inserted {
|
|
470
718
|
/**
|
|
471
719
|
* The equipment inserted.
|
|
472
720
|
*/
|
|
473
|
-
equipment: LuaEquipment
|
|
721
|
+
equipment: LuaEquipment;
|
|
474
722
|
/**
|
|
475
723
|
* The equipment grid inserted into.
|
|
476
724
|
*/
|
|
477
|
-
grid: LuaEquipmentGrid
|
|
725
|
+
grid: LuaEquipmentGrid;
|
|
726
|
+
/**
|
|
727
|
+
* Identifier of the event
|
|
728
|
+
*/
|
|
729
|
+
name: defines.events;
|
|
730
|
+
/**
|
|
731
|
+
* Tick the event was generated.
|
|
732
|
+
*/
|
|
733
|
+
tick: uint;
|
|
478
734
|
}
|
|
479
735
|
/**
|
|
480
736
|
* Called after equipment is removed from an equipment grid.
|
|
481
737
|
*/
|
|
482
|
-
interface on_equipment_removed
|
|
738
|
+
interface on_equipment_removed {
|
|
483
739
|
/**
|
|
484
740
|
* The count of equipment removed.
|
|
485
741
|
*/
|
|
486
|
-
count: uint
|
|
742
|
+
count: uint;
|
|
487
743
|
/**
|
|
488
744
|
* The equipment removed.
|
|
489
745
|
*/
|
|
490
|
-
equipment: string
|
|
746
|
+
equipment: string;
|
|
491
747
|
/**
|
|
492
748
|
* The equipment grid removed from.
|
|
493
749
|
*/
|
|
494
|
-
grid: LuaEquipmentGrid
|
|
750
|
+
grid: LuaEquipmentGrid;
|
|
751
|
+
/**
|
|
752
|
+
* Identifier of the event
|
|
753
|
+
*/
|
|
754
|
+
name: defines.events;
|
|
755
|
+
/**
|
|
756
|
+
* Tick the event was generated.
|
|
757
|
+
*/
|
|
758
|
+
tick: uint;
|
|
495
759
|
}
|
|
496
760
|
/**
|
|
497
761
|
* Called when the a forces cease fire values change.
|
|
498
762
|
*/
|
|
499
|
-
interface on_force_cease_fire_changed
|
|
763
|
+
interface on_force_cease_fire_changed {
|
|
500
764
|
/**
|
|
501
765
|
* If the other force was added or removed.
|
|
502
766
|
*/
|
|
503
|
-
added: boolean
|
|
767
|
+
added: boolean;
|
|
504
768
|
/**
|
|
505
769
|
* The force who's cease fire changed.
|
|
506
770
|
*/
|
|
507
|
-
force: LuaForce
|
|
771
|
+
force: LuaForce;
|
|
772
|
+
/**
|
|
773
|
+
* Identifier of the event
|
|
774
|
+
*/
|
|
775
|
+
name: defines.events;
|
|
508
776
|
/**
|
|
509
777
|
* Which force was added or removed.
|
|
510
778
|
*/
|
|
511
|
-
other_force: LuaForce
|
|
779
|
+
other_force: LuaForce;
|
|
780
|
+
/**
|
|
781
|
+
* Tick the event was generated.
|
|
782
|
+
*/
|
|
783
|
+
tick: uint;
|
|
512
784
|
}
|
|
513
785
|
/**
|
|
514
786
|
* Called when a new force is created using `game.create_force()`
|
|
515
|
-
*
|
|
787
|
+
*
|
|
516
788
|
* This is not called when the default forces (`'player'`, `'enemy'`, `'neutral'`) are created as they will always exist.
|
|
517
789
|
*/
|
|
518
|
-
interface on_force_created
|
|
790
|
+
interface on_force_created {
|
|
519
791
|
/**
|
|
520
792
|
* The newly created force.
|
|
521
793
|
*/
|
|
522
|
-
force: LuaForce
|
|
794
|
+
force: LuaForce;
|
|
795
|
+
/**
|
|
796
|
+
* Identifier of the event
|
|
797
|
+
*/
|
|
798
|
+
name: defines.events;
|
|
799
|
+
/**
|
|
800
|
+
* Tick the event was generated.
|
|
801
|
+
*/
|
|
802
|
+
tick: uint;
|
|
523
803
|
}
|
|
524
804
|
/**
|
|
525
805
|
* Called when the a forces friends change.
|
|
526
806
|
*/
|
|
527
|
-
interface on_force_friends_changed
|
|
807
|
+
interface on_force_friends_changed {
|
|
528
808
|
/**
|
|
529
809
|
* If the other force was added or removed.
|
|
530
810
|
*/
|
|
531
|
-
added: boolean
|
|
811
|
+
added: boolean;
|
|
532
812
|
/**
|
|
533
813
|
* The force who's friends changed.
|
|
534
814
|
*/
|
|
535
|
-
force: LuaForce
|
|
815
|
+
force: LuaForce;
|
|
816
|
+
/**
|
|
817
|
+
* Identifier of the event
|
|
818
|
+
*/
|
|
819
|
+
name: defines.events;
|
|
536
820
|
/**
|
|
537
821
|
* Which force was added or removed.
|
|
538
822
|
*/
|
|
539
|
-
other_force: LuaForce
|
|
823
|
+
other_force: LuaForce;
|
|
824
|
+
/**
|
|
825
|
+
* Tick the event was generated.
|
|
826
|
+
*/
|
|
827
|
+
tick: uint;
|
|
540
828
|
}
|
|
541
829
|
/**
|
|
542
830
|
* Called when {@link LuaForce::reset | runtime:LuaForce::reset} is finished.
|
|
543
831
|
*/
|
|
544
|
-
interface on_force_reset
|
|
545
|
-
force: LuaForce
|
|
832
|
+
interface on_force_reset {
|
|
833
|
+
force: LuaForce;
|
|
834
|
+
/**
|
|
835
|
+
* Identifier of the event
|
|
836
|
+
*/
|
|
837
|
+
name: defines.events;
|
|
838
|
+
/**
|
|
839
|
+
* Tick the event was generated.
|
|
840
|
+
*/
|
|
841
|
+
tick: uint;
|
|
546
842
|
}
|
|
547
843
|
/**
|
|
548
844
|
* Called after two forces have been merged using `game.merge_forces()`.
|
|
549
|
-
*
|
|
845
|
+
*
|
|
550
846
|
* The source force is invalidated before this event is called and the name can be re-used in this event if desired.
|
|
551
847
|
*/
|
|
552
|
-
interface on_forces_merged
|
|
848
|
+
interface on_forces_merged {
|
|
553
849
|
/**
|
|
554
850
|
* The force entities where reassigned to.
|
|
555
851
|
*/
|
|
556
|
-
destination: LuaForce
|
|
852
|
+
destination: LuaForce;
|
|
853
|
+
/**
|
|
854
|
+
* Identifier of the event
|
|
855
|
+
*/
|
|
856
|
+
name: defines.events;
|
|
557
857
|
/**
|
|
558
858
|
* The index of the destroyed force.
|
|
559
859
|
*/
|
|
560
|
-
source_index: uint
|
|
860
|
+
source_index: uint;
|
|
561
861
|
/**
|
|
562
862
|
* The force destroyed.
|
|
563
863
|
*/
|
|
564
|
-
source_name: string
|
|
864
|
+
source_name: string;
|
|
865
|
+
/**
|
|
866
|
+
* Tick the event was generated.
|
|
867
|
+
*/
|
|
868
|
+
tick: uint;
|
|
565
869
|
}
|
|
566
870
|
/**
|
|
567
871
|
* Called when two forces are about to be merged using `game.merge_forces()`.
|
|
568
872
|
*/
|
|
569
|
-
interface on_forces_merging
|
|
873
|
+
interface on_forces_merging {
|
|
570
874
|
/**
|
|
571
875
|
* The force to reassign entities to.
|
|
572
876
|
*/
|
|
573
|
-
destination: LuaForce
|
|
877
|
+
destination: LuaForce;
|
|
878
|
+
/**
|
|
879
|
+
* Identifier of the event
|
|
880
|
+
*/
|
|
881
|
+
name: defines.events;
|
|
574
882
|
/**
|
|
575
883
|
* The force to be destroyed
|
|
576
884
|
*/
|
|
577
|
-
source: LuaForce
|
|
885
|
+
source: LuaForce;
|
|
886
|
+
/**
|
|
887
|
+
* Tick the event was generated.
|
|
888
|
+
*/
|
|
889
|
+
tick: uint;
|
|
578
890
|
}
|
|
579
891
|
/**
|
|
580
892
|
* Called when a game is created from a scenario. This is fired for every mod, even when the scenario's save data already includes it. In those cases however, {@link LuaBootstrap::on_init | runtime:LuaBootstrap::on_init} is not fired.
|
|
581
|
-
*
|
|
893
|
+
*
|
|
582
894
|
* This event is not fired when the scenario is loaded via the map editor.
|
|
583
895
|
*/
|
|
584
|
-
interface on_game_created_from_scenario
|
|
896
|
+
interface on_game_created_from_scenario {
|
|
897
|
+
/**
|
|
898
|
+
* Identifier of the event
|
|
899
|
+
*/
|
|
900
|
+
name: defines.events;
|
|
901
|
+
/**
|
|
902
|
+
* Tick the event was generated.
|
|
903
|
+
*/
|
|
904
|
+
tick: uint;
|
|
585
905
|
}
|
|
586
906
|
/**
|
|
587
907
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} checked state is changed (related to checkboxes and radio buttons).
|
|
588
908
|
*/
|
|
589
|
-
interface on_gui_checked_state_changed
|
|
909
|
+
interface on_gui_checked_state_changed {
|
|
590
910
|
/**
|
|
591
911
|
* The element whose checked state changed.
|
|
592
912
|
*/
|
|
593
|
-
element: LuaGuiElement
|
|
913
|
+
element: LuaGuiElement;
|
|
914
|
+
/**
|
|
915
|
+
* Identifier of the event
|
|
916
|
+
*/
|
|
917
|
+
name: defines.events;
|
|
594
918
|
/**
|
|
595
919
|
* The player who did the change.
|
|
596
920
|
*/
|
|
597
|
-
player_index: uint
|
|
921
|
+
player_index: uint;
|
|
922
|
+
/**
|
|
923
|
+
* Tick the event was generated.
|
|
924
|
+
*/
|
|
925
|
+
tick: uint;
|
|
598
926
|
}
|
|
599
927
|
/**
|
|
600
928
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} is clicked.
|
|
601
929
|
*/
|
|
602
|
-
interface on_gui_click
|
|
930
|
+
interface on_gui_click {
|
|
603
931
|
/**
|
|
604
932
|
* If alt was pressed.
|
|
605
933
|
*/
|
|
606
|
-
alt: boolean
|
|
934
|
+
alt: boolean;
|
|
607
935
|
/**
|
|
608
936
|
* The mouse button used if any.
|
|
609
937
|
*/
|
|
610
|
-
button: defines.mouse_button_type
|
|
938
|
+
button: defines.mouse_button_type;
|
|
611
939
|
/**
|
|
612
940
|
* If control was pressed.
|
|
613
941
|
*/
|
|
614
|
-
control: boolean
|
|
942
|
+
control: boolean;
|
|
615
943
|
/**
|
|
616
944
|
* The display location of the player's cursor.
|
|
617
945
|
*/
|
|
618
|
-
cursor_display_location: GuiLocation
|
|
946
|
+
cursor_display_location: GuiLocation;
|
|
619
947
|
/**
|
|
620
948
|
* The clicked element.
|
|
621
949
|
*/
|
|
622
|
-
element: LuaGuiElement
|
|
950
|
+
element: LuaGuiElement;
|
|
951
|
+
/**
|
|
952
|
+
* Identifier of the event
|
|
953
|
+
*/
|
|
954
|
+
name: defines.events;
|
|
623
955
|
/**
|
|
624
956
|
* The player who did the clicking.
|
|
625
957
|
*/
|
|
626
|
-
player_index: uint
|
|
958
|
+
player_index: uint;
|
|
627
959
|
/**
|
|
628
960
|
* If shift was pressed.
|
|
629
961
|
*/
|
|
630
|
-
shift: boolean
|
|
962
|
+
shift: boolean;
|
|
963
|
+
/**
|
|
964
|
+
* Tick the event was generated.
|
|
965
|
+
*/
|
|
966
|
+
tick: uint;
|
|
631
967
|
}
|
|
632
968
|
/**
|
|
633
969
|
* Called when the player closes the GUI they have open.
|
|
634
|
-
*
|
|
970
|
+
*
|
|
635
971
|
* This can only be raised when the GUI's player controller is still valid. If a GUI is thus closed due to the player disconnecting, dying, or becoming a spectator in other ways, it won't cause this event to be raised.
|
|
636
|
-
*
|
|
972
|
+
*
|
|
637
973
|
* It's not advised to open any other GUI during this event because if this is run as a request to open a different GUI the game will force close the new opened GUI without notice to ensure the original requested GUI is opened.
|
|
638
974
|
*/
|
|
639
|
-
interface on_gui_closed
|
|
975
|
+
interface on_gui_closed {
|
|
640
976
|
/**
|
|
641
977
|
* The custom GUI element that was open
|
|
642
978
|
*/
|
|
643
|
-
element?: LuaGuiElement
|
|
979
|
+
element?: LuaGuiElement;
|
|
644
980
|
/**
|
|
645
981
|
* The entity that was open
|
|
646
982
|
*/
|
|
647
|
-
entity?: LuaEntity
|
|
983
|
+
entity?: LuaEntity;
|
|
648
984
|
/**
|
|
649
985
|
* The equipment that was open
|
|
650
986
|
*/
|
|
651
|
-
equipment?: LuaEquipment
|
|
987
|
+
equipment?: LuaEquipment;
|
|
652
988
|
/**
|
|
653
989
|
* The GUI type that was open.
|
|
654
990
|
*/
|
|
655
|
-
gui_type: defines.gui_type
|
|
991
|
+
gui_type: defines.gui_type;
|
|
656
992
|
/**
|
|
657
993
|
* The script inventory that was open
|
|
658
994
|
*/
|
|
659
|
-
inventory?: LuaInventory
|
|
995
|
+
inventory?: LuaInventory;
|
|
660
996
|
/**
|
|
661
997
|
* The item that was open
|
|
662
998
|
*/
|
|
663
|
-
item?: LuaItemStack
|
|
999
|
+
item?: LuaItemStack;
|
|
1000
|
+
/**
|
|
1001
|
+
* Identifier of the event
|
|
1002
|
+
*/
|
|
1003
|
+
name: defines.events;
|
|
664
1004
|
/**
|
|
665
1005
|
* The other player that was open
|
|
666
1006
|
*/
|
|
667
|
-
other_player?: LuaPlayer
|
|
1007
|
+
other_player?: LuaPlayer;
|
|
668
1008
|
/**
|
|
669
1009
|
* The player.
|
|
670
1010
|
*/
|
|
671
|
-
player_index: uint
|
|
1011
|
+
player_index: uint;
|
|
672
1012
|
/**
|
|
673
1013
|
* The technology that was automatically selected when opening the research GUI
|
|
674
1014
|
*/
|
|
675
|
-
technology?: LuaTechnology
|
|
1015
|
+
technology?: LuaTechnology;
|
|
1016
|
+
/**
|
|
1017
|
+
* Tick the event was generated.
|
|
1018
|
+
*/
|
|
1019
|
+
tick: uint;
|
|
676
1020
|
/**
|
|
677
1021
|
* The tile position that was open
|
|
678
1022
|
*/
|
|
679
|
-
tile_position?: TilePosition
|
|
1023
|
+
tile_position?: TilePosition;
|
|
680
1024
|
}
|
|
681
1025
|
/**
|
|
682
1026
|
* Called when a {@link LuaGuiElement | runtime:LuaGuiElement} is confirmed, for example by pressing Enter in a textfield.
|
|
683
1027
|
*/
|
|
684
|
-
interface on_gui_confirmed
|
|
1028
|
+
interface on_gui_confirmed {
|
|
685
1029
|
/**
|
|
686
1030
|
* If alt was pressed.
|
|
687
1031
|
*/
|
|
688
|
-
alt: boolean
|
|
1032
|
+
alt: boolean;
|
|
689
1033
|
/**
|
|
690
1034
|
* If control was pressed.
|
|
691
1035
|
*/
|
|
692
|
-
control: boolean
|
|
1036
|
+
control: boolean;
|
|
693
1037
|
/**
|
|
694
1038
|
* The confirmed element.
|
|
695
1039
|
*/
|
|
696
|
-
element: LuaGuiElement
|
|
1040
|
+
element: LuaGuiElement;
|
|
1041
|
+
/**
|
|
1042
|
+
* Identifier of the event
|
|
1043
|
+
*/
|
|
1044
|
+
name: defines.events;
|
|
697
1045
|
/**
|
|
698
1046
|
* The player who did the confirming.
|
|
699
1047
|
*/
|
|
700
|
-
player_index: uint
|
|
1048
|
+
player_index: uint;
|
|
701
1049
|
/**
|
|
702
1050
|
* If shift was pressed.
|
|
703
1051
|
*/
|
|
704
|
-
shift: boolean
|
|
1052
|
+
shift: boolean;
|
|
1053
|
+
/**
|
|
1054
|
+
* Tick the event was generated.
|
|
1055
|
+
*/
|
|
1056
|
+
tick: uint;
|
|
705
1057
|
}
|
|
706
1058
|
/**
|
|
707
1059
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} element value is changed (related to choose element buttons).
|
|
708
1060
|
*/
|
|
709
|
-
interface on_gui_elem_changed
|
|
1061
|
+
interface on_gui_elem_changed {
|
|
710
1062
|
/**
|
|
711
1063
|
* The element whose element value changed.
|
|
712
1064
|
*/
|
|
713
|
-
element: LuaGuiElement
|
|
1065
|
+
element: LuaGuiElement;
|
|
1066
|
+
/**
|
|
1067
|
+
* Identifier of the event
|
|
1068
|
+
*/
|
|
1069
|
+
name: defines.events;
|
|
714
1070
|
/**
|
|
715
1071
|
* The player who did the change.
|
|
716
1072
|
*/
|
|
717
|
-
player_index: uint
|
|
1073
|
+
player_index: uint;
|
|
1074
|
+
/**
|
|
1075
|
+
* Tick the event was generated.
|
|
1076
|
+
*/
|
|
1077
|
+
tick: uint;
|
|
718
1078
|
}
|
|
719
1079
|
/**
|
|
720
1080
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} is hovered by the mouse.
|
|
721
1081
|
*/
|
|
722
|
-
interface on_gui_hover
|
|
1082
|
+
interface on_gui_hover {
|
|
723
1083
|
/**
|
|
724
1084
|
* The element that is being hovered over.
|
|
725
1085
|
*/
|
|
726
|
-
element: LuaGuiElement
|
|
1086
|
+
element: LuaGuiElement;
|
|
1087
|
+
/**
|
|
1088
|
+
* Identifier of the event
|
|
1089
|
+
*/
|
|
1090
|
+
name: defines.events;
|
|
727
1091
|
/**
|
|
728
1092
|
* The player whose cursor is hovering.
|
|
729
1093
|
*/
|
|
730
|
-
player_index: uint
|
|
1094
|
+
player_index: uint;
|
|
1095
|
+
/**
|
|
1096
|
+
* Tick the event was generated.
|
|
1097
|
+
*/
|
|
1098
|
+
tick: uint;
|
|
731
1099
|
}
|
|
732
1100
|
/**
|
|
733
1101
|
* Called when the player's cursor leaves a {@link LuaGuiElement | runtime:LuaGuiElement} that was previously hovered.
|
|
734
1102
|
*/
|
|
735
|
-
interface on_gui_leave
|
|
1103
|
+
interface on_gui_leave {
|
|
736
1104
|
/**
|
|
737
1105
|
* The element that was being hovered.
|
|
738
1106
|
*/
|
|
739
|
-
element: LuaGuiElement
|
|
1107
|
+
element: LuaGuiElement;
|
|
1108
|
+
/**
|
|
1109
|
+
* Identifier of the event
|
|
1110
|
+
*/
|
|
1111
|
+
name: defines.events;
|
|
740
1112
|
/**
|
|
741
1113
|
* The player whose cursor was hovering.
|
|
742
1114
|
*/
|
|
743
|
-
player_index: uint
|
|
1115
|
+
player_index: uint;
|
|
1116
|
+
/**
|
|
1117
|
+
* Tick the event was generated.
|
|
1118
|
+
*/
|
|
1119
|
+
tick: uint;
|
|
744
1120
|
}
|
|
745
1121
|
/**
|
|
746
1122
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} element location is changed (related to frames in `player.gui.screen`).
|
|
747
1123
|
*/
|
|
748
|
-
interface on_gui_location_changed
|
|
1124
|
+
interface on_gui_location_changed {
|
|
749
1125
|
/**
|
|
750
1126
|
* The element whose location changed.
|
|
751
1127
|
*/
|
|
752
|
-
element: LuaGuiElement
|
|
1128
|
+
element: LuaGuiElement;
|
|
1129
|
+
/**
|
|
1130
|
+
* Identifier of the event
|
|
1131
|
+
*/
|
|
1132
|
+
name: defines.events;
|
|
753
1133
|
/**
|
|
754
1134
|
* The player who did the change.
|
|
755
1135
|
*/
|
|
756
|
-
player_index: uint
|
|
1136
|
+
player_index: uint;
|
|
1137
|
+
/**
|
|
1138
|
+
* Tick the event was generated.
|
|
1139
|
+
*/
|
|
1140
|
+
tick: uint;
|
|
757
1141
|
}
|
|
758
1142
|
/**
|
|
759
1143
|
* Called when the player opens a GUI.
|
|
760
1144
|
*/
|
|
761
|
-
interface on_gui_opened
|
|
1145
|
+
interface on_gui_opened {
|
|
762
1146
|
/**
|
|
763
1147
|
* The custom GUI element that was opened
|
|
764
1148
|
*/
|
|
765
|
-
element?: LuaGuiElement
|
|
1149
|
+
element?: LuaGuiElement;
|
|
766
1150
|
/**
|
|
767
1151
|
* The entity that was opened
|
|
768
1152
|
*/
|
|
769
|
-
entity?: LuaEntity
|
|
1153
|
+
entity?: LuaEntity;
|
|
770
1154
|
/**
|
|
771
1155
|
* The equipment that was opened
|
|
772
1156
|
*/
|
|
773
|
-
equipment?: LuaEquipment
|
|
1157
|
+
equipment?: LuaEquipment;
|
|
774
1158
|
/**
|
|
775
1159
|
* The GUI type that was opened.
|
|
776
1160
|
*/
|
|
777
|
-
gui_type: defines.gui_type
|
|
1161
|
+
gui_type: defines.gui_type;
|
|
778
1162
|
/**
|
|
779
1163
|
* The script inventory that was opened
|
|
780
1164
|
*/
|
|
781
|
-
inventory?: LuaInventory
|
|
1165
|
+
inventory?: LuaInventory;
|
|
782
1166
|
/**
|
|
783
1167
|
* The item that was opened
|
|
784
1168
|
*/
|
|
785
|
-
item?: LuaItemStack
|
|
1169
|
+
item?: LuaItemStack;
|
|
1170
|
+
/**
|
|
1171
|
+
* Identifier of the event
|
|
1172
|
+
*/
|
|
1173
|
+
name: defines.events;
|
|
786
1174
|
/**
|
|
787
1175
|
* The other player that was opened
|
|
788
1176
|
*/
|
|
789
|
-
other_player?: LuaPlayer
|
|
1177
|
+
other_player?: LuaPlayer;
|
|
790
1178
|
/**
|
|
791
1179
|
* The player.
|
|
792
1180
|
*/
|
|
793
|
-
player_index: uint
|
|
1181
|
+
player_index: uint;
|
|
1182
|
+
/**
|
|
1183
|
+
* Tick the event was generated.
|
|
1184
|
+
*/
|
|
1185
|
+
tick: uint;
|
|
794
1186
|
}
|
|
795
1187
|
/**
|
|
796
1188
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} selected tab is changed (related to tabbed-panes).
|
|
797
1189
|
*/
|
|
798
|
-
interface on_gui_selected_tab_changed
|
|
1190
|
+
interface on_gui_selected_tab_changed {
|
|
799
1191
|
/**
|
|
800
1192
|
* The tabbed pane whose selected tab changed.
|
|
801
1193
|
*/
|
|
802
|
-
element: LuaGuiElement
|
|
1194
|
+
element: LuaGuiElement;
|
|
1195
|
+
/**
|
|
1196
|
+
* Identifier of the event
|
|
1197
|
+
*/
|
|
1198
|
+
name: defines.events;
|
|
803
1199
|
/**
|
|
804
1200
|
* The player who did the change.
|
|
805
1201
|
*/
|
|
806
|
-
player_index: uint
|
|
1202
|
+
player_index: uint;
|
|
1203
|
+
/**
|
|
1204
|
+
* Tick the event was generated.
|
|
1205
|
+
*/
|
|
1206
|
+
tick: uint;
|
|
807
1207
|
}
|
|
808
1208
|
/**
|
|
809
1209
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} selection state is changed (related to drop-downs and listboxes).
|
|
810
1210
|
*/
|
|
811
|
-
interface on_gui_selection_state_changed
|
|
1211
|
+
interface on_gui_selection_state_changed {
|
|
812
1212
|
/**
|
|
813
1213
|
* The element whose selection state changed.
|
|
814
1214
|
*/
|
|
815
|
-
element: LuaGuiElement
|
|
1215
|
+
element: LuaGuiElement;
|
|
1216
|
+
/**
|
|
1217
|
+
* Identifier of the event
|
|
1218
|
+
*/
|
|
1219
|
+
name: defines.events;
|
|
816
1220
|
/**
|
|
817
1221
|
* The player who did the change.
|
|
818
1222
|
*/
|
|
819
|
-
player_index: uint
|
|
1223
|
+
player_index: uint;
|
|
1224
|
+
/**
|
|
1225
|
+
* Tick the event was generated.
|
|
1226
|
+
*/
|
|
1227
|
+
tick: uint;
|
|
820
1228
|
}
|
|
821
1229
|
/**
|
|
822
1230
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} switch state is changed (related to switches).
|
|
823
1231
|
*/
|
|
824
|
-
interface on_gui_switch_state_changed
|
|
1232
|
+
interface on_gui_switch_state_changed {
|
|
825
1233
|
/**
|
|
826
1234
|
* The switch whose switch state changed.
|
|
827
1235
|
*/
|
|
828
|
-
element: LuaGuiElement
|
|
1236
|
+
element: LuaGuiElement;
|
|
1237
|
+
/**
|
|
1238
|
+
* Identifier of the event
|
|
1239
|
+
*/
|
|
1240
|
+
name: defines.events;
|
|
829
1241
|
/**
|
|
830
1242
|
* The player who did the change.
|
|
831
1243
|
*/
|
|
832
|
-
player_index: uint
|
|
1244
|
+
player_index: uint;
|
|
1245
|
+
/**
|
|
1246
|
+
* Tick the event was generated.
|
|
1247
|
+
*/
|
|
1248
|
+
tick: uint;
|
|
833
1249
|
}
|
|
834
1250
|
/**
|
|
835
1251
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} text is changed by the player.
|
|
836
1252
|
*/
|
|
837
|
-
interface on_gui_text_changed
|
|
1253
|
+
interface on_gui_text_changed {
|
|
838
1254
|
/**
|
|
839
1255
|
* The edited element.
|
|
840
1256
|
*/
|
|
841
|
-
element: LuaGuiElement
|
|
1257
|
+
element: LuaGuiElement;
|
|
1258
|
+
/**
|
|
1259
|
+
* Identifier of the event
|
|
1260
|
+
*/
|
|
1261
|
+
name: defines.events;
|
|
842
1262
|
/**
|
|
843
1263
|
* The player who did the edit.
|
|
844
1264
|
*/
|
|
845
|
-
player_index: uint
|
|
1265
|
+
player_index: uint;
|
|
846
1266
|
/**
|
|
847
1267
|
* The new text in the element.
|
|
848
1268
|
*/
|
|
849
|
-
text: string
|
|
1269
|
+
text: string;
|
|
1270
|
+
/**
|
|
1271
|
+
* Tick the event was generated.
|
|
1272
|
+
*/
|
|
1273
|
+
tick: uint;
|
|
850
1274
|
}
|
|
851
1275
|
/**
|
|
852
1276
|
* Called when {@link LuaGuiElement | runtime:LuaGuiElement} slider value is changed (related to the slider element).
|
|
853
1277
|
*/
|
|
854
|
-
interface on_gui_value_changed
|
|
1278
|
+
interface on_gui_value_changed {
|
|
855
1279
|
/**
|
|
856
1280
|
* The element whose value changed.
|
|
857
1281
|
*/
|
|
858
|
-
element: LuaGuiElement
|
|
1282
|
+
element: LuaGuiElement;
|
|
1283
|
+
/**
|
|
1284
|
+
* Identifier of the event
|
|
1285
|
+
*/
|
|
1286
|
+
name: defines.events;
|
|
859
1287
|
/**
|
|
860
1288
|
* The player who did the change.
|
|
861
1289
|
*/
|
|
862
|
-
player_index: uint
|
|
1290
|
+
player_index: uint;
|
|
1291
|
+
/**
|
|
1292
|
+
* Tick the event was generated.
|
|
1293
|
+
*/
|
|
1294
|
+
tick: uint;
|
|
863
1295
|
}
|
|
864
1296
|
/**
|
|
865
1297
|
* Called when a land mine is armed.
|
|
866
1298
|
*/
|
|
867
|
-
interface on_land_mine_armed
|
|
868
|
-
mine: LuaEntity
|
|
1299
|
+
interface on_land_mine_armed {
|
|
1300
|
+
mine: LuaEntity;
|
|
1301
|
+
/**
|
|
1302
|
+
* Identifier of the event
|
|
1303
|
+
*/
|
|
1304
|
+
name: defines.events;
|
|
1305
|
+
/**
|
|
1306
|
+
* Tick the event was generated.
|
|
1307
|
+
*/
|
|
1308
|
+
tick: uint;
|
|
869
1309
|
}
|
|
870
1310
|
/**
|
|
871
1311
|
* Called when a custom {@link Lua shortcut | prototype:ShortcutPrototype} is pressed.
|
|
872
1312
|
*/
|
|
873
|
-
interface on_lua_shortcut
|
|
874
|
-
|
|
1313
|
+
interface on_lua_shortcut {
|
|
1314
|
+
/**
|
|
1315
|
+
* Identifier of the event
|
|
1316
|
+
*/
|
|
1317
|
+
name: defines.events;
|
|
1318
|
+
player_index: uint;
|
|
875
1319
|
/**
|
|
876
1320
|
* Shortcut prototype name of the shortcut that was clicked.
|
|
877
1321
|
*/
|
|
878
|
-
prototype_name: string
|
|
1322
|
+
prototype_name: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* Tick the event was generated.
|
|
1325
|
+
*/
|
|
1326
|
+
tick: uint;
|
|
879
1327
|
}
|
|
880
1328
|
/**
|
|
881
1329
|
* Called when an entity is marked for deconstruction with the Deconstruction planner or via script.
|
|
882
1330
|
*/
|
|
883
|
-
interface on_marked_for_deconstruction
|
|
884
|
-
entity: LuaEntity
|
|
885
|
-
|
|
1331
|
+
interface on_marked_for_deconstruction {
|
|
1332
|
+
entity: LuaEntity;
|
|
1333
|
+
/**
|
|
1334
|
+
* Identifier of the event
|
|
1335
|
+
*/
|
|
1336
|
+
name: defines.events;
|
|
1337
|
+
player_index?: uint;
|
|
1338
|
+
/**
|
|
1339
|
+
* Tick the event was generated.
|
|
1340
|
+
*/
|
|
1341
|
+
tick: uint;
|
|
886
1342
|
}
|
|
887
1343
|
/**
|
|
888
1344
|
* Called when an entity is marked for upgrade with the Upgrade planner or via script.
|
|
889
1345
|
*/
|
|
890
|
-
interface on_marked_for_upgrade
|
|
1346
|
+
interface on_marked_for_upgrade {
|
|
1347
|
+
/**
|
|
1348
|
+
* The new direction (if any)
|
|
1349
|
+
*/
|
|
1350
|
+
direction?: defines.direction;
|
|
1351
|
+
entity: LuaEntity;
|
|
891
1352
|
/**
|
|
892
|
-
*
|
|
1353
|
+
* Identifier of the event
|
|
1354
|
+
*/
|
|
1355
|
+
name: defines.events;
|
|
1356
|
+
player_index?: uint;
|
|
1357
|
+
target: LuaEntityPrototype;
|
|
1358
|
+
/**
|
|
1359
|
+
* Tick the event was generated.
|
|
893
1360
|
*/
|
|
894
|
-
|
|
895
|
-
entity: LuaEntity
|
|
896
|
-
player_index?: uint
|
|
897
|
-
target: LuaEntityPrototype
|
|
1361
|
+
tick: uint;
|
|
898
1362
|
}
|
|
899
1363
|
/**
|
|
900
1364
|
* Called after a player purchases some offer from a `market` entity.
|
|
901
1365
|
*/
|
|
902
|
-
interface on_market_item_purchased
|
|
1366
|
+
interface on_market_item_purchased {
|
|
903
1367
|
/**
|
|
904
1368
|
* The amount of offers purchased.
|
|
905
1369
|
*/
|
|
906
|
-
count: uint
|
|
1370
|
+
count: uint;
|
|
907
1371
|
/**
|
|
908
1372
|
* The market entity.
|
|
909
1373
|
*/
|
|
910
|
-
market: LuaEntity
|
|
1374
|
+
market: LuaEntity;
|
|
1375
|
+
/**
|
|
1376
|
+
* Identifier of the event
|
|
1377
|
+
*/
|
|
1378
|
+
name: defines.events;
|
|
911
1379
|
/**
|
|
912
1380
|
* The index of the offer purchased.
|
|
913
1381
|
*/
|
|
914
|
-
offer_index: uint
|
|
1382
|
+
offer_index: uint;
|
|
915
1383
|
/**
|
|
916
1384
|
* The player who did the purchasing.
|
|
917
1385
|
*/
|
|
918
|
-
player_index: uint
|
|
1386
|
+
player_index: uint;
|
|
1387
|
+
/**
|
|
1388
|
+
* Tick the event was generated.
|
|
1389
|
+
*/
|
|
1390
|
+
tick: uint;
|
|
919
1391
|
}
|
|
920
1392
|
/**
|
|
921
1393
|
* Called when the player uses the 'Open item GUI' control on an item defined with the 'mod-openable' flag
|
|
922
1394
|
*/
|
|
923
|
-
interface on_mod_item_opened
|
|
1395
|
+
interface on_mod_item_opened {
|
|
924
1396
|
/**
|
|
925
1397
|
* The item clicked on.
|
|
926
1398
|
*/
|
|
927
|
-
item: LuaItemPrototype
|
|
1399
|
+
item: LuaItemPrototype;
|
|
1400
|
+
/**
|
|
1401
|
+
* Identifier of the event
|
|
1402
|
+
*/
|
|
1403
|
+
name: defines.events;
|
|
928
1404
|
/**
|
|
929
1405
|
* The player.
|
|
930
1406
|
*/
|
|
931
|
-
player_index: uint
|
|
1407
|
+
player_index: uint;
|
|
1408
|
+
/**
|
|
1409
|
+
* Tick the event was generated.
|
|
1410
|
+
*/
|
|
1411
|
+
tick: uint;
|
|
932
1412
|
}
|
|
933
1413
|
/**
|
|
934
1414
|
* Called directly after a permission group is added.
|
|
935
1415
|
*/
|
|
936
|
-
interface on_permission_group_added
|
|
1416
|
+
interface on_permission_group_added {
|
|
937
1417
|
/**
|
|
938
1418
|
* The group added.
|
|
939
1419
|
*/
|
|
940
|
-
group: LuaPermissionGroup
|
|
1420
|
+
group: LuaPermissionGroup;
|
|
1421
|
+
/**
|
|
1422
|
+
* Identifier of the event
|
|
1423
|
+
*/
|
|
1424
|
+
name: defines.events;
|
|
941
1425
|
/**
|
|
942
1426
|
* The player that added the group.
|
|
943
1427
|
*/
|
|
944
|
-
player_index: uint
|
|
1428
|
+
player_index: uint;
|
|
1429
|
+
/**
|
|
1430
|
+
* Tick the event was generated.
|
|
1431
|
+
*/
|
|
1432
|
+
tick: uint;
|
|
945
1433
|
}
|
|
946
1434
|
/**
|
|
947
1435
|
* Called directly after a permission group is deleted.
|
|
948
1436
|
*/
|
|
949
|
-
interface on_permission_group_deleted
|
|
1437
|
+
interface on_permission_group_deleted {
|
|
950
1438
|
/**
|
|
951
1439
|
* The group that was deleted.
|
|
952
1440
|
*/
|
|
953
|
-
group_name: string
|
|
1441
|
+
group_name: string;
|
|
954
1442
|
/**
|
|
955
1443
|
* The group id that was deleted.
|
|
956
1444
|
*/
|
|
957
|
-
id: uint
|
|
1445
|
+
id: uint;
|
|
1446
|
+
/**
|
|
1447
|
+
* Identifier of the event
|
|
1448
|
+
*/
|
|
1449
|
+
name: defines.events;
|
|
958
1450
|
/**
|
|
959
1451
|
* The player doing the deletion.
|
|
960
1452
|
*/
|
|
961
|
-
player_index: uint
|
|
1453
|
+
player_index: uint;
|
|
1454
|
+
/**
|
|
1455
|
+
* Tick the event was generated.
|
|
1456
|
+
*/
|
|
1457
|
+
tick: uint;
|
|
962
1458
|
}
|
|
963
1459
|
/**
|
|
964
1460
|
* Called directly after a permission group is edited in some way.
|
|
965
1461
|
*/
|
|
966
|
-
interface on_permission_group_edited
|
|
1462
|
+
interface on_permission_group_edited {
|
|
967
1463
|
/**
|
|
968
1464
|
* The action when the `type` is `"add-permission"` or `"remove-permission"`.
|
|
969
1465
|
*/
|
|
970
|
-
action: defines.input_action
|
|
1466
|
+
action: defines.input_action;
|
|
971
1467
|
/**
|
|
972
1468
|
* The group being edited.
|
|
973
1469
|
*/
|
|
974
|
-
group: LuaPermissionGroup
|
|
1470
|
+
group: LuaPermissionGroup;
|
|
1471
|
+
/**
|
|
1472
|
+
* Identifier of the event
|
|
1473
|
+
*/
|
|
1474
|
+
name: defines.events;
|
|
975
1475
|
/**
|
|
976
1476
|
* The new group name when the `type` is `"rename"`.
|
|
977
1477
|
*/
|
|
978
|
-
new_name: string
|
|
1478
|
+
new_name: string;
|
|
979
1479
|
/**
|
|
980
1480
|
* The old group name when the `type` is `"rename"`.
|
|
981
1481
|
*/
|
|
982
|
-
old_name: string
|
|
1482
|
+
old_name: string;
|
|
983
1483
|
/**
|
|
984
1484
|
* The other player when the `type` is `"add-player"` or `"remove-player"`.
|
|
985
1485
|
*/
|
|
986
|
-
other_player_index: uint
|
|
1486
|
+
other_player_index: uint;
|
|
987
1487
|
/**
|
|
988
1488
|
* The player that did the editing.
|
|
989
1489
|
*/
|
|
990
|
-
player_index: uint
|
|
1490
|
+
player_index: uint;
|
|
1491
|
+
/**
|
|
1492
|
+
* Tick the event was generated.
|
|
1493
|
+
*/
|
|
1494
|
+
tick: uint;
|
|
991
1495
|
/**
|
|
992
1496
|
* The edit type.
|
|
993
1497
|
*/
|
|
994
|
-
type: 'add-permission' | 'remove-permission' | 'enable-all' | 'disable-all' | 'add-player' | 'remove-player' | 'rename'
|
|
1498
|
+
type: 'add-permission' | 'remove-permission' | 'enable-all' | 'disable-all' | 'add-player' | 'remove-player' | 'rename';
|
|
995
1499
|
}
|
|
996
1500
|
/**
|
|
997
1501
|
* Called directly after a permission string is imported.
|
|
998
1502
|
*/
|
|
999
|
-
interface on_permission_string_imported
|
|
1503
|
+
interface on_permission_string_imported {
|
|
1504
|
+
/**
|
|
1505
|
+
* Identifier of the event
|
|
1506
|
+
*/
|
|
1507
|
+
name: defines.events;
|
|
1000
1508
|
/**
|
|
1001
1509
|
* The player that imported the string.
|
|
1002
1510
|
*/
|
|
1003
|
-
player_index: uint
|
|
1511
|
+
player_index: uint;
|
|
1512
|
+
/**
|
|
1513
|
+
* Tick the event was generated.
|
|
1514
|
+
*/
|
|
1515
|
+
tick: uint;
|
|
1004
1516
|
}
|
|
1005
1517
|
/**
|
|
1006
1518
|
* Called when a player picks up an item.
|
|
1007
1519
|
*/
|
|
1008
|
-
interface on_picked_up_item
|
|
1009
|
-
item_stack: SimpleItemStack
|
|
1010
|
-
|
|
1520
|
+
interface on_picked_up_item {
|
|
1521
|
+
item_stack: SimpleItemStack;
|
|
1522
|
+
/**
|
|
1523
|
+
* Identifier of the event
|
|
1524
|
+
*/
|
|
1525
|
+
name: defines.events;
|
|
1526
|
+
player_index: uint;
|
|
1527
|
+
/**
|
|
1528
|
+
* Tick the event was generated.
|
|
1529
|
+
*/
|
|
1530
|
+
tick: uint;
|
|
1011
1531
|
}
|
|
1012
1532
|
/**
|
|
1013
1533
|
* Called after a player alt-reverse-selects an area with a selection-tool item.
|
|
1014
1534
|
*/
|
|
1015
|
-
interface on_player_alt_reverse_selected_area
|
|
1535
|
+
interface on_player_alt_reverse_selected_area {
|
|
1016
1536
|
/**
|
|
1017
1537
|
* The area selected.
|
|
1018
1538
|
*/
|
|
1019
|
-
area: BoundingBox
|
|
1539
|
+
area: BoundingBox;
|
|
1020
1540
|
/**
|
|
1021
1541
|
* The entities selected.
|
|
1022
1542
|
*/
|
|
1023
|
-
entities: LuaEntity[]
|
|
1543
|
+
entities: LuaEntity[];
|
|
1024
1544
|
/**
|
|
1025
1545
|
* The item used to select the area.
|
|
1026
1546
|
*/
|
|
1027
|
-
item: string
|
|
1547
|
+
item: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* Identifier of the event
|
|
1550
|
+
*/
|
|
1551
|
+
name: defines.events;
|
|
1028
1552
|
/**
|
|
1029
1553
|
* The player doing the selection.
|
|
1030
1554
|
*/
|
|
1031
|
-
player_index: uint
|
|
1555
|
+
player_index: uint;
|
|
1032
1556
|
/**
|
|
1033
1557
|
* The surface selected.
|
|
1034
1558
|
*/
|
|
1035
|
-
surface: LuaSurface
|
|
1559
|
+
surface: LuaSurface;
|
|
1560
|
+
/**
|
|
1561
|
+
* Tick the event was generated.
|
|
1562
|
+
*/
|
|
1563
|
+
tick: uint;
|
|
1036
1564
|
/**
|
|
1037
1565
|
* The tiles selected.
|
|
1038
1566
|
*/
|
|
1039
|
-
tiles: LuaTile[]
|
|
1567
|
+
tiles: LuaTile[];
|
|
1040
1568
|
}
|
|
1041
1569
|
/**
|
|
1042
1570
|
* Called after a player alt-selects an area with a selection-tool item.
|
|
1043
1571
|
*/
|
|
1044
|
-
interface on_player_alt_selected_area
|
|
1572
|
+
interface on_player_alt_selected_area {
|
|
1045
1573
|
/**
|
|
1046
1574
|
* The area selected.
|
|
1047
1575
|
*/
|
|
1048
|
-
area: BoundingBox
|
|
1576
|
+
area: BoundingBox;
|
|
1049
1577
|
/**
|
|
1050
1578
|
* The entities selected.
|
|
1051
1579
|
*/
|
|
1052
|
-
entities: LuaEntity[]
|
|
1580
|
+
entities: LuaEntity[];
|
|
1053
1581
|
/**
|
|
1054
1582
|
* The item used to select the area.
|
|
1055
1583
|
*/
|
|
1056
|
-
item: string
|
|
1584
|
+
item: string;
|
|
1585
|
+
/**
|
|
1586
|
+
* Identifier of the event
|
|
1587
|
+
*/
|
|
1588
|
+
name: defines.events;
|
|
1057
1589
|
/**
|
|
1058
1590
|
* The player doing the selection.
|
|
1059
1591
|
*/
|
|
1060
|
-
player_index: uint
|
|
1592
|
+
player_index: uint;
|
|
1061
1593
|
/**
|
|
1062
1594
|
* The surface selected.
|
|
1063
1595
|
*/
|
|
1064
|
-
surface: LuaSurface
|
|
1596
|
+
surface: LuaSurface;
|
|
1597
|
+
/**
|
|
1598
|
+
* Tick the event was generated.
|
|
1599
|
+
*/
|
|
1600
|
+
tick: uint;
|
|
1065
1601
|
/**
|
|
1066
1602
|
* The tiles selected.
|
|
1067
1603
|
*/
|
|
1068
|
-
tiles: LuaTile[]
|
|
1604
|
+
tiles: LuaTile[];
|
|
1069
1605
|
}
|
|
1070
1606
|
/**
|
|
1071
1607
|
* Called after a players ammo inventory changed in some way.
|
|
1072
1608
|
*/
|
|
1073
|
-
interface on_player_ammo_inventory_changed
|
|
1074
|
-
|
|
1609
|
+
interface on_player_ammo_inventory_changed {
|
|
1610
|
+
/**
|
|
1611
|
+
* Identifier of the event
|
|
1612
|
+
*/
|
|
1613
|
+
name: defines.events;
|
|
1614
|
+
player_index: uint;
|
|
1615
|
+
/**
|
|
1616
|
+
* Tick the event was generated.
|
|
1617
|
+
*/
|
|
1618
|
+
tick: uint;
|
|
1075
1619
|
}
|
|
1076
1620
|
/**
|
|
1077
1621
|
* Called after a players armor inventory changed in some way.
|
|
1078
1622
|
*/
|
|
1079
|
-
interface on_player_armor_inventory_changed
|
|
1080
|
-
|
|
1623
|
+
interface on_player_armor_inventory_changed {
|
|
1624
|
+
/**
|
|
1625
|
+
* Identifier of the event
|
|
1626
|
+
*/
|
|
1627
|
+
name: defines.events;
|
|
1628
|
+
player_index: uint;
|
|
1629
|
+
/**
|
|
1630
|
+
* Tick the event was generated.
|
|
1631
|
+
*/
|
|
1632
|
+
tick: uint;
|
|
1081
1633
|
}
|
|
1082
1634
|
/**
|
|
1083
1635
|
* Called when a player is banned.
|
|
1084
1636
|
*/
|
|
1085
|
-
interface on_player_banned
|
|
1637
|
+
interface on_player_banned {
|
|
1086
1638
|
/**
|
|
1087
1639
|
* The player that did the banning if any.
|
|
1088
1640
|
*/
|
|
1089
|
-
by_player?: uint
|
|
1641
|
+
by_player?: uint;
|
|
1642
|
+
/**
|
|
1643
|
+
* Identifier of the event
|
|
1644
|
+
*/
|
|
1645
|
+
name: defines.events;
|
|
1090
1646
|
/**
|
|
1091
1647
|
* The player banned.
|
|
1092
1648
|
*/
|
|
1093
|
-
player_index?: uint
|
|
1649
|
+
player_index?: uint;
|
|
1094
1650
|
/**
|
|
1095
1651
|
* The banned player name.
|
|
1096
1652
|
*/
|
|
1097
|
-
player_name: string
|
|
1653
|
+
player_name: string;
|
|
1098
1654
|
/**
|
|
1099
1655
|
* The reason given if any.
|
|
1100
1656
|
*/
|
|
1101
|
-
reason?: string
|
|
1657
|
+
reason?: string;
|
|
1658
|
+
/**
|
|
1659
|
+
* Tick the event was generated.
|
|
1660
|
+
*/
|
|
1661
|
+
tick: uint;
|
|
1102
1662
|
}
|
|
1103
1663
|
/**
|
|
1104
1664
|
* Called after a player builds tiles.
|
|
1105
1665
|
*/
|
|
1106
|
-
interface on_player_built_tile
|
|
1666
|
+
interface on_player_built_tile {
|
|
1107
1667
|
/**
|
|
1108
1668
|
* The item type used to build the tiles
|
|
1109
1669
|
*/
|
|
1110
|
-
item?: LuaItemPrototype
|
|
1111
|
-
|
|
1670
|
+
item?: LuaItemPrototype;
|
|
1671
|
+
/**
|
|
1672
|
+
* Identifier of the event
|
|
1673
|
+
*/
|
|
1674
|
+
name: defines.events;
|
|
1675
|
+
player_index: uint;
|
|
1112
1676
|
/**
|
|
1113
1677
|
* The stack used to build the tiles (may be empty if all of the items were used to build the tiles).
|
|
1114
1678
|
*/
|
|
1115
|
-
stack?: LuaItemStack
|
|
1679
|
+
stack?: LuaItemStack;
|
|
1116
1680
|
/**
|
|
1117
1681
|
* The surface the tile(s) were built on.
|
|
1118
1682
|
*/
|
|
1119
|
-
surface_index: uint
|
|
1683
|
+
surface_index: uint;
|
|
1684
|
+
/**
|
|
1685
|
+
* Tick the event was generated.
|
|
1686
|
+
*/
|
|
1687
|
+
tick: uint;
|
|
1120
1688
|
/**
|
|
1121
1689
|
* The tile prototype that was placed.
|
|
1122
1690
|
*/
|
|
1123
|
-
tile: LuaTilePrototype
|
|
1691
|
+
tile: LuaTilePrototype;
|
|
1124
1692
|
/**
|
|
1125
1693
|
* The position data.
|
|
1126
1694
|
*/
|
|
1127
|
-
tiles: OldTileAndPosition[]
|
|
1695
|
+
tiles: OldTileAndPosition[];
|
|
1128
1696
|
}
|
|
1129
1697
|
/**
|
|
1130
1698
|
* Called when a player cancels crafting.
|
|
1131
1699
|
*/
|
|
1132
|
-
interface on_player_cancelled_crafting
|
|
1700
|
+
interface on_player_cancelled_crafting {
|
|
1133
1701
|
/**
|
|
1134
1702
|
* The number of crafts that have been cancelled.
|
|
1135
1703
|
*/
|
|
1136
|
-
cancel_count: uint
|
|
1704
|
+
cancel_count: uint;
|
|
1137
1705
|
/**
|
|
1138
1706
|
* The crafting items returned to the player's inventory.
|
|
1139
1707
|
*/
|
|
1140
|
-
items: LuaInventory
|
|
1708
|
+
items: LuaInventory;
|
|
1709
|
+
/**
|
|
1710
|
+
* Identifier of the event
|
|
1711
|
+
*/
|
|
1712
|
+
name: defines.events;
|
|
1141
1713
|
/**
|
|
1142
1714
|
* The player that did the crafting.
|
|
1143
1715
|
*/
|
|
1144
|
-
player_index: uint
|
|
1716
|
+
player_index: uint;
|
|
1145
1717
|
/**
|
|
1146
1718
|
* The recipe that has been cancelled.
|
|
1147
1719
|
*/
|
|
1148
|
-
recipe: LuaRecipe
|
|
1720
|
+
recipe: LuaRecipe;
|
|
1721
|
+
/**
|
|
1722
|
+
* Tick the event was generated.
|
|
1723
|
+
*/
|
|
1724
|
+
tick: uint;
|
|
1149
1725
|
}
|
|
1150
1726
|
/**
|
|
1151
1727
|
* Called after a player changes forces.
|
|
1152
1728
|
*/
|
|
1153
|
-
interface on_player_changed_force
|
|
1729
|
+
interface on_player_changed_force {
|
|
1154
1730
|
/**
|
|
1155
1731
|
* The old force.
|
|
1156
1732
|
*/
|
|
1157
|
-
force: LuaForce
|
|
1733
|
+
force: LuaForce;
|
|
1734
|
+
/**
|
|
1735
|
+
* Identifier of the event
|
|
1736
|
+
*/
|
|
1737
|
+
name: defines.events;
|
|
1158
1738
|
/**
|
|
1159
1739
|
* The player who changed forces.
|
|
1160
1740
|
*/
|
|
1161
|
-
player_index: uint
|
|
1741
|
+
player_index: uint;
|
|
1742
|
+
/**
|
|
1743
|
+
* Tick the event was generated.
|
|
1744
|
+
*/
|
|
1745
|
+
tick: uint;
|
|
1162
1746
|
}
|
|
1163
1747
|
/**
|
|
1164
1748
|
* Called when the tile position a player is located at changes.
|
|
1165
1749
|
*/
|
|
1166
|
-
interface on_player_changed_position
|
|
1750
|
+
interface on_player_changed_position {
|
|
1751
|
+
/**
|
|
1752
|
+
* Identifier of the event
|
|
1753
|
+
*/
|
|
1754
|
+
name: defines.events;
|
|
1167
1755
|
/**
|
|
1168
1756
|
* The player.
|
|
1169
1757
|
*/
|
|
1170
|
-
player_index: uint
|
|
1758
|
+
player_index: uint;
|
|
1759
|
+
/**
|
|
1760
|
+
* Tick the event was generated.
|
|
1761
|
+
*/
|
|
1762
|
+
tick: uint;
|
|
1171
1763
|
}
|
|
1172
1764
|
/**
|
|
1173
1765
|
* Called after a player changes surfaces.
|
|
1174
|
-
*
|
|
1766
|
+
*
|
|
1175
1767
|
* In the instance a player is moved off a surface due to it being deleted this is not called.
|
|
1176
1768
|
*/
|
|
1177
|
-
interface on_player_changed_surface
|
|
1769
|
+
interface on_player_changed_surface {
|
|
1770
|
+
/**
|
|
1771
|
+
* Identifier of the event
|
|
1772
|
+
*/
|
|
1773
|
+
name: defines.events;
|
|
1178
1774
|
/**
|
|
1179
1775
|
* The player who changed surfaces.
|
|
1180
1776
|
*/
|
|
1181
|
-
player_index: uint
|
|
1777
|
+
player_index: uint;
|
|
1182
1778
|
/**
|
|
1183
1779
|
* The surface index the player was on.
|
|
1184
1780
|
*/
|
|
1185
|
-
surface_index: uint
|
|
1781
|
+
surface_index: uint;
|
|
1782
|
+
/**
|
|
1783
|
+
* Tick the event was generated.
|
|
1784
|
+
*/
|
|
1785
|
+
tick: uint;
|
|
1186
1786
|
}
|
|
1187
1787
|
/**
|
|
1188
1788
|
* Called when cheat mode is disabled on a player.
|
|
1189
1789
|
*/
|
|
1190
|
-
interface on_player_cheat_mode_disabled
|
|
1790
|
+
interface on_player_cheat_mode_disabled {
|
|
1791
|
+
/**
|
|
1792
|
+
* Identifier of the event
|
|
1793
|
+
*/
|
|
1794
|
+
name: defines.events;
|
|
1191
1795
|
/**
|
|
1192
1796
|
* The player.
|
|
1193
1797
|
*/
|
|
1194
|
-
player_index: uint
|
|
1798
|
+
player_index: uint;
|
|
1799
|
+
/**
|
|
1800
|
+
* Tick the event was generated.
|
|
1801
|
+
*/
|
|
1802
|
+
tick: uint;
|
|
1195
1803
|
}
|
|
1196
1804
|
/**
|
|
1197
1805
|
* Called when cheat mode is enabled on a player.
|
|
1198
1806
|
*/
|
|
1199
|
-
interface on_player_cheat_mode_enabled
|
|
1807
|
+
interface on_player_cheat_mode_enabled {
|
|
1808
|
+
/**
|
|
1809
|
+
* Identifier of the event
|
|
1810
|
+
*/
|
|
1811
|
+
name: defines.events;
|
|
1200
1812
|
/**
|
|
1201
1813
|
* The player.
|
|
1202
1814
|
*/
|
|
1203
|
-
player_index: uint
|
|
1815
|
+
player_index: uint;
|
|
1816
|
+
/**
|
|
1817
|
+
* Tick the event was generated.
|
|
1818
|
+
*/
|
|
1819
|
+
tick: uint;
|
|
1204
1820
|
}
|
|
1205
1821
|
/**
|
|
1206
1822
|
* Called when a player clicks a gps tag
|
|
1207
1823
|
*/
|
|
1208
|
-
interface on_player_clicked_gps_tag
|
|
1824
|
+
interface on_player_clicked_gps_tag {
|
|
1825
|
+
/**
|
|
1826
|
+
* Identifier of the event
|
|
1827
|
+
*/
|
|
1828
|
+
name: defines.events;
|
|
1209
1829
|
/**
|
|
1210
1830
|
* Index of the player
|
|
1211
1831
|
*/
|
|
1212
|
-
player_index: uint
|
|
1832
|
+
player_index: uint;
|
|
1213
1833
|
/**
|
|
1214
1834
|
* Map position contained in gps tag
|
|
1215
1835
|
*/
|
|
1216
|
-
position: MapPosition
|
|
1836
|
+
position: MapPosition;
|
|
1217
1837
|
/**
|
|
1218
1838
|
* Surface name contained in gps tag, even when such surface does not exists
|
|
1219
1839
|
*/
|
|
1220
|
-
surface: string
|
|
1840
|
+
surface: string;
|
|
1841
|
+
/**
|
|
1842
|
+
* Tick the event was generated.
|
|
1843
|
+
*/
|
|
1844
|
+
tick: uint;
|
|
1221
1845
|
}
|
|
1222
1846
|
/**
|
|
1223
1847
|
* Called when a player clicks the "confirm" button in the configure Blueprint GUI.
|
|
1224
1848
|
*/
|
|
1225
|
-
interface on_player_configured_blueprint
|
|
1849
|
+
interface on_player_configured_blueprint {
|
|
1850
|
+
/**
|
|
1851
|
+
* Identifier of the event
|
|
1852
|
+
*/
|
|
1853
|
+
name: defines.events;
|
|
1226
1854
|
/**
|
|
1227
1855
|
* The player.
|
|
1228
1856
|
*/
|
|
1229
|
-
player_index: uint
|
|
1857
|
+
player_index: uint;
|
|
1858
|
+
/**
|
|
1859
|
+
* Tick the event was generated.
|
|
1860
|
+
*/
|
|
1861
|
+
tick: uint;
|
|
1230
1862
|
}
|
|
1231
1863
|
/**
|
|
1232
1864
|
* Called when a player configures spidertron remote to be connected with a given spidertron
|
|
1233
1865
|
*/
|
|
1234
|
-
interface on_player_configured_spider_remote
|
|
1866
|
+
interface on_player_configured_spider_remote {
|
|
1867
|
+
/**
|
|
1868
|
+
* Identifier of the event
|
|
1869
|
+
*/
|
|
1870
|
+
name: defines.events;
|
|
1235
1871
|
/**
|
|
1236
1872
|
* The player that configured the remote.
|
|
1237
1873
|
*/
|
|
1238
|
-
player_index: uint
|
|
1874
|
+
player_index: uint;
|
|
1875
|
+
/**
|
|
1876
|
+
* Tick the event was generated.
|
|
1877
|
+
*/
|
|
1878
|
+
tick: uint;
|
|
1239
1879
|
/**
|
|
1240
1880
|
* Spider vehicle to which remote was connected to.
|
|
1241
1881
|
*/
|
|
1242
|
-
vehicle: LuaEntity
|
|
1882
|
+
vehicle: LuaEntity;
|
|
1243
1883
|
}
|
|
1244
1884
|
/**
|
|
1245
1885
|
* Called when the player finishes crafting an item. This event fires just before the results are inserted into the player's inventory, not when the crafting is queued (see {@link on_pre_player_crafted_item | runtime:on_pre_player_crafted_item}).
|
|
1246
1886
|
*/
|
|
1247
|
-
interface on_player_crafted_item
|
|
1887
|
+
interface on_player_crafted_item {
|
|
1248
1888
|
/**
|
|
1249
1889
|
* The item that has been crafted.
|
|
1250
1890
|
*/
|
|
1251
|
-
item_stack: LuaItemStack
|
|
1891
|
+
item_stack: LuaItemStack;
|
|
1892
|
+
/**
|
|
1893
|
+
* Identifier of the event
|
|
1894
|
+
*/
|
|
1895
|
+
name: defines.events;
|
|
1252
1896
|
/**
|
|
1253
1897
|
* The player doing the crafting.
|
|
1254
1898
|
*/
|
|
1255
|
-
player_index: uint
|
|
1899
|
+
player_index: uint;
|
|
1256
1900
|
/**
|
|
1257
1901
|
* The recipe used to craft this item.
|
|
1258
1902
|
*/
|
|
1259
|
-
recipe: LuaRecipe
|
|
1903
|
+
recipe: LuaRecipe;
|
|
1904
|
+
/**
|
|
1905
|
+
* Tick the event was generated.
|
|
1906
|
+
*/
|
|
1907
|
+
tick: uint;
|
|
1260
1908
|
}
|
|
1261
1909
|
/**
|
|
1262
1910
|
* Called after the player was created.
|
|
1263
1911
|
*/
|
|
1264
|
-
interface on_player_created
|
|
1265
|
-
|
|
1912
|
+
interface on_player_created {
|
|
1913
|
+
/**
|
|
1914
|
+
* Identifier of the event
|
|
1915
|
+
*/
|
|
1916
|
+
name: defines.events;
|
|
1917
|
+
player_index: uint;
|
|
1918
|
+
/**
|
|
1919
|
+
* Tick the event was generated.
|
|
1920
|
+
*/
|
|
1921
|
+
tick: uint;
|
|
1266
1922
|
}
|
|
1267
1923
|
/**
|
|
1268
1924
|
* Called after a player's {@link cursor stack | runtime:LuaControl::cursor_stack} changed in some way.
|
|
1269
|
-
*
|
|
1925
|
+
*
|
|
1270
1926
|
* This is fired in the same tick that the change happens, but not instantly.
|
|
1271
1927
|
*/
|
|
1272
|
-
interface on_player_cursor_stack_changed
|
|
1273
|
-
|
|
1928
|
+
interface on_player_cursor_stack_changed {
|
|
1929
|
+
/**
|
|
1930
|
+
* Identifier of the event
|
|
1931
|
+
*/
|
|
1932
|
+
name: defines.events;
|
|
1933
|
+
player_index: uint;
|
|
1934
|
+
/**
|
|
1935
|
+
* Tick the event was generated.
|
|
1936
|
+
*/
|
|
1937
|
+
tick: uint;
|
|
1274
1938
|
}
|
|
1275
1939
|
/**
|
|
1276
1940
|
* Called when a player selects an area with a deconstruction planner.
|
|
1277
1941
|
*/
|
|
1278
|
-
interface on_player_deconstructed_area
|
|
1942
|
+
interface on_player_deconstructed_area {
|
|
1279
1943
|
/**
|
|
1280
1944
|
* If normal selection or alt selection was used.
|
|
1281
1945
|
*/
|
|
1282
|
-
alt: boolean
|
|
1946
|
+
alt: boolean;
|
|
1283
1947
|
/**
|
|
1284
1948
|
* The area selected.
|
|
1285
1949
|
*/
|
|
1286
|
-
area: BoundingBox
|
|
1950
|
+
area: BoundingBox;
|
|
1287
1951
|
/**
|
|
1288
1952
|
* The item used to select the area.
|
|
1289
1953
|
*/
|
|
1290
|
-
item: string
|
|
1954
|
+
item: string;
|
|
1955
|
+
/**
|
|
1956
|
+
* Identifier of the event
|
|
1957
|
+
*/
|
|
1958
|
+
name: defines.events;
|
|
1291
1959
|
/**
|
|
1292
1960
|
* The player doing the selection.
|
|
1293
1961
|
*/
|
|
1294
|
-
player_index: uint
|
|
1962
|
+
player_index: uint;
|
|
1295
1963
|
/**
|
|
1296
1964
|
* The surface selected.
|
|
1297
1965
|
*/
|
|
1298
|
-
surface: LuaSurface
|
|
1966
|
+
surface: LuaSurface;
|
|
1967
|
+
/**
|
|
1968
|
+
* Tick the event was generated.
|
|
1969
|
+
*/
|
|
1970
|
+
tick: uint;
|
|
1299
1971
|
}
|
|
1300
1972
|
/**
|
|
1301
1973
|
* Called when a player is demoted.
|
|
1302
1974
|
*/
|
|
1303
|
-
interface on_player_demoted
|
|
1975
|
+
interface on_player_demoted {
|
|
1976
|
+
/**
|
|
1977
|
+
* Identifier of the event
|
|
1978
|
+
*/
|
|
1979
|
+
name: defines.events;
|
|
1304
1980
|
/**
|
|
1305
1981
|
* The player.
|
|
1306
1982
|
*/
|
|
1307
|
-
player_index: uint
|
|
1983
|
+
player_index: uint;
|
|
1984
|
+
/**
|
|
1985
|
+
* Tick the event was generated.
|
|
1986
|
+
*/
|
|
1987
|
+
tick: uint;
|
|
1308
1988
|
}
|
|
1309
1989
|
/**
|
|
1310
1990
|
* Called after a player dies.
|
|
1311
1991
|
*/
|
|
1312
|
-
interface on_player_died
|
|
1313
|
-
cause?: LuaEntity
|
|
1314
|
-
|
|
1992
|
+
interface on_player_died {
|
|
1993
|
+
cause?: LuaEntity;
|
|
1994
|
+
/**
|
|
1995
|
+
* Identifier of the event
|
|
1996
|
+
*/
|
|
1997
|
+
name: defines.events;
|
|
1998
|
+
player_index: uint;
|
|
1999
|
+
/**
|
|
2000
|
+
* Tick the event was generated.
|
|
2001
|
+
*/
|
|
2002
|
+
tick: uint;
|
|
1315
2003
|
}
|
|
1316
2004
|
/**
|
|
1317
2005
|
* Called when the display resolution changes for a given player.
|
|
1318
2006
|
*/
|
|
1319
|
-
interface on_player_display_resolution_changed
|
|
2007
|
+
interface on_player_display_resolution_changed {
|
|
2008
|
+
/**
|
|
2009
|
+
* Identifier of the event
|
|
2010
|
+
*/
|
|
2011
|
+
name: defines.events;
|
|
1320
2012
|
/**
|
|
1321
2013
|
* The old display resolution
|
|
1322
2014
|
*/
|
|
1323
|
-
old_resolution: DisplayResolution
|
|
2015
|
+
old_resolution: DisplayResolution;
|
|
1324
2016
|
/**
|
|
1325
2017
|
* The player
|
|
1326
2018
|
*/
|
|
1327
|
-
player_index: uint
|
|
2019
|
+
player_index: uint;
|
|
2020
|
+
/**
|
|
2021
|
+
* Tick the event was generated.
|
|
2022
|
+
*/
|
|
2023
|
+
tick: uint;
|
|
1328
2024
|
}
|
|
1329
2025
|
/**
|
|
1330
2026
|
* Called when the display scale changes for a given player.
|
|
1331
2027
|
*/
|
|
1332
|
-
interface on_player_display_scale_changed
|
|
2028
|
+
interface on_player_display_scale_changed {
|
|
2029
|
+
/**
|
|
2030
|
+
* Identifier of the event
|
|
2031
|
+
*/
|
|
2032
|
+
name: defines.events;
|
|
1333
2033
|
/**
|
|
1334
2034
|
* The old display scale
|
|
1335
2035
|
*/
|
|
1336
|
-
old_scale: double
|
|
2036
|
+
old_scale: double;
|
|
1337
2037
|
/**
|
|
1338
2038
|
* The player
|
|
1339
2039
|
*/
|
|
1340
|
-
player_index: uint
|
|
2040
|
+
player_index: uint;
|
|
2041
|
+
/**
|
|
2042
|
+
* Tick the event was generated.
|
|
2043
|
+
*/
|
|
2044
|
+
tick: uint;
|
|
1341
2045
|
}
|
|
1342
2046
|
/**
|
|
1343
2047
|
* Called when the player's driving state has changed, meaning a player has either entered or left a vehicle.
|
|
1344
|
-
*
|
|
2048
|
+
*
|
|
1345
2049
|
* This event is not raised when the player is ejected from a vehicle due to it being destroyed.
|
|
1346
2050
|
*/
|
|
1347
|
-
interface on_player_driving_changed_state
|
|
2051
|
+
interface on_player_driving_changed_state {
|
|
1348
2052
|
/**
|
|
1349
2053
|
* The vehicle if any.
|
|
1350
2054
|
*/
|
|
1351
|
-
entity?: LuaEntity
|
|
1352
|
-
|
|
2055
|
+
entity?: LuaEntity;
|
|
2056
|
+
/**
|
|
2057
|
+
* Identifier of the event
|
|
2058
|
+
*/
|
|
2059
|
+
name: defines.events;
|
|
2060
|
+
player_index: uint;
|
|
2061
|
+
/**
|
|
2062
|
+
* Tick the event was generated.
|
|
2063
|
+
*/
|
|
2064
|
+
tick: uint;
|
|
1353
2065
|
}
|
|
1354
2066
|
/**
|
|
1355
2067
|
* Called when a player drops an item on the ground.
|
|
1356
2068
|
*/
|
|
1357
|
-
interface on_player_dropped_item
|
|
2069
|
+
interface on_player_dropped_item {
|
|
1358
2070
|
/**
|
|
1359
2071
|
* The item-on-ground entity.
|
|
1360
2072
|
*/
|
|
1361
|
-
entity: LuaEntity
|
|
1362
|
-
|
|
2073
|
+
entity: LuaEntity;
|
|
2074
|
+
/**
|
|
2075
|
+
* Identifier of the event
|
|
2076
|
+
*/
|
|
2077
|
+
name: defines.events;
|
|
2078
|
+
player_index: uint;
|
|
2079
|
+
/**
|
|
2080
|
+
* Tick the event was generated.
|
|
2081
|
+
*/
|
|
2082
|
+
tick: uint;
|
|
1363
2083
|
}
|
|
1364
2084
|
/**
|
|
1365
2085
|
* Called when a player fast-transfers something to or from an entity.
|
|
1366
2086
|
*/
|
|
1367
|
-
interface on_player_fast_transferred
|
|
2087
|
+
interface on_player_fast_transferred {
|
|
1368
2088
|
/**
|
|
1369
2089
|
* The entity transferred from or to.
|
|
1370
2090
|
*/
|
|
1371
|
-
entity: LuaEntity
|
|
2091
|
+
entity: LuaEntity;
|
|
1372
2092
|
/**
|
|
1373
2093
|
* Whether the transfer was from player to entity. If `false`, the transfer was from entity to player.
|
|
1374
2094
|
*/
|
|
1375
|
-
from_player: boolean
|
|
2095
|
+
from_player: boolean;
|
|
1376
2096
|
/**
|
|
1377
2097
|
* Whether the transfer was a split action (half stack).
|
|
1378
2098
|
*/
|
|
1379
|
-
is_split: boolean
|
|
2099
|
+
is_split: boolean;
|
|
2100
|
+
/**
|
|
2101
|
+
* Identifier of the event
|
|
2102
|
+
*/
|
|
2103
|
+
name: defines.events;
|
|
1380
2104
|
/**
|
|
1381
2105
|
* The player transferred from or to.
|
|
1382
2106
|
*/
|
|
1383
|
-
player_index: uint
|
|
2107
|
+
player_index: uint;
|
|
2108
|
+
/**
|
|
2109
|
+
* Tick the event was generated.
|
|
2110
|
+
*/
|
|
2111
|
+
tick: uint;
|
|
1384
2112
|
}
|
|
1385
2113
|
/**
|
|
1386
2114
|
* Called after player flushed fluid
|
|
1387
2115
|
*/
|
|
1388
|
-
interface on_player_flushed_fluid
|
|
2116
|
+
interface on_player_flushed_fluid {
|
|
1389
2117
|
/**
|
|
1390
2118
|
* Amount of fluid that was removed
|
|
1391
2119
|
*/
|
|
1392
|
-
amount: double
|
|
2120
|
+
amount: double;
|
|
1393
2121
|
/**
|
|
1394
2122
|
* Entity from which flush was performed
|
|
1395
2123
|
*/
|
|
1396
|
-
entity: LuaEntity
|
|
2124
|
+
entity: LuaEntity;
|
|
1397
2125
|
/**
|
|
1398
2126
|
* Name of a fluid that was flushed
|
|
1399
2127
|
*/
|
|
1400
|
-
fluid: string
|
|
2128
|
+
fluid: string;
|
|
2129
|
+
/**
|
|
2130
|
+
* Identifier of the event
|
|
2131
|
+
*/
|
|
2132
|
+
name: defines.events;
|
|
1401
2133
|
/**
|
|
1402
2134
|
* True if flush was requested only on this entity
|
|
1403
2135
|
*/
|
|
1404
|
-
only_this_entity: boolean
|
|
2136
|
+
only_this_entity: boolean;
|
|
1405
2137
|
/**
|
|
1406
2138
|
* Index of the player
|
|
1407
2139
|
*/
|
|
1408
|
-
player_index: uint
|
|
2140
|
+
player_index: uint;
|
|
2141
|
+
/**
|
|
2142
|
+
* Tick the event was generated.
|
|
2143
|
+
*/
|
|
2144
|
+
tick: uint;
|
|
1409
2145
|
}
|
|
1410
2146
|
/**
|
|
1411
2147
|
* Called after a players gun inventory changed in some way.
|
|
1412
2148
|
*/
|
|
1413
|
-
interface on_player_gun_inventory_changed
|
|
1414
|
-
|
|
2149
|
+
interface on_player_gun_inventory_changed {
|
|
2150
|
+
/**
|
|
2151
|
+
* Identifier of the event
|
|
2152
|
+
*/
|
|
2153
|
+
name: defines.events;
|
|
2154
|
+
player_index: uint;
|
|
2155
|
+
/**
|
|
2156
|
+
* Tick the event was generated.
|
|
2157
|
+
*/
|
|
2158
|
+
tick: uint;
|
|
1415
2159
|
}
|
|
1416
2160
|
/**
|
|
1417
2161
|
* Called when a player's input method changes. See {@link LuaPlayer::input_method | runtime:LuaPlayer::input_method}.
|
|
1418
2162
|
*/
|
|
1419
|
-
interface on_player_input_method_changed
|
|
2163
|
+
interface on_player_input_method_changed {
|
|
2164
|
+
/**
|
|
2165
|
+
* Identifier of the event
|
|
2166
|
+
*/
|
|
2167
|
+
name: defines.events;
|
|
1420
2168
|
/**
|
|
1421
2169
|
* The player whose input method changed.
|
|
1422
2170
|
*/
|
|
1423
|
-
player_index: uint
|
|
2171
|
+
player_index: uint;
|
|
2172
|
+
/**
|
|
2173
|
+
* Tick the event was generated.
|
|
2174
|
+
*/
|
|
2175
|
+
tick: uint;
|
|
1424
2176
|
}
|
|
1425
2177
|
/**
|
|
1426
2178
|
* Called after a player joins the game. This is not called when loading a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
|
|
1427
2179
|
*/
|
|
1428
|
-
interface on_player_joined_game
|
|
1429
|
-
|
|
2180
|
+
interface on_player_joined_game {
|
|
2181
|
+
/**
|
|
2182
|
+
* Identifier of the event
|
|
2183
|
+
*/
|
|
2184
|
+
name: defines.events;
|
|
2185
|
+
player_index: uint;
|
|
2186
|
+
/**
|
|
2187
|
+
* Tick the event was generated.
|
|
2188
|
+
*/
|
|
2189
|
+
tick: uint;
|
|
1430
2190
|
}
|
|
1431
2191
|
/**
|
|
1432
2192
|
* Called when a player is kicked.
|
|
1433
2193
|
*/
|
|
1434
|
-
interface on_player_kicked
|
|
2194
|
+
interface on_player_kicked {
|
|
1435
2195
|
/**
|
|
1436
2196
|
* The player that did the kicking if any.
|
|
1437
2197
|
*/
|
|
1438
|
-
by_player?: uint
|
|
2198
|
+
by_player?: uint;
|
|
2199
|
+
/**
|
|
2200
|
+
* Identifier of the event
|
|
2201
|
+
*/
|
|
2202
|
+
name: defines.events;
|
|
1439
2203
|
/**
|
|
1440
2204
|
* The player kicked.
|
|
1441
2205
|
*/
|
|
1442
|
-
player_index: uint
|
|
2206
|
+
player_index: uint;
|
|
1443
2207
|
/**
|
|
1444
2208
|
* The reason given if any.
|
|
1445
2209
|
*/
|
|
1446
|
-
reason?: string
|
|
2210
|
+
reason?: string;
|
|
2211
|
+
/**
|
|
2212
|
+
* Tick the event was generated.
|
|
2213
|
+
*/
|
|
2214
|
+
tick: uint;
|
|
1447
2215
|
}
|
|
1448
2216
|
/**
|
|
1449
2217
|
* Called after a player leaves the game. This is not called when closing a save file in singleplayer, as the player doesn't actually leave the game, and the save is just on pause until they rejoin.
|
|
1450
2218
|
*/
|
|
1451
|
-
interface on_player_left_game
|
|
1452
|
-
|
|
1453
|
-
|
|
2219
|
+
interface on_player_left_game {
|
|
2220
|
+
/**
|
|
2221
|
+
* Identifier of the event
|
|
2222
|
+
*/
|
|
2223
|
+
name: defines.events;
|
|
2224
|
+
player_index: uint;
|
|
2225
|
+
reason: defines.disconnect_reason;
|
|
2226
|
+
/**
|
|
2227
|
+
* Tick the event was generated.
|
|
2228
|
+
*/
|
|
2229
|
+
tick: uint;
|
|
1454
2230
|
}
|
|
1455
2231
|
/**
|
|
1456
2232
|
* Called after a players main inventory changed in some way.
|
|
1457
2233
|
*/
|
|
1458
|
-
interface on_player_main_inventory_changed
|
|
1459
|
-
|
|
2234
|
+
interface on_player_main_inventory_changed {
|
|
2235
|
+
/**
|
|
2236
|
+
* Identifier of the event
|
|
2237
|
+
*/
|
|
2238
|
+
name: defines.events;
|
|
2239
|
+
player_index: uint;
|
|
2240
|
+
/**
|
|
2241
|
+
* Tick the event was generated.
|
|
2242
|
+
*/
|
|
2243
|
+
tick: uint;
|
|
1460
2244
|
}
|
|
1461
2245
|
/**
|
|
1462
2246
|
* Called after the results of an entity being mined are collected just before the entity is destroyed.
|
|
1463
|
-
*
|
|
2247
|
+
*
|
|
1464
2248
|
* After this event any items in the buffer will be transferred into the player as if they came from mining the entity.
|
|
1465
|
-
*
|
|
2249
|
+
*
|
|
1466
2250
|
* The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
|
|
1467
2251
|
*/
|
|
1468
|
-
interface on_player_mined_entity
|
|
2252
|
+
interface on_player_mined_entity {
|
|
1469
2253
|
/**
|
|
1470
2254
|
* The temporary inventory that holds the result of mining the entity.
|
|
1471
2255
|
*/
|
|
1472
|
-
buffer: LuaInventory
|
|
2256
|
+
buffer: LuaInventory;
|
|
2257
|
+
/**
|
|
2258
|
+
* The entity that has been mined.
|
|
2259
|
+
*/
|
|
2260
|
+
entity: LuaEntity;
|
|
2261
|
+
/**
|
|
2262
|
+
* Identifier of the event
|
|
2263
|
+
*/
|
|
2264
|
+
name: defines.events;
|
|
1473
2265
|
/**
|
|
1474
|
-
* The
|
|
2266
|
+
* The index of the player doing the mining.
|
|
1475
2267
|
*/
|
|
1476
|
-
|
|
2268
|
+
player_index: uint;
|
|
1477
2269
|
/**
|
|
1478
|
-
*
|
|
2270
|
+
* Tick the event was generated.
|
|
1479
2271
|
*/
|
|
1480
|
-
|
|
2272
|
+
tick: uint;
|
|
1481
2273
|
}
|
|
1482
2274
|
/**
|
|
1483
2275
|
* Called when the player mines something.
|
|
1484
2276
|
*/
|
|
1485
|
-
interface on_player_mined_item
|
|
2277
|
+
interface on_player_mined_item {
|
|
1486
2278
|
/**
|
|
1487
2279
|
* The item given to the player
|
|
1488
2280
|
*/
|
|
1489
|
-
item_stack: SimpleItemStack
|
|
1490
|
-
|
|
2281
|
+
item_stack: SimpleItemStack;
|
|
2282
|
+
/**
|
|
2283
|
+
* Identifier of the event
|
|
2284
|
+
*/
|
|
2285
|
+
name: defines.events;
|
|
2286
|
+
player_index: uint;
|
|
2287
|
+
/**
|
|
2288
|
+
* Tick the event was generated.
|
|
2289
|
+
*/
|
|
2290
|
+
tick: uint;
|
|
1491
2291
|
}
|
|
1492
2292
|
/**
|
|
1493
2293
|
* Called after a player mines tiles.
|
|
1494
2294
|
*/
|
|
1495
|
-
interface on_player_mined_tile
|
|
1496
|
-
|
|
2295
|
+
interface on_player_mined_tile {
|
|
2296
|
+
/**
|
|
2297
|
+
* Identifier of the event
|
|
2298
|
+
*/
|
|
2299
|
+
name: defines.events;
|
|
2300
|
+
player_index: uint;
|
|
1497
2301
|
/**
|
|
1498
2302
|
* The surface the tile(s) were mined from.
|
|
1499
2303
|
*/
|
|
1500
|
-
surface_index: uint
|
|
2304
|
+
surface_index: uint;
|
|
2305
|
+
/**
|
|
2306
|
+
* Tick the event was generated.
|
|
2307
|
+
*/
|
|
2308
|
+
tick: uint;
|
|
1501
2309
|
/**
|
|
1502
2310
|
* The position data.
|
|
1503
2311
|
*/
|
|
1504
|
-
tiles: OldTileAndPosition[]
|
|
2312
|
+
tiles: OldTileAndPosition[];
|
|
1505
2313
|
}
|
|
1506
2314
|
/**
|
|
1507
2315
|
* Called when a player is muted.
|
|
1508
2316
|
*/
|
|
1509
|
-
interface on_player_muted
|
|
2317
|
+
interface on_player_muted {
|
|
2318
|
+
/**
|
|
2319
|
+
* Identifier of the event
|
|
2320
|
+
*/
|
|
2321
|
+
name: defines.events;
|
|
1510
2322
|
/**
|
|
1511
2323
|
* The player.
|
|
1512
2324
|
*/
|
|
1513
|
-
player_index: uint
|
|
2325
|
+
player_index: uint;
|
|
2326
|
+
/**
|
|
2327
|
+
* Tick the event was generated.
|
|
2328
|
+
*/
|
|
2329
|
+
tick: uint;
|
|
1514
2330
|
}
|
|
1515
2331
|
/**
|
|
1516
2332
|
* Called when a player invokes the "smart pipette" over an entity.
|
|
1517
2333
|
*/
|
|
1518
|
-
interface on_player_pipette
|
|
2334
|
+
interface on_player_pipette {
|
|
1519
2335
|
/**
|
|
1520
2336
|
* The item put in the cursor
|
|
1521
2337
|
*/
|
|
1522
|
-
item: LuaItemPrototype
|
|
2338
|
+
item: LuaItemPrototype;
|
|
2339
|
+
/**
|
|
2340
|
+
* Identifier of the event
|
|
2341
|
+
*/
|
|
2342
|
+
name: defines.events;
|
|
1523
2343
|
/**
|
|
1524
2344
|
* The player
|
|
1525
2345
|
*/
|
|
1526
|
-
player_index: uint
|
|
2346
|
+
player_index: uint;
|
|
2347
|
+
/**
|
|
2348
|
+
* Tick the event was generated.
|
|
2349
|
+
*/
|
|
2350
|
+
tick: uint;
|
|
1527
2351
|
/**
|
|
1528
2352
|
* If cheat mode was used to give a free stack of the item.
|
|
1529
2353
|
*/
|
|
1530
|
-
used_cheat_mode: boolean
|
|
2354
|
+
used_cheat_mode: boolean;
|
|
1531
2355
|
}
|
|
1532
2356
|
/**
|
|
1533
2357
|
* Called after the player puts equipment in an equipment grid
|
|
1534
2358
|
*/
|
|
1535
|
-
interface on_player_placed_equipment
|
|
2359
|
+
interface on_player_placed_equipment {
|
|
1536
2360
|
/**
|
|
1537
2361
|
* The equipment put in the equipment grid.
|
|
1538
2362
|
*/
|
|
1539
|
-
equipment: LuaEquipment
|
|
2363
|
+
equipment: LuaEquipment;
|
|
1540
2364
|
/**
|
|
1541
2365
|
* The equipment grid the equipment was put in.
|
|
1542
2366
|
*/
|
|
1543
|
-
grid: LuaEquipmentGrid
|
|
1544
|
-
|
|
2367
|
+
grid: LuaEquipmentGrid;
|
|
2368
|
+
/**
|
|
2369
|
+
* Identifier of the event
|
|
2370
|
+
*/
|
|
2371
|
+
name: defines.events;
|
|
2372
|
+
player_index: uint;
|
|
2373
|
+
/**
|
|
2374
|
+
* Tick the event was generated.
|
|
2375
|
+
*/
|
|
2376
|
+
tick: uint;
|
|
1545
2377
|
}
|
|
1546
2378
|
/**
|
|
1547
2379
|
* Called when a player is promoted.
|
|
1548
2380
|
*/
|
|
1549
|
-
interface on_player_promoted
|
|
2381
|
+
interface on_player_promoted {
|
|
2382
|
+
/**
|
|
2383
|
+
* Identifier of the event
|
|
2384
|
+
*/
|
|
2385
|
+
name: defines.events;
|
|
1550
2386
|
/**
|
|
1551
2387
|
* The player.
|
|
1552
2388
|
*/
|
|
1553
|
-
player_index: uint
|
|
2389
|
+
player_index: uint;
|
|
2390
|
+
/**
|
|
2391
|
+
* Tick the event was generated.
|
|
2392
|
+
*/
|
|
2393
|
+
tick: uint;
|
|
1554
2394
|
}
|
|
1555
2395
|
/**
|
|
1556
2396
|
* Called when a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link leaving | runtime:on_player_left_game} the game, and instead behaves like the player never existed in the save file.
|
|
1557
2397
|
*/
|
|
1558
|
-
interface on_player_removed
|
|
2398
|
+
interface on_player_removed {
|
|
2399
|
+
/**
|
|
2400
|
+
* Identifier of the event
|
|
2401
|
+
*/
|
|
2402
|
+
name: defines.events;
|
|
1559
2403
|
/**
|
|
1560
2404
|
* The index of the removed player.
|
|
1561
2405
|
*/
|
|
1562
|
-
player_index: uint
|
|
2406
|
+
player_index: uint;
|
|
2407
|
+
/**
|
|
2408
|
+
* Tick the event was generated.
|
|
2409
|
+
*/
|
|
2410
|
+
tick: uint;
|
|
1563
2411
|
}
|
|
1564
2412
|
/**
|
|
1565
2413
|
* Called after the player removes equipment from an equipment grid
|
|
1566
2414
|
*/
|
|
1567
|
-
interface on_player_removed_equipment
|
|
2415
|
+
interface on_player_removed_equipment {
|
|
1568
2416
|
/**
|
|
1569
2417
|
* The count of equipment removed.
|
|
1570
2418
|
*/
|
|
1571
|
-
count: uint
|
|
2419
|
+
count: uint;
|
|
1572
2420
|
/**
|
|
1573
2421
|
* The equipment removed.
|
|
1574
2422
|
*/
|
|
1575
|
-
equipment: string
|
|
2423
|
+
equipment: string;
|
|
1576
2424
|
/**
|
|
1577
2425
|
* The equipment grid removed from.
|
|
1578
2426
|
*/
|
|
1579
|
-
grid: LuaEquipmentGrid
|
|
1580
|
-
|
|
2427
|
+
grid: LuaEquipmentGrid;
|
|
2428
|
+
/**
|
|
2429
|
+
* Identifier of the event
|
|
2430
|
+
*/
|
|
2431
|
+
name: defines.events;
|
|
2432
|
+
player_index: uint;
|
|
2433
|
+
/**
|
|
2434
|
+
* Tick the event was generated.
|
|
2435
|
+
*/
|
|
2436
|
+
tick: uint;
|
|
1581
2437
|
}
|
|
1582
2438
|
/**
|
|
1583
2439
|
* Called when a player repairs an entity.
|
|
1584
2440
|
*/
|
|
1585
|
-
interface on_player_repaired_entity
|
|
1586
|
-
entity: LuaEntity
|
|
1587
|
-
|
|
2441
|
+
interface on_player_repaired_entity {
|
|
2442
|
+
entity: LuaEntity;
|
|
2443
|
+
/**
|
|
2444
|
+
* Identifier of the event
|
|
2445
|
+
*/
|
|
2446
|
+
name: defines.events;
|
|
2447
|
+
player_index: uint;
|
|
2448
|
+
/**
|
|
2449
|
+
* Tick the event was generated.
|
|
2450
|
+
*/
|
|
2451
|
+
tick: uint;
|
|
1588
2452
|
}
|
|
1589
2453
|
/**
|
|
1590
2454
|
* Called after a player respawns.
|
|
1591
2455
|
*/
|
|
1592
|
-
interface on_player_respawned
|
|
1593
|
-
|
|
2456
|
+
interface on_player_respawned {
|
|
2457
|
+
/**
|
|
2458
|
+
* Identifier of the event
|
|
2459
|
+
*/
|
|
2460
|
+
name: defines.events;
|
|
2461
|
+
player_index: uint;
|
|
1594
2462
|
/**
|
|
1595
2463
|
* The player port used to respawn if one was used.
|
|
1596
2464
|
*/
|
|
1597
|
-
player_port?: LuaEntity
|
|
2465
|
+
player_port?: LuaEntity;
|
|
2466
|
+
/**
|
|
2467
|
+
* Tick the event was generated.
|
|
2468
|
+
*/
|
|
2469
|
+
tick: uint;
|
|
1598
2470
|
}
|
|
1599
2471
|
/**
|
|
1600
2472
|
* Called after a player reverse-selects an area with a selection-tool item.
|
|
1601
2473
|
*/
|
|
1602
|
-
interface on_player_reverse_selected_area
|
|
2474
|
+
interface on_player_reverse_selected_area {
|
|
1603
2475
|
/**
|
|
1604
2476
|
* The area selected.
|
|
1605
2477
|
*/
|
|
1606
|
-
area: BoundingBox
|
|
2478
|
+
area: BoundingBox;
|
|
1607
2479
|
/**
|
|
1608
2480
|
* The entities selected.
|
|
1609
2481
|
*/
|
|
1610
|
-
entities: LuaEntity[]
|
|
2482
|
+
entities: LuaEntity[];
|
|
1611
2483
|
/**
|
|
1612
2484
|
* The item used to select the area.
|
|
1613
2485
|
*/
|
|
1614
|
-
item: string
|
|
2486
|
+
item: string;
|
|
2487
|
+
/**
|
|
2488
|
+
* Identifier of the event
|
|
2489
|
+
*/
|
|
2490
|
+
name: defines.events;
|
|
1615
2491
|
/**
|
|
1616
2492
|
* The player doing the selection.
|
|
1617
2493
|
*/
|
|
1618
|
-
player_index: uint
|
|
2494
|
+
player_index: uint;
|
|
1619
2495
|
/**
|
|
1620
2496
|
* The surface selected.
|
|
1621
2497
|
*/
|
|
1622
|
-
surface: LuaSurface
|
|
2498
|
+
surface: LuaSurface;
|
|
2499
|
+
/**
|
|
2500
|
+
* Tick the event was generated.
|
|
2501
|
+
*/
|
|
2502
|
+
tick: uint;
|
|
1623
2503
|
/**
|
|
1624
2504
|
* The tiles selected.
|
|
1625
2505
|
*/
|
|
1626
|
-
tiles: LuaTile[]
|
|
2506
|
+
tiles: LuaTile[];
|
|
1627
2507
|
}
|
|
1628
2508
|
/**
|
|
1629
2509
|
* Called when the player rotates an entity. This event is only fired when the entity actually changes its orientation -- pressing the rotate key on an entity that can't be rotated won't fire this event.
|
|
1630
2510
|
*/
|
|
1631
|
-
interface on_player_rotated_entity
|
|
2511
|
+
interface on_player_rotated_entity {
|
|
1632
2512
|
/**
|
|
1633
2513
|
* The rotated entity.
|
|
1634
2514
|
*/
|
|
1635
|
-
entity: LuaEntity
|
|
1636
|
-
|
|
2515
|
+
entity: LuaEntity;
|
|
2516
|
+
/**
|
|
2517
|
+
* Identifier of the event
|
|
2518
|
+
*/
|
|
2519
|
+
name: defines.events;
|
|
2520
|
+
player_index: uint;
|
|
1637
2521
|
/**
|
|
1638
2522
|
* The previous direction
|
|
1639
2523
|
*/
|
|
1640
|
-
previous_direction: defines.direction
|
|
2524
|
+
previous_direction: defines.direction;
|
|
2525
|
+
/**
|
|
2526
|
+
* Tick the event was generated.
|
|
2527
|
+
*/
|
|
2528
|
+
tick: uint;
|
|
1641
2529
|
}
|
|
1642
2530
|
/**
|
|
1643
2531
|
* Called after a player selects an area with a selection-tool item.
|
|
1644
2532
|
*/
|
|
1645
|
-
interface on_player_selected_area
|
|
2533
|
+
interface on_player_selected_area {
|
|
1646
2534
|
/**
|
|
1647
2535
|
* The area selected.
|
|
1648
2536
|
*/
|
|
1649
|
-
area: BoundingBox
|
|
2537
|
+
area: BoundingBox;
|
|
1650
2538
|
/**
|
|
1651
2539
|
* The entities selected.
|
|
1652
2540
|
*/
|
|
1653
|
-
entities: LuaEntity[]
|
|
2541
|
+
entities: LuaEntity[];
|
|
1654
2542
|
/**
|
|
1655
2543
|
* The item used to select the area.
|
|
1656
2544
|
*/
|
|
1657
|
-
item: string
|
|
2545
|
+
item: string;
|
|
2546
|
+
/**
|
|
2547
|
+
* Identifier of the event
|
|
2548
|
+
*/
|
|
2549
|
+
name: defines.events;
|
|
1658
2550
|
/**
|
|
1659
2551
|
* The player doing the selection.
|
|
1660
2552
|
*/
|
|
1661
|
-
player_index: uint
|
|
2553
|
+
player_index: uint;
|
|
1662
2554
|
/**
|
|
1663
2555
|
* The surface selected.
|
|
1664
2556
|
*/
|
|
1665
|
-
surface: LuaSurface
|
|
2557
|
+
surface: LuaSurface;
|
|
2558
|
+
/**
|
|
2559
|
+
* Tick the event was generated.
|
|
2560
|
+
*/
|
|
2561
|
+
tick: uint;
|
|
1666
2562
|
/**
|
|
1667
2563
|
* The tiles selected.
|
|
1668
2564
|
*/
|
|
1669
|
-
tiles: LuaTile[]
|
|
2565
|
+
tiles: LuaTile[];
|
|
1670
2566
|
}
|
|
1671
2567
|
/**
|
|
1672
2568
|
* Called when a player sets a quickbar slot to anything (new value, or set to empty).
|
|
1673
2569
|
*/
|
|
1674
|
-
interface on_player_set_quick_bar_slot
|
|
1675
|
-
|
|
2570
|
+
interface on_player_set_quick_bar_slot {
|
|
2571
|
+
/**
|
|
2572
|
+
* Identifier of the event
|
|
2573
|
+
*/
|
|
2574
|
+
name: defines.events;
|
|
2575
|
+
player_index: uint;
|
|
2576
|
+
/**
|
|
2577
|
+
* Tick the event was generated.
|
|
2578
|
+
*/
|
|
2579
|
+
tick: uint;
|
|
1676
2580
|
}
|
|
1677
2581
|
/**
|
|
1678
2582
|
* Called when a player selects an area with a blueprint.
|
|
1679
2583
|
*/
|
|
1680
|
-
interface on_player_setup_blueprint
|
|
2584
|
+
interface on_player_setup_blueprint {
|
|
1681
2585
|
/**
|
|
1682
2586
|
* If normal selection or alt selection was used.
|
|
1683
2587
|
*/
|
|
1684
|
-
alt: boolean
|
|
2588
|
+
alt: boolean;
|
|
1685
2589
|
/**
|
|
1686
2590
|
* The area selected.
|
|
1687
2591
|
*/
|
|
1688
|
-
area: BoundingBox
|
|
2592
|
+
area: BoundingBox;
|
|
1689
2593
|
/**
|
|
1690
2594
|
* The item used to select the area.
|
|
1691
2595
|
*/
|
|
1692
|
-
item: string
|
|
2596
|
+
item: string;
|
|
1693
2597
|
/**
|
|
1694
2598
|
* The blueprint entity index to source entity mapping. Note: if any mod changes the blueprint this will be incorrect.
|
|
1695
2599
|
*/
|
|
1696
|
-
mapping: LuaLazyLoadedValue<
|
|
2600
|
+
mapping: LuaLazyLoadedValue<Record<uint, LuaEntity>>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Identifier of the event
|
|
2603
|
+
*/
|
|
2604
|
+
name: defines.events;
|
|
1697
2605
|
/**
|
|
1698
2606
|
* The player doing the selection.
|
|
1699
2607
|
*/
|
|
1700
|
-
player_index: uint
|
|
2608
|
+
player_index: uint;
|
|
1701
2609
|
/**
|
|
1702
2610
|
* The surface selected.
|
|
1703
2611
|
*/
|
|
1704
|
-
surface: LuaSurface
|
|
2612
|
+
surface: LuaSurface;
|
|
2613
|
+
/**
|
|
2614
|
+
* Tick the event was generated.
|
|
2615
|
+
*/
|
|
2616
|
+
tick: uint;
|
|
1705
2617
|
}
|
|
1706
2618
|
/**
|
|
1707
2619
|
* Called when a player toggles alt mode, also known as "show entity info".
|
|
1708
2620
|
*/
|
|
1709
|
-
interface on_player_toggled_alt_mode
|
|
2621
|
+
interface on_player_toggled_alt_mode {
|
|
1710
2622
|
/**
|
|
1711
2623
|
* The new alt mode value. This value is a shortcut for accessing {@link GameViewSettings::show_entity_info | runtime:GameViewSettings::show_entity_info} on the player.
|
|
1712
2624
|
*/
|
|
1713
|
-
alt_mode: boolean
|
|
1714
|
-
|
|
2625
|
+
alt_mode: boolean;
|
|
2626
|
+
/**
|
|
2627
|
+
* Identifier of the event
|
|
2628
|
+
*/
|
|
2629
|
+
name: defines.events;
|
|
2630
|
+
player_index: uint;
|
|
2631
|
+
/**
|
|
2632
|
+
* Tick the event was generated.
|
|
2633
|
+
*/
|
|
2634
|
+
tick: uint;
|
|
1715
2635
|
}
|
|
1716
2636
|
/**
|
|
1717
2637
|
* Called when a player toggles the map editor on or off.
|
|
1718
2638
|
*/
|
|
1719
|
-
interface on_player_toggled_map_editor
|
|
1720
|
-
|
|
2639
|
+
interface on_player_toggled_map_editor {
|
|
2640
|
+
/**
|
|
2641
|
+
* Identifier of the event
|
|
2642
|
+
*/
|
|
2643
|
+
name: defines.events;
|
|
2644
|
+
player_index: uint;
|
|
2645
|
+
/**
|
|
2646
|
+
* Tick the event was generated.
|
|
2647
|
+
*/
|
|
2648
|
+
tick: uint;
|
|
1721
2649
|
}
|
|
1722
2650
|
/**
|
|
1723
2651
|
* Called after a players trash inventory changed in some way.
|
|
1724
2652
|
*/
|
|
1725
|
-
interface on_player_trash_inventory_changed
|
|
1726
|
-
|
|
2653
|
+
interface on_player_trash_inventory_changed {
|
|
2654
|
+
/**
|
|
2655
|
+
* Identifier of the event
|
|
2656
|
+
*/
|
|
2657
|
+
name: defines.events;
|
|
2658
|
+
player_index: uint;
|
|
2659
|
+
/**
|
|
2660
|
+
* Tick the event was generated.
|
|
2661
|
+
*/
|
|
2662
|
+
tick: uint;
|
|
1727
2663
|
}
|
|
1728
2664
|
/**
|
|
1729
2665
|
* Called when a player is un-banned.
|
|
1730
2666
|
*/
|
|
1731
|
-
interface on_player_unbanned
|
|
2667
|
+
interface on_player_unbanned {
|
|
1732
2668
|
/**
|
|
1733
2669
|
* The player that did the un-banning if any.
|
|
1734
2670
|
*/
|
|
1735
|
-
by_player?: uint
|
|
2671
|
+
by_player?: uint;
|
|
2672
|
+
/**
|
|
2673
|
+
* Identifier of the event
|
|
2674
|
+
*/
|
|
2675
|
+
name: defines.events;
|
|
1736
2676
|
/**
|
|
1737
2677
|
* The player un-banned.
|
|
1738
2678
|
*/
|
|
1739
|
-
player_index?: uint
|
|
2679
|
+
player_index?: uint;
|
|
1740
2680
|
/**
|
|
1741
2681
|
* The player name un-banned.
|
|
1742
2682
|
*/
|
|
1743
|
-
player_name: string
|
|
2683
|
+
player_name: string;
|
|
1744
2684
|
/**
|
|
1745
2685
|
* The reason the player was banned if any.
|
|
1746
2686
|
*/
|
|
1747
|
-
reason?: string
|
|
2687
|
+
reason?: string;
|
|
2688
|
+
/**
|
|
2689
|
+
* Tick the event was generated.
|
|
2690
|
+
*/
|
|
2691
|
+
tick: uint;
|
|
1748
2692
|
}
|
|
1749
2693
|
/**
|
|
1750
2694
|
* Called when a player is unmuted.
|
|
1751
2695
|
*/
|
|
1752
|
-
interface on_player_unmuted
|
|
2696
|
+
interface on_player_unmuted {
|
|
2697
|
+
/**
|
|
2698
|
+
* Identifier of the event
|
|
2699
|
+
*/
|
|
2700
|
+
name: defines.events;
|
|
1753
2701
|
/**
|
|
1754
2702
|
* The player.
|
|
1755
2703
|
*/
|
|
1756
|
-
player_index: uint
|
|
2704
|
+
player_index: uint;
|
|
2705
|
+
/**
|
|
2706
|
+
* Tick the event was generated.
|
|
2707
|
+
*/
|
|
2708
|
+
tick: uint;
|
|
1757
2709
|
}
|
|
1758
2710
|
/**
|
|
1759
2711
|
* Called when a player uses a capsule that results in some game action.
|
|
1760
2712
|
*/
|
|
1761
|
-
interface on_player_used_capsule
|
|
2713
|
+
interface on_player_used_capsule {
|
|
1762
2714
|
/**
|
|
1763
2715
|
* The capsule item used.
|
|
1764
2716
|
*/
|
|
1765
|
-
item: LuaItemPrototype
|
|
2717
|
+
item: LuaItemPrototype;
|
|
2718
|
+
/**
|
|
2719
|
+
* Identifier of the event
|
|
2720
|
+
*/
|
|
2721
|
+
name: defines.events;
|
|
1766
2722
|
/**
|
|
1767
2723
|
* The player.
|
|
1768
2724
|
*/
|
|
1769
|
-
player_index: uint
|
|
2725
|
+
player_index: uint;
|
|
1770
2726
|
/**
|
|
1771
2727
|
* The position the capsule was used.
|
|
1772
2728
|
*/
|
|
1773
|
-
position: MapPosition
|
|
2729
|
+
position: MapPosition;
|
|
2730
|
+
/**
|
|
2731
|
+
* Tick the event was generated.
|
|
2732
|
+
*/
|
|
2733
|
+
tick: uint;
|
|
1774
2734
|
}
|
|
1775
2735
|
/**
|
|
1776
2736
|
* Called when a player uses spidertron remote to send a spidertron to a given position
|
|
1777
2737
|
*/
|
|
1778
|
-
interface on_player_used_spider_remote
|
|
2738
|
+
interface on_player_used_spider_remote {
|
|
2739
|
+
/**
|
|
2740
|
+
* Identifier of the event
|
|
2741
|
+
*/
|
|
2742
|
+
name: defines.events;
|
|
1779
2743
|
/**
|
|
1780
2744
|
* The player that used the remote.
|
|
1781
2745
|
*/
|
|
1782
|
-
player_index: uint
|
|
2746
|
+
player_index: uint;
|
|
1783
2747
|
/**
|
|
1784
2748
|
* Goal position to which spidertron was sent to.
|
|
1785
2749
|
*/
|
|
1786
|
-
position: MapPosition
|
|
2750
|
+
position: MapPosition;
|
|
1787
2751
|
/**
|
|
1788
2752
|
* If the use was successful. It may fail when spidertron has different driver or when player is on different surface.
|
|
1789
2753
|
*/
|
|
1790
|
-
success: boolean
|
|
2754
|
+
success: boolean;
|
|
2755
|
+
/**
|
|
2756
|
+
* Tick the event was generated.
|
|
2757
|
+
*/
|
|
2758
|
+
tick: uint;
|
|
1791
2759
|
/**
|
|
1792
2760
|
* Spider vehicle which was requested to move.
|
|
1793
2761
|
*/
|
|
1794
|
-
vehicle: LuaEntity
|
|
2762
|
+
vehicle: LuaEntity;
|
|
1795
2763
|
}
|
|
1796
2764
|
/**
|
|
1797
2765
|
* Called after an entity dies.
|
|
1798
2766
|
*/
|
|
1799
|
-
interface on_post_entity_died
|
|
2767
|
+
interface on_post_entity_died {
|
|
1800
2768
|
/**
|
|
1801
2769
|
* The corpses created by the entity dying if any.
|
|
1802
2770
|
*/
|
|
1803
|
-
corpses: LuaEntity[]
|
|
2771
|
+
corpses: LuaEntity[];
|
|
1804
2772
|
/**
|
|
1805
2773
|
* The damage type if any.
|
|
1806
2774
|
*/
|
|
1807
|
-
damage_type?: LuaDamagePrototype
|
|
2775
|
+
damage_type?: LuaDamagePrototype;
|
|
1808
2776
|
/**
|
|
1809
2777
|
* The force that did the killing if any.
|
|
1810
2778
|
*/
|
|
1811
|
-
force?: LuaForce
|
|
2779
|
+
force?: LuaForce;
|
|
1812
2780
|
/**
|
|
1813
2781
|
* The ghost created by the entity dying if any.
|
|
1814
2782
|
*/
|
|
1815
|
-
ghost?: LuaEntity
|
|
2783
|
+
ghost?: LuaEntity;
|
|
2784
|
+
/**
|
|
2785
|
+
* Identifier of the event
|
|
2786
|
+
*/
|
|
2787
|
+
name: defines.events;
|
|
1816
2788
|
/**
|
|
1817
2789
|
* Position where the entity died.
|
|
1818
2790
|
*/
|
|
1819
|
-
position: MapPosition
|
|
2791
|
+
position: MapPosition;
|
|
1820
2792
|
/**
|
|
1821
2793
|
* The entity prototype of the entity that died.
|
|
1822
2794
|
*/
|
|
1823
|
-
prototype: LuaEntityPrototype
|
|
2795
|
+
prototype: LuaEntityPrototype;
|
|
1824
2796
|
/**
|
|
1825
2797
|
* The surface the entity was on.
|
|
1826
2798
|
*/
|
|
1827
|
-
surface_index: uint
|
|
2799
|
+
surface_index: uint;
|
|
2800
|
+
/**
|
|
2801
|
+
* Tick the event was generated.
|
|
2802
|
+
*/
|
|
2803
|
+
tick: uint;
|
|
1828
2804
|
/**
|
|
1829
2805
|
* The unit number the entity had if any.
|
|
1830
2806
|
*/
|
|
1831
|
-
unit_number?: uint
|
|
2807
|
+
unit_number?: uint;
|
|
1832
2808
|
}
|
|
1833
2809
|
/**
|
|
1834
2810
|
* Called when players uses an item to build something. Called before {@link on_built_entity | runtime:on_built_entity}.
|
|
1835
2811
|
*/
|
|
1836
|
-
interface on_pre_build
|
|
2812
|
+
interface on_pre_build {
|
|
1837
2813
|
/**
|
|
1838
2814
|
* Whether the item was placed while moving.
|
|
1839
2815
|
*/
|
|
1840
|
-
created_by_moving: boolean
|
|
2816
|
+
created_by_moving: boolean;
|
|
1841
2817
|
/**
|
|
1842
2818
|
* The direction the item was facing when placed.
|
|
1843
2819
|
*/
|
|
1844
|
-
direction: defines.direction
|
|
2820
|
+
direction: defines.direction;
|
|
1845
2821
|
/**
|
|
1846
2822
|
* Whether the blueprint was flipped horizontally. `nil` if not built by a blueprint.
|
|
1847
2823
|
*/
|
|
1848
|
-
flip_horizontal: boolean
|
|
2824
|
+
flip_horizontal: boolean;
|
|
1849
2825
|
/**
|
|
1850
2826
|
* Whether the blueprint was flipped vertically. `nil` if not built by a blueprint.
|
|
1851
2827
|
*/
|
|
1852
|
-
flip_vertical: boolean
|
|
2828
|
+
flip_vertical: boolean;
|
|
2829
|
+
/**
|
|
2830
|
+
* Identifier of the event
|
|
2831
|
+
*/
|
|
2832
|
+
name: defines.events;
|
|
1853
2833
|
/**
|
|
1854
2834
|
* The player who did the placing.
|
|
1855
2835
|
*/
|
|
1856
|
-
player_index: uint
|
|
2836
|
+
player_index: uint;
|
|
1857
2837
|
/**
|
|
1858
2838
|
* Where the item was placed.
|
|
1859
2839
|
*/
|
|
1860
|
-
position: MapPosition
|
|
2840
|
+
position: MapPosition;
|
|
1861
2841
|
/**
|
|
1862
2842
|
* Item was placed using shift building.
|
|
1863
2843
|
*/
|
|
1864
|
-
shift_build: boolean
|
|
2844
|
+
shift_build: boolean;
|
|
2845
|
+
/**
|
|
2846
|
+
* Tick the event was generated.
|
|
2847
|
+
*/
|
|
2848
|
+
tick: uint;
|
|
1865
2849
|
}
|
|
1866
2850
|
/**
|
|
1867
2851
|
* Called before one or more chunks are deleted using {@link LuaSurface::delete_chunk | runtime:LuaSurface::delete_chunk}.
|
|
1868
2852
|
*/
|
|
1869
|
-
interface on_pre_chunk_deleted
|
|
2853
|
+
interface on_pre_chunk_deleted {
|
|
2854
|
+
/**
|
|
2855
|
+
* Identifier of the event
|
|
2856
|
+
*/
|
|
2857
|
+
name: defines.events;
|
|
1870
2858
|
/**
|
|
1871
2859
|
* The chunks to be deleted.
|
|
1872
2860
|
*/
|
|
1873
|
-
positions: ChunkPosition[]
|
|
1874
|
-
surface_index: uint
|
|
2861
|
+
positions: ChunkPosition[];
|
|
2862
|
+
surface_index: uint;
|
|
2863
|
+
/**
|
|
2864
|
+
* Tick the event was generated.
|
|
2865
|
+
*/
|
|
2866
|
+
tick: uint;
|
|
1875
2867
|
}
|
|
1876
2868
|
/**
|
|
1877
2869
|
* Called before entity copy-paste is done.
|
|
1878
2870
|
*/
|
|
1879
|
-
interface on_pre_entity_settings_pasted
|
|
2871
|
+
interface on_pre_entity_settings_pasted {
|
|
1880
2872
|
/**
|
|
1881
2873
|
* The destination entity settings will be copied to.
|
|
1882
2874
|
*/
|
|
1883
|
-
destination: LuaEntity
|
|
1884
|
-
|
|
2875
|
+
destination: LuaEntity;
|
|
2876
|
+
/**
|
|
2877
|
+
* Identifier of the event
|
|
2878
|
+
*/
|
|
2879
|
+
name: defines.events;
|
|
2880
|
+
player_index: uint;
|
|
1885
2881
|
/**
|
|
1886
2882
|
* The source entity settings will be copied from.
|
|
1887
2883
|
*/
|
|
1888
|
-
source: LuaEntity
|
|
2884
|
+
source: LuaEntity;
|
|
2885
|
+
/**
|
|
2886
|
+
* Tick the event was generated.
|
|
2887
|
+
*/
|
|
2888
|
+
tick: uint;
|
|
1889
2889
|
}
|
|
1890
2890
|
/**
|
|
1891
2891
|
* Called before a ghost entity is destroyed as a result of being marked for deconstruction.
|
|
1892
|
-
*
|
|
2892
|
+
*
|
|
1893
2893
|
* Also called for item request proxies before they are destroyed as a result of being marked for deconstruction.
|
|
1894
2894
|
*/
|
|
1895
|
-
interface on_pre_ghost_deconstructed
|
|
1896
|
-
ghost: LuaEntity
|
|
2895
|
+
interface on_pre_ghost_deconstructed {
|
|
2896
|
+
ghost: LuaEntity;
|
|
2897
|
+
/**
|
|
2898
|
+
* Identifier of the event
|
|
2899
|
+
*/
|
|
2900
|
+
name: defines.events;
|
|
1897
2901
|
/**
|
|
1898
2902
|
* The player that did the deconstruction if any.
|
|
1899
2903
|
*/
|
|
1900
|
-
player_index?: uint
|
|
2904
|
+
player_index?: uint;
|
|
2905
|
+
/**
|
|
2906
|
+
* Tick the event was generated.
|
|
2907
|
+
*/
|
|
2908
|
+
tick: uint;
|
|
1901
2909
|
}
|
|
1902
2910
|
/**
|
|
1903
2911
|
* Called before a ghost entity is upgraded.
|
|
1904
2912
|
*/
|
|
1905
|
-
interface on_pre_ghost_upgraded
|
|
1906
|
-
ghost: LuaEntity
|
|
2913
|
+
interface on_pre_ghost_upgraded {
|
|
2914
|
+
ghost: LuaEntity;
|
|
2915
|
+
/**
|
|
2916
|
+
* Identifier of the event
|
|
2917
|
+
*/
|
|
2918
|
+
name: defines.events;
|
|
1907
2919
|
/**
|
|
1908
2920
|
* The player that did the upgrade if any.
|
|
1909
2921
|
*/
|
|
1910
|
-
player_index?: uint
|
|
1911
|
-
target: LuaEntityPrototype
|
|
2922
|
+
player_index?: uint;
|
|
2923
|
+
target: LuaEntityPrototype;
|
|
2924
|
+
/**
|
|
2925
|
+
* Tick the event was generated.
|
|
2926
|
+
*/
|
|
2927
|
+
tick: uint;
|
|
1912
2928
|
}
|
|
1913
2929
|
/**
|
|
1914
2930
|
* Called directly before a permission group is deleted.
|
|
1915
2931
|
*/
|
|
1916
|
-
interface on_pre_permission_group_deleted
|
|
2932
|
+
interface on_pre_permission_group_deleted {
|
|
1917
2933
|
/**
|
|
1918
2934
|
* The group to be deleted.
|
|
1919
2935
|
*/
|
|
1920
|
-
group: LuaPermissionGroup
|
|
2936
|
+
group: LuaPermissionGroup;
|
|
2937
|
+
/**
|
|
2938
|
+
* Identifier of the event
|
|
2939
|
+
*/
|
|
2940
|
+
name: defines.events;
|
|
1921
2941
|
/**
|
|
1922
2942
|
* The player doing the deletion.
|
|
1923
2943
|
*/
|
|
1924
|
-
player_index: uint
|
|
2944
|
+
player_index: uint;
|
|
2945
|
+
/**
|
|
2946
|
+
* Tick the event was generated.
|
|
2947
|
+
*/
|
|
2948
|
+
tick: uint;
|
|
1925
2949
|
}
|
|
1926
2950
|
/**
|
|
1927
2951
|
* Called directly before a permission string is imported.
|
|
1928
2952
|
*/
|
|
1929
|
-
interface on_pre_permission_string_imported
|
|
2953
|
+
interface on_pre_permission_string_imported {
|
|
2954
|
+
/**
|
|
2955
|
+
* Identifier of the event
|
|
2956
|
+
*/
|
|
2957
|
+
name: defines.events;
|
|
1930
2958
|
/**
|
|
1931
2959
|
* The player importing the string.
|
|
1932
2960
|
*/
|
|
1933
|
-
player_index: uint
|
|
2961
|
+
player_index: uint;
|
|
2962
|
+
/**
|
|
2963
|
+
* Tick the event was generated.
|
|
2964
|
+
*/
|
|
2965
|
+
tick: uint;
|
|
1934
2966
|
}
|
|
1935
2967
|
/**
|
|
1936
2968
|
* Called when a player queues something to be crafted.
|
|
1937
2969
|
*/
|
|
1938
|
-
interface on_pre_player_crafted_item
|
|
2970
|
+
interface on_pre_player_crafted_item {
|
|
1939
2971
|
/**
|
|
1940
2972
|
* The items removed from the players inventory to do the crafting.
|
|
1941
2973
|
*/
|
|
1942
|
-
items: LuaInventory
|
|
2974
|
+
items: LuaInventory;
|
|
2975
|
+
/**
|
|
2976
|
+
* Identifier of the event
|
|
2977
|
+
*/
|
|
2978
|
+
name: defines.events;
|
|
1943
2979
|
/**
|
|
1944
2980
|
* The player doing the crafting.
|
|
1945
2981
|
*/
|
|
1946
|
-
player_index: uint
|
|
2982
|
+
player_index: uint;
|
|
1947
2983
|
/**
|
|
1948
2984
|
* The number of times the recipe is being queued.
|
|
1949
2985
|
*/
|
|
1950
|
-
queued_count: uint
|
|
2986
|
+
queued_count: uint;
|
|
1951
2987
|
/**
|
|
1952
2988
|
* The recipe being queued.
|
|
1953
2989
|
*/
|
|
1954
|
-
recipe: LuaRecipe
|
|
2990
|
+
recipe: LuaRecipe;
|
|
2991
|
+
/**
|
|
2992
|
+
* Tick the event was generated.
|
|
2993
|
+
*/
|
|
2994
|
+
tick: uint;
|
|
1955
2995
|
}
|
|
1956
2996
|
/**
|
|
1957
2997
|
* Called before a players dies.
|
|
1958
2998
|
*/
|
|
1959
|
-
interface on_pre_player_died
|
|
1960
|
-
cause?: LuaEntity
|
|
1961
|
-
|
|
2999
|
+
interface on_pre_player_died {
|
|
3000
|
+
cause?: LuaEntity;
|
|
3001
|
+
/**
|
|
3002
|
+
* Identifier of the event
|
|
3003
|
+
*/
|
|
3004
|
+
name: defines.events;
|
|
3005
|
+
player_index: uint;
|
|
3006
|
+
/**
|
|
3007
|
+
* Tick the event was generated.
|
|
3008
|
+
*/
|
|
3009
|
+
tick: uint;
|
|
1962
3010
|
}
|
|
1963
3011
|
/**
|
|
1964
3012
|
* Called before a player leaves the game.
|
|
1965
3013
|
*/
|
|
1966
|
-
interface on_pre_player_left_game
|
|
1967
|
-
|
|
1968
|
-
|
|
3014
|
+
interface on_pre_player_left_game {
|
|
3015
|
+
/**
|
|
3016
|
+
* Identifier of the event
|
|
3017
|
+
*/
|
|
3018
|
+
name: defines.events;
|
|
3019
|
+
player_index: uint;
|
|
3020
|
+
reason: defines.disconnect_reason;
|
|
3021
|
+
/**
|
|
3022
|
+
* Tick the event was generated.
|
|
3023
|
+
*/
|
|
3024
|
+
tick: uint;
|
|
1969
3025
|
}
|
|
1970
3026
|
/**
|
|
1971
3027
|
* Called when the player completes a mining action, but before the entity is potentially removed from the map. This is called even if the entity does not end up being removed.
|
|
1972
3028
|
*/
|
|
1973
|
-
interface on_pre_player_mined_item
|
|
3029
|
+
interface on_pre_player_mined_item {
|
|
1974
3030
|
/**
|
|
1975
3031
|
* The entity being mined
|
|
1976
3032
|
*/
|
|
1977
|
-
entity: LuaEntity
|
|
1978
|
-
|
|
3033
|
+
entity: LuaEntity;
|
|
3034
|
+
/**
|
|
3035
|
+
* Identifier of the event
|
|
3036
|
+
*/
|
|
3037
|
+
name: defines.events;
|
|
3038
|
+
player_index: uint;
|
|
3039
|
+
/**
|
|
3040
|
+
* Tick the event was generated.
|
|
3041
|
+
*/
|
|
3042
|
+
tick: uint;
|
|
1979
3043
|
}
|
|
1980
3044
|
/**
|
|
1981
3045
|
* Called before a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link leaving | runtime:on_player_left_game} the game, and instead behaves like the player never existed in the save file.
|
|
1982
3046
|
*/
|
|
1983
|
-
interface on_pre_player_removed
|
|
3047
|
+
interface on_pre_player_removed {
|
|
3048
|
+
/**
|
|
3049
|
+
* Identifier of the event
|
|
3050
|
+
*/
|
|
3051
|
+
name: defines.events;
|
|
1984
3052
|
/**
|
|
1985
3053
|
* The index of the removed player.
|
|
1986
3054
|
*/
|
|
1987
|
-
player_index: uint
|
|
3055
|
+
player_index: uint;
|
|
3056
|
+
/**
|
|
3057
|
+
* Tick the event was generated.
|
|
3058
|
+
*/
|
|
3059
|
+
tick: uint;
|
|
1988
3060
|
}
|
|
1989
3061
|
/**
|
|
1990
3062
|
* Called before a player toggles the map editor on or off.
|
|
1991
3063
|
*/
|
|
1992
|
-
interface on_pre_player_toggled_map_editor
|
|
1993
|
-
|
|
3064
|
+
interface on_pre_player_toggled_map_editor {
|
|
3065
|
+
/**
|
|
3066
|
+
* Identifier of the event
|
|
3067
|
+
*/
|
|
3068
|
+
name: defines.events;
|
|
3069
|
+
player_index: uint;
|
|
3070
|
+
/**
|
|
3071
|
+
* Tick the event was generated.
|
|
3072
|
+
*/
|
|
3073
|
+
tick: uint;
|
|
1994
3074
|
}
|
|
1995
3075
|
/**
|
|
1996
3076
|
* Called directly before a robot explodes cliffs.
|
|
1997
3077
|
*/
|
|
1998
|
-
interface on_pre_robot_exploded_cliff
|
|
1999
|
-
cliff: LuaEntity
|
|
3078
|
+
interface on_pre_robot_exploded_cliff {
|
|
3079
|
+
cliff: LuaEntity;
|
|
2000
3080
|
/**
|
|
2001
3081
|
* The cliff explosive used.
|
|
2002
3082
|
*/
|
|
2003
|
-
item: LuaItemPrototype
|
|
2004
|
-
|
|
3083
|
+
item: LuaItemPrototype;
|
|
3084
|
+
/**
|
|
3085
|
+
* Identifier of the event
|
|
3086
|
+
*/
|
|
3087
|
+
name: defines.events;
|
|
3088
|
+
robot: LuaEntity;
|
|
3089
|
+
/**
|
|
3090
|
+
* Tick the event was generated.
|
|
3091
|
+
*/
|
|
3092
|
+
tick: uint;
|
|
2005
3093
|
}
|
|
2006
3094
|
/**
|
|
2007
3095
|
* Called just before a script inventory is resized.
|
|
2008
3096
|
*/
|
|
2009
|
-
interface on_pre_script_inventory_resized
|
|
2010
|
-
inventory: LuaInventory
|
|
3097
|
+
interface on_pre_script_inventory_resized {
|
|
3098
|
+
inventory: LuaInventory;
|
|
2011
3099
|
/**
|
|
2012
3100
|
* The mod that did the resizing. This will be `"core"` if done by console command or scenario script.
|
|
2013
3101
|
*/
|
|
2014
|
-
mod: string
|
|
3102
|
+
mod: string;
|
|
3103
|
+
/**
|
|
3104
|
+
* Identifier of the event
|
|
3105
|
+
*/
|
|
3106
|
+
name: defines.events;
|
|
2015
3107
|
/**
|
|
2016
3108
|
* The new inventory size.
|
|
2017
3109
|
*/
|
|
2018
|
-
new_size: uint
|
|
3110
|
+
new_size: uint;
|
|
2019
3111
|
/**
|
|
2020
3112
|
* The old inventory size.
|
|
2021
3113
|
*/
|
|
2022
|
-
old_size: uint
|
|
3114
|
+
old_size: uint;
|
|
2023
3115
|
/**
|
|
2024
3116
|
* If done by console command; the player who ran the command.
|
|
2025
3117
|
*/
|
|
2026
|
-
player_index?: uint
|
|
3118
|
+
player_index?: uint;
|
|
3119
|
+
/**
|
|
3120
|
+
* Tick the event was generated.
|
|
3121
|
+
*/
|
|
3122
|
+
tick: uint;
|
|
2027
3123
|
}
|
|
2028
3124
|
/**
|
|
2029
3125
|
* Called just before a surface is cleared (all entities removed and all chunks deleted).
|
|
2030
3126
|
*/
|
|
2031
|
-
interface on_pre_surface_cleared
|
|
2032
|
-
|
|
3127
|
+
interface on_pre_surface_cleared {
|
|
3128
|
+
/**
|
|
3129
|
+
* Identifier of the event
|
|
3130
|
+
*/
|
|
3131
|
+
name: defines.events;
|
|
3132
|
+
surface_index: uint;
|
|
3133
|
+
/**
|
|
3134
|
+
* Tick the event was generated.
|
|
3135
|
+
*/
|
|
3136
|
+
tick: uint;
|
|
2033
3137
|
}
|
|
2034
3138
|
/**
|
|
2035
3139
|
* Called just before a surface is deleted.
|
|
2036
3140
|
*/
|
|
2037
|
-
interface on_pre_surface_deleted
|
|
2038
|
-
|
|
3141
|
+
interface on_pre_surface_deleted {
|
|
3142
|
+
/**
|
|
3143
|
+
* Identifier of the event
|
|
3144
|
+
*/
|
|
3145
|
+
name: defines.events;
|
|
3146
|
+
surface_index: uint;
|
|
3147
|
+
/**
|
|
3148
|
+
* Tick the event was generated.
|
|
3149
|
+
*/
|
|
3150
|
+
tick: uint;
|
|
2039
3151
|
}
|
|
2040
3152
|
/**
|
|
2041
3153
|
* Called when research is cancelled.
|
|
2042
3154
|
*/
|
|
2043
|
-
interface on_research_cancelled
|
|
3155
|
+
interface on_research_cancelled {
|
|
2044
3156
|
/**
|
|
2045
3157
|
* The force whose research was cancelled.
|
|
2046
3158
|
*/
|
|
2047
|
-
force: LuaForce
|
|
3159
|
+
force: LuaForce;
|
|
3160
|
+
/**
|
|
3161
|
+
* Identifier of the event
|
|
3162
|
+
*/
|
|
3163
|
+
name: defines.events;
|
|
2048
3164
|
/**
|
|
2049
3165
|
* A mapping of technology name to how many times it was cancelled.
|
|
2050
3166
|
*/
|
|
2051
|
-
research:
|
|
3167
|
+
research: Record<string, uint>;
|
|
3168
|
+
/**
|
|
3169
|
+
* Tick the event was generated.
|
|
3170
|
+
*/
|
|
3171
|
+
tick: uint;
|
|
2052
3172
|
}
|
|
2053
3173
|
/**
|
|
2054
3174
|
* Called when a research finishes.
|
|
2055
3175
|
*/
|
|
2056
|
-
interface on_research_finished
|
|
3176
|
+
interface on_research_finished {
|
|
2057
3177
|
/**
|
|
2058
3178
|
* If the technology was researched by script.
|
|
2059
3179
|
*/
|
|
2060
|
-
by_script: boolean
|
|
3180
|
+
by_script: boolean;
|
|
3181
|
+
/**
|
|
3182
|
+
* Identifier of the event
|
|
3183
|
+
*/
|
|
3184
|
+
name: defines.events;
|
|
2061
3185
|
/**
|
|
2062
3186
|
* The researched technology
|
|
2063
3187
|
*/
|
|
2064
|
-
research: LuaTechnology
|
|
3188
|
+
research: LuaTechnology;
|
|
3189
|
+
/**
|
|
3190
|
+
* Tick the event was generated.
|
|
3191
|
+
*/
|
|
3192
|
+
tick: uint;
|
|
2065
3193
|
}
|
|
2066
3194
|
/**
|
|
2067
3195
|
* Called when a research is reversed (unresearched).
|
|
2068
3196
|
*/
|
|
2069
|
-
interface on_research_reversed
|
|
3197
|
+
interface on_research_reversed {
|
|
2070
3198
|
/**
|
|
2071
3199
|
* If the technology was un-researched by script.
|
|
2072
3200
|
*/
|
|
2073
|
-
by_script: boolean
|
|
3201
|
+
by_script: boolean;
|
|
3202
|
+
/**
|
|
3203
|
+
* Identifier of the event
|
|
3204
|
+
*/
|
|
3205
|
+
name: defines.events;
|
|
2074
3206
|
/**
|
|
2075
3207
|
* The technology un-researched
|
|
2076
3208
|
*/
|
|
2077
|
-
research: LuaTechnology
|
|
3209
|
+
research: LuaTechnology;
|
|
3210
|
+
/**
|
|
3211
|
+
* Tick the event was generated.
|
|
3212
|
+
*/
|
|
3213
|
+
tick: uint;
|
|
2078
3214
|
}
|
|
2079
3215
|
/**
|
|
2080
3216
|
* Called when a technology research starts.
|
|
2081
3217
|
*/
|
|
2082
|
-
interface on_research_started
|
|
2083
|
-
last_research?: LuaTechnology
|
|
3218
|
+
interface on_research_started {
|
|
3219
|
+
last_research?: LuaTechnology;
|
|
3220
|
+
/**
|
|
3221
|
+
* Identifier of the event
|
|
3222
|
+
*/
|
|
3223
|
+
name: defines.events;
|
|
2084
3224
|
/**
|
|
2085
3225
|
* The technology being researched
|
|
2086
3226
|
*/
|
|
2087
|
-
research: LuaTechnology
|
|
3227
|
+
research: LuaTechnology;
|
|
3228
|
+
/**
|
|
3229
|
+
* Tick the event was generated.
|
|
3230
|
+
*/
|
|
3231
|
+
tick: uint;
|
|
2088
3232
|
}
|
|
2089
3233
|
/**
|
|
2090
3234
|
* Called when a resource entity reaches 0 or its minimum yield for infinite resources.
|
|
2091
3235
|
*/
|
|
2092
|
-
interface on_resource_depleted
|
|
2093
|
-
entity: LuaEntity
|
|
3236
|
+
interface on_resource_depleted {
|
|
3237
|
+
entity: LuaEntity;
|
|
3238
|
+
/**
|
|
3239
|
+
* Identifier of the event
|
|
3240
|
+
*/
|
|
3241
|
+
name: defines.events;
|
|
3242
|
+
/**
|
|
3243
|
+
* Tick the event was generated.
|
|
3244
|
+
*/
|
|
3245
|
+
tick: uint;
|
|
2094
3246
|
}
|
|
2095
3247
|
/**
|
|
2096
3248
|
* Called when a construction robot builds an entity.
|
|
2097
3249
|
*/
|
|
2098
|
-
interface on_robot_built_entity
|
|
3250
|
+
interface on_robot_built_entity {
|
|
2099
3251
|
/**
|
|
2100
3252
|
* The entity built.
|
|
2101
3253
|
*/
|
|
2102
|
-
created_entity: LuaEntity
|
|
3254
|
+
created_entity: LuaEntity;
|
|
3255
|
+
/**
|
|
3256
|
+
* Identifier of the event
|
|
3257
|
+
*/
|
|
3258
|
+
name: defines.events;
|
|
2103
3259
|
/**
|
|
2104
3260
|
* The robot that did the building.
|
|
2105
3261
|
*/
|
|
2106
|
-
robot: LuaEntity
|
|
3262
|
+
robot: LuaEntity;
|
|
2107
3263
|
/**
|
|
2108
3264
|
* The item used to do the building.
|
|
2109
3265
|
*/
|
|
2110
|
-
stack: LuaItemStack
|
|
3266
|
+
stack: LuaItemStack;
|
|
2111
3267
|
/**
|
|
2112
3268
|
* The tags associated with this entity if any.
|
|
2113
3269
|
*/
|
|
2114
|
-
tags?: Tags
|
|
3270
|
+
tags?: Tags;
|
|
3271
|
+
/**
|
|
3272
|
+
* Tick the event was generated.
|
|
3273
|
+
*/
|
|
3274
|
+
tick: uint;
|
|
2115
3275
|
}
|
|
2116
3276
|
/**
|
|
2117
3277
|
* Called after a robot builds tiles.
|
|
2118
3278
|
*/
|
|
2119
|
-
interface on_robot_built_tile
|
|
3279
|
+
interface on_robot_built_tile {
|
|
2120
3280
|
/**
|
|
2121
3281
|
* The item type used to build the tiles.
|
|
2122
3282
|
*/
|
|
2123
|
-
item: LuaItemPrototype
|
|
3283
|
+
item: LuaItemPrototype;
|
|
3284
|
+
/**
|
|
3285
|
+
* Identifier of the event
|
|
3286
|
+
*/
|
|
3287
|
+
name: defines.events;
|
|
2124
3288
|
/**
|
|
2125
3289
|
* The robot.
|
|
2126
3290
|
*/
|
|
2127
|
-
robot: LuaEntity
|
|
3291
|
+
robot: LuaEntity;
|
|
2128
3292
|
/**
|
|
2129
3293
|
* The stack used to build the tiles (may be empty if all of the items where used to build the tiles).
|
|
2130
3294
|
*/
|
|
2131
|
-
stack: LuaItemStack
|
|
3295
|
+
stack: LuaItemStack;
|
|
2132
3296
|
/**
|
|
2133
3297
|
* The surface the tile(s) are build on.
|
|
2134
3298
|
*/
|
|
2135
|
-
surface_index: uint
|
|
3299
|
+
surface_index: uint;
|
|
3300
|
+
/**
|
|
3301
|
+
* Tick the event was generated.
|
|
3302
|
+
*/
|
|
3303
|
+
tick: uint;
|
|
2136
3304
|
/**
|
|
2137
3305
|
* The tile prototype that was placed.
|
|
2138
3306
|
*/
|
|
2139
|
-
tile: LuaTilePrototype
|
|
3307
|
+
tile: LuaTilePrototype;
|
|
2140
3308
|
/**
|
|
2141
3309
|
* The position data.
|
|
2142
3310
|
*/
|
|
2143
|
-
tiles: OldTileAndPosition[]
|
|
3311
|
+
tiles: OldTileAndPosition[];
|
|
2144
3312
|
}
|
|
2145
3313
|
/**
|
|
2146
3314
|
* Called directly after a robot explodes cliffs.
|
|
2147
3315
|
*/
|
|
2148
|
-
interface on_robot_exploded_cliff
|
|
3316
|
+
interface on_robot_exploded_cliff {
|
|
2149
3317
|
/**
|
|
2150
3318
|
* The cliff explosive used.
|
|
2151
3319
|
*/
|
|
2152
|
-
item: LuaItemPrototype
|
|
2153
|
-
|
|
3320
|
+
item: LuaItemPrototype;
|
|
3321
|
+
/**
|
|
3322
|
+
* Identifier of the event
|
|
3323
|
+
*/
|
|
3324
|
+
name: defines.events;
|
|
3325
|
+
robot: LuaEntity;
|
|
3326
|
+
/**
|
|
3327
|
+
* Tick the event was generated.
|
|
3328
|
+
*/
|
|
3329
|
+
tick: uint;
|
|
2154
3330
|
}
|
|
2155
3331
|
/**
|
|
2156
3332
|
* Called when a robot mines an entity.
|
|
2157
3333
|
*/
|
|
2158
|
-
interface on_robot_mined
|
|
3334
|
+
interface on_robot_mined {
|
|
2159
3335
|
/**
|
|
2160
3336
|
* The entity the robot just picked up.
|
|
2161
3337
|
*/
|
|
2162
|
-
item_stack: SimpleItemStack
|
|
3338
|
+
item_stack: SimpleItemStack;
|
|
3339
|
+
/**
|
|
3340
|
+
* Identifier of the event
|
|
3341
|
+
*/
|
|
3342
|
+
name: defines.events;
|
|
2163
3343
|
/**
|
|
2164
3344
|
* The robot that did the mining.
|
|
2165
3345
|
*/
|
|
2166
|
-
robot: LuaEntity
|
|
3346
|
+
robot: LuaEntity;
|
|
3347
|
+
/**
|
|
3348
|
+
* Tick the event was generated.
|
|
3349
|
+
*/
|
|
3350
|
+
tick: uint;
|
|
2167
3351
|
}
|
|
2168
3352
|
/**
|
|
2169
3353
|
* Called after the results of an entity being mined are collected just before the entity is destroyed.
|
|
2170
|
-
*
|
|
3354
|
+
*
|
|
2171
3355
|
* After this event any items in the buffer will be transferred into the robot as if they came from mining the entity.
|
|
2172
|
-
*
|
|
3356
|
+
*
|
|
2173
3357
|
* The buffer inventory is special in that it's only valid during this event and has a dynamic size expanding as more items are transferred into it.
|
|
2174
3358
|
*/
|
|
2175
|
-
interface on_robot_mined_entity
|
|
3359
|
+
interface on_robot_mined_entity {
|
|
2176
3360
|
/**
|
|
2177
3361
|
* The temporary inventory that holds the result of mining the entity.
|
|
2178
3362
|
*/
|
|
2179
|
-
buffer: LuaInventory
|
|
3363
|
+
buffer: LuaInventory;
|
|
2180
3364
|
/**
|
|
2181
3365
|
* The entity that has been mined.
|
|
2182
3366
|
*/
|
|
2183
|
-
entity: LuaEntity
|
|
3367
|
+
entity: LuaEntity;
|
|
3368
|
+
/**
|
|
3369
|
+
* Identifier of the event
|
|
3370
|
+
*/
|
|
3371
|
+
name: defines.events;
|
|
2184
3372
|
/**
|
|
2185
3373
|
* The robot doing the mining.
|
|
2186
3374
|
*/
|
|
2187
|
-
robot: LuaEntity
|
|
3375
|
+
robot: LuaEntity;
|
|
3376
|
+
/**
|
|
3377
|
+
* Tick the event was generated.
|
|
3378
|
+
*/
|
|
3379
|
+
tick: uint;
|
|
2188
3380
|
}
|
|
2189
3381
|
/**
|
|
2190
3382
|
* Called after a robot mines tiles.
|
|
2191
3383
|
*/
|
|
2192
|
-
interface on_robot_mined_tile
|
|
3384
|
+
interface on_robot_mined_tile {
|
|
3385
|
+
/**
|
|
3386
|
+
* Identifier of the event
|
|
3387
|
+
*/
|
|
3388
|
+
name: defines.events;
|
|
2193
3389
|
/**
|
|
2194
3390
|
* The robot.
|
|
2195
3391
|
*/
|
|
2196
|
-
robot: LuaEntity
|
|
3392
|
+
robot: LuaEntity;
|
|
2197
3393
|
/**
|
|
2198
3394
|
* The surface the tile(s) were mined on.
|
|
2199
3395
|
*/
|
|
2200
|
-
surface_index: uint
|
|
3396
|
+
surface_index: uint;
|
|
3397
|
+
/**
|
|
3398
|
+
* Tick the event was generated.
|
|
3399
|
+
*/
|
|
3400
|
+
tick: uint;
|
|
2201
3401
|
/**
|
|
2202
3402
|
* The position data.
|
|
2203
3403
|
*/
|
|
2204
|
-
tiles: OldTileAndPosition[]
|
|
3404
|
+
tiles: OldTileAndPosition[];
|
|
2205
3405
|
}
|
|
2206
3406
|
/**
|
|
2207
3407
|
* Called before a robot mines an entity.
|
|
2208
3408
|
*/
|
|
2209
|
-
interface on_robot_pre_mined
|
|
3409
|
+
interface on_robot_pre_mined {
|
|
2210
3410
|
/**
|
|
2211
3411
|
* The entity which is about to be mined.
|
|
2212
3412
|
*/
|
|
2213
|
-
entity: LuaEntity
|
|
3413
|
+
entity: LuaEntity;
|
|
3414
|
+
/**
|
|
3415
|
+
* Identifier of the event
|
|
3416
|
+
*/
|
|
3417
|
+
name: defines.events;
|
|
2214
3418
|
/**
|
|
2215
3419
|
* The robot that's about to do the mining.
|
|
2216
3420
|
*/
|
|
2217
|
-
robot: LuaEntity
|
|
3421
|
+
robot: LuaEntity;
|
|
3422
|
+
/**
|
|
3423
|
+
* Tick the event was generated.
|
|
3424
|
+
*/
|
|
3425
|
+
tick: uint;
|
|
2218
3426
|
}
|
|
2219
3427
|
/**
|
|
2220
3428
|
* Called when a rocket silo is ordered to be launched.
|
|
2221
3429
|
*/
|
|
2222
|
-
interface on_rocket_launch_ordered
|
|
3430
|
+
interface on_rocket_launch_ordered {
|
|
3431
|
+
/**
|
|
3432
|
+
* Identifier of the event
|
|
3433
|
+
*/
|
|
3434
|
+
name: defines.events;
|
|
2223
3435
|
/**
|
|
2224
3436
|
* The player that is riding the rocket, if any.
|
|
2225
3437
|
*/
|
|
2226
|
-
player_index?: uint
|
|
2227
|
-
rocket: LuaEntity
|
|
2228
|
-
rocket_silo: LuaEntity
|
|
3438
|
+
player_index?: uint;
|
|
3439
|
+
rocket: LuaEntity;
|
|
3440
|
+
rocket_silo: LuaEntity;
|
|
3441
|
+
/**
|
|
3442
|
+
* Tick the event was generated.
|
|
3443
|
+
*/
|
|
3444
|
+
tick: uint;
|
|
2229
3445
|
}
|
|
2230
3446
|
/**
|
|
2231
3447
|
* Called when the rocket is launched.
|
|
2232
3448
|
*/
|
|
2233
|
-
interface on_rocket_launched
|
|
3449
|
+
interface on_rocket_launched {
|
|
3450
|
+
/**
|
|
3451
|
+
* Identifier of the event
|
|
3452
|
+
*/
|
|
3453
|
+
name: defines.events;
|
|
2234
3454
|
/**
|
|
2235
3455
|
* The player that is riding the rocket, if any.
|
|
2236
3456
|
*/
|
|
2237
|
-
player_index?: uint
|
|
2238
|
-
rocket: LuaEntity
|
|
2239
|
-
rocket_silo?: LuaEntity
|
|
3457
|
+
player_index?: uint;
|
|
3458
|
+
rocket: LuaEntity;
|
|
3459
|
+
rocket_silo?: LuaEntity;
|
|
3460
|
+
/**
|
|
3461
|
+
* Tick the event was generated.
|
|
3462
|
+
*/
|
|
3463
|
+
tick: uint;
|
|
2240
3464
|
}
|
|
2241
3465
|
/**
|
|
2242
3466
|
* Called when a runtime mod setting is changed by a player.
|
|
2243
3467
|
*/
|
|
2244
|
-
interface on_runtime_mod_setting_changed
|
|
3468
|
+
interface on_runtime_mod_setting_changed {
|
|
3469
|
+
/**
|
|
3470
|
+
* Identifier of the event
|
|
3471
|
+
*/
|
|
3472
|
+
name: defines.events;
|
|
2245
3473
|
/**
|
|
2246
3474
|
* If the `setting_type` is `"global"` and it was changed through the mod settings GUI, this is the index of the player that changed the global setting. If the `setting_type` is `"runtime-per-user"` and it changed a current setting of the player, this is the index of the player whose setting was changed. In all other cases, this is `nil`.
|
|
2247
3475
|
*/
|
|
2248
|
-
player_index?: uint
|
|
3476
|
+
player_index?: uint;
|
|
2249
3477
|
/**
|
|
2250
3478
|
* The prototype name of the setting that was changed.
|
|
2251
3479
|
*/
|
|
2252
|
-
setting: string
|
|
2253
|
-
setting_type: 'runtime-global' | 'runtime-per-user'
|
|
3480
|
+
setting: string;
|
|
3481
|
+
setting_type: 'runtime-global' | 'runtime-per-user';
|
|
3482
|
+
/**
|
|
3483
|
+
* Tick the event was generated.
|
|
3484
|
+
*/
|
|
3485
|
+
tick: uint;
|
|
2254
3486
|
}
|
|
2255
3487
|
/**
|
|
2256
3488
|
* Called just after a script inventory is resized.
|
|
2257
3489
|
*/
|
|
2258
|
-
interface on_script_inventory_resized
|
|
2259
|
-
inventory: LuaInventory
|
|
3490
|
+
interface on_script_inventory_resized {
|
|
3491
|
+
inventory: LuaInventory;
|
|
2260
3492
|
/**
|
|
2261
3493
|
* The mod that did the resizing. This will be `"core"` if done by console command or scenario script.
|
|
2262
3494
|
*/
|
|
2263
|
-
mod: string
|
|
3495
|
+
mod: string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Identifier of the event
|
|
3498
|
+
*/
|
|
3499
|
+
name: defines.events;
|
|
2264
3500
|
/**
|
|
2265
3501
|
* The new inventory size.
|
|
2266
3502
|
*/
|
|
2267
|
-
new_size: uint
|
|
3503
|
+
new_size: uint;
|
|
2268
3504
|
/**
|
|
2269
3505
|
* The old inventory size.
|
|
2270
3506
|
*/
|
|
2271
|
-
old_size: uint
|
|
3507
|
+
old_size: uint;
|
|
2272
3508
|
/**
|
|
2273
3509
|
* Any items which didn't fit into the new inventory size.
|
|
2274
3510
|
*/
|
|
2275
|
-
overflow_inventory: LuaInventory
|
|
3511
|
+
overflow_inventory: LuaInventory;
|
|
2276
3512
|
/**
|
|
2277
3513
|
* If done by console command; the player who ran the command.
|
|
2278
3514
|
*/
|
|
2279
|
-
player_index?: uint
|
|
3515
|
+
player_index?: uint;
|
|
3516
|
+
/**
|
|
3517
|
+
* Tick the event was generated.
|
|
3518
|
+
*/
|
|
3519
|
+
tick: uint;
|
|
2280
3520
|
}
|
|
2281
3521
|
/**
|
|
2282
3522
|
* Called when a {@link LuaSurface::request_path | runtime:LuaSurface::request_path} call completes.
|
|
2283
3523
|
*/
|
|
2284
|
-
interface on_script_path_request_finished
|
|
3524
|
+
interface on_script_path_request_finished {
|
|
2285
3525
|
/**
|
|
2286
3526
|
* Handle to associate the callback with a particular call to {@link LuaSurface::request_path | runtime:LuaSurface::request_path}.
|
|
2287
3527
|
*/
|
|
2288
|
-
id: uint
|
|
3528
|
+
id: uint;
|
|
3529
|
+
/**
|
|
3530
|
+
* Identifier of the event
|
|
3531
|
+
*/
|
|
3532
|
+
name: defines.events;
|
|
2289
3533
|
/**
|
|
2290
3534
|
* The actual path that the pathfinder has determined. `nil` if pathfinding failed.
|
|
2291
3535
|
*/
|
|
2292
|
-
path?: PathfinderWaypoint[]
|
|
3536
|
+
path?: PathfinderWaypoint[];
|
|
3537
|
+
/**
|
|
3538
|
+
* Tick the event was generated.
|
|
3539
|
+
*/
|
|
3540
|
+
tick: uint;
|
|
2293
3541
|
/**
|
|
2294
3542
|
* Indicates that the pathfinder failed because it is too busy, and that you can retry later.
|
|
2295
3543
|
*/
|
|
2296
|
-
try_again_later: boolean
|
|
3544
|
+
try_again_later: boolean;
|
|
2297
3545
|
}
|
|
2298
3546
|
/**
|
|
2299
3547
|
* Called when a script trigger effect is triggered.
|
|
2300
3548
|
*/
|
|
2301
|
-
interface on_script_trigger_effect
|
|
3549
|
+
interface on_script_trigger_effect {
|
|
2302
3550
|
/**
|
|
2303
3551
|
* The effect_id specified in the trigger effect.
|
|
2304
3552
|
*/
|
|
2305
|
-
effect_id: string
|
|
2306
|
-
|
|
2307
|
-
|
|
3553
|
+
effect_id: string;
|
|
3554
|
+
/**
|
|
3555
|
+
* Identifier of the event
|
|
3556
|
+
*/
|
|
3557
|
+
name: defines.events;
|
|
3558
|
+
source_entity?: LuaEntity;
|
|
3559
|
+
source_position?: MapPosition;
|
|
2308
3560
|
/**
|
|
2309
3561
|
* The surface the effect happened on.
|
|
2310
3562
|
*/
|
|
2311
|
-
surface_index: uint
|
|
2312
|
-
target_entity?: LuaEntity
|
|
2313
|
-
target_position?: MapPosition
|
|
3563
|
+
surface_index: uint;
|
|
3564
|
+
target_entity?: LuaEntity;
|
|
3565
|
+
target_position?: MapPosition;
|
|
3566
|
+
/**
|
|
3567
|
+
* Tick the event was generated.
|
|
3568
|
+
*/
|
|
3569
|
+
tick: uint;
|
|
2314
3570
|
}
|
|
2315
3571
|
/**
|
|
2316
3572
|
* Called when an entity of type `radar` finishes scanning a sector.
|
|
2317
3573
|
*/
|
|
2318
|
-
interface on_sector_scanned
|
|
3574
|
+
interface on_sector_scanned {
|
|
2319
3575
|
/**
|
|
2320
3576
|
* Area of the scanned chunk.
|
|
2321
3577
|
*/
|
|
2322
|
-
area: BoundingBox
|
|
3578
|
+
area: BoundingBox;
|
|
2323
3579
|
/**
|
|
2324
3580
|
* The chunk scanned.
|
|
2325
3581
|
*/
|
|
2326
|
-
chunk_position: ChunkPosition
|
|
3582
|
+
chunk_position: ChunkPosition;
|
|
3583
|
+
/**
|
|
3584
|
+
* Identifier of the event
|
|
3585
|
+
*/
|
|
3586
|
+
name: defines.events;
|
|
2327
3587
|
/**
|
|
2328
3588
|
* The radar that did the scanning.
|
|
2329
3589
|
*/
|
|
2330
|
-
radar: LuaEntity
|
|
3590
|
+
radar: LuaEntity;
|
|
3591
|
+
/**
|
|
3592
|
+
* Tick the event was generated.
|
|
3593
|
+
*/
|
|
3594
|
+
tick: uint;
|
|
2331
3595
|
}
|
|
2332
3596
|
/**
|
|
2333
3597
|
* Called after the selected entity changes for a given player.
|
|
2334
3598
|
*/
|
|
2335
|
-
interface on_selected_entity_changed
|
|
3599
|
+
interface on_selected_entity_changed {
|
|
2336
3600
|
/**
|
|
2337
3601
|
* The last selected entity if it still exists and there was one.
|
|
2338
3602
|
*/
|
|
2339
|
-
last_entity?: LuaEntity
|
|
3603
|
+
last_entity?: LuaEntity;
|
|
3604
|
+
/**
|
|
3605
|
+
* Identifier of the event
|
|
3606
|
+
*/
|
|
3607
|
+
name: defines.events;
|
|
2340
3608
|
/**
|
|
2341
3609
|
* The player whose selected entity changed.
|
|
2342
3610
|
*/
|
|
2343
|
-
player_index: uint
|
|
3611
|
+
player_index: uint;
|
|
3612
|
+
/**
|
|
3613
|
+
* Tick the event was generated.
|
|
3614
|
+
*/
|
|
3615
|
+
tick: uint;
|
|
2344
3616
|
}
|
|
2345
3617
|
/**
|
|
2346
3618
|
* Called when a spider finishes moving to its autopilot position.
|
|
2347
3619
|
*/
|
|
2348
|
-
interface on_spider_command_completed
|
|
3620
|
+
interface on_spider_command_completed {
|
|
3621
|
+
/**
|
|
3622
|
+
* Identifier of the event
|
|
3623
|
+
*/
|
|
3624
|
+
name: defines.events;
|
|
3625
|
+
/**
|
|
3626
|
+
* Tick the event was generated.
|
|
3627
|
+
*/
|
|
3628
|
+
tick: uint;
|
|
2349
3629
|
/**
|
|
2350
3630
|
* Spider vehicle which was requested to move.
|
|
2351
3631
|
*/
|
|
2352
|
-
vehicle: LuaEntity
|
|
3632
|
+
vehicle: LuaEntity;
|
|
2353
3633
|
}
|
|
2354
3634
|
/**
|
|
2355
3635
|
* Called when a translation request generated through {@link LuaPlayer::request_translation | runtime:LuaPlayer::request_translation} or {@link LuaPlayer::request_translations | runtime:LuaPlayer::request_translations} has been completed.
|
|
2356
3636
|
*/
|
|
2357
|
-
interface on_string_translated
|
|
3637
|
+
interface on_string_translated {
|
|
2358
3638
|
/**
|
|
2359
3639
|
* The unique id for this translation request.
|
|
2360
3640
|
*/
|
|
2361
|
-
id: uint
|
|
3641
|
+
id: uint;
|
|
2362
3642
|
/**
|
|
2363
3643
|
* The localised string being translated.
|
|
2364
3644
|
*/
|
|
2365
|
-
localised_string: LocalisedString
|
|
3645
|
+
localised_string: LocalisedString;
|
|
3646
|
+
/**
|
|
3647
|
+
* Identifier of the event
|
|
3648
|
+
*/
|
|
3649
|
+
name: defines.events;
|
|
2366
3650
|
/**
|
|
2367
3651
|
* The player whose locale was used for the translation.
|
|
2368
3652
|
*/
|
|
2369
|
-
player_index: uint
|
|
3653
|
+
player_index: uint;
|
|
2370
3654
|
/**
|
|
2371
3655
|
* The translated `localised_string`.
|
|
2372
3656
|
*/
|
|
2373
|
-
result: string
|
|
3657
|
+
result: string;
|
|
3658
|
+
/**
|
|
3659
|
+
* Tick the event was generated.
|
|
3660
|
+
*/
|
|
3661
|
+
tick: uint;
|
|
2374
3662
|
/**
|
|
2375
3663
|
* Whether the requested localised string was valid and could be translated.
|
|
2376
3664
|
*/
|
|
2377
|
-
translated: boolean
|
|
3665
|
+
translated: boolean;
|
|
2378
3666
|
}
|
|
2379
3667
|
/**
|
|
2380
3668
|
* Called just after a surface is cleared (all entities removed and all chunks deleted).
|
|
2381
3669
|
*/
|
|
2382
|
-
interface on_surface_cleared
|
|
2383
|
-
|
|
3670
|
+
interface on_surface_cleared {
|
|
3671
|
+
/**
|
|
3672
|
+
* Identifier of the event
|
|
3673
|
+
*/
|
|
3674
|
+
name: defines.events;
|
|
3675
|
+
surface_index: uint;
|
|
3676
|
+
/**
|
|
3677
|
+
* Tick the event was generated.
|
|
3678
|
+
*/
|
|
3679
|
+
tick: uint;
|
|
2384
3680
|
}
|
|
2385
3681
|
/**
|
|
2386
3682
|
* Called when a surface is created.
|
|
2387
|
-
*
|
|
3683
|
+
*
|
|
2388
3684
|
* This is not called when the default surface is created as it will always exist.
|
|
2389
3685
|
*/
|
|
2390
|
-
interface on_surface_created
|
|
2391
|
-
|
|
3686
|
+
interface on_surface_created {
|
|
3687
|
+
/**
|
|
3688
|
+
* Identifier of the event
|
|
3689
|
+
*/
|
|
3690
|
+
name: defines.events;
|
|
3691
|
+
surface_index: uint;
|
|
3692
|
+
/**
|
|
3693
|
+
* Tick the event was generated.
|
|
3694
|
+
*/
|
|
3695
|
+
tick: uint;
|
|
2392
3696
|
}
|
|
2393
3697
|
/**
|
|
2394
3698
|
* Called after a surface is deleted.
|
|
2395
3699
|
*/
|
|
2396
|
-
interface on_surface_deleted
|
|
2397
|
-
|
|
3700
|
+
interface on_surface_deleted {
|
|
3701
|
+
/**
|
|
3702
|
+
* Identifier of the event
|
|
3703
|
+
*/
|
|
3704
|
+
name: defines.events;
|
|
3705
|
+
surface_index: uint;
|
|
3706
|
+
/**
|
|
3707
|
+
* Tick the event was generated.
|
|
3708
|
+
*/
|
|
3709
|
+
tick: uint;
|
|
2398
3710
|
}
|
|
2399
3711
|
/**
|
|
2400
3712
|
* Called after a surface is imported via the map editor.
|
|
2401
3713
|
*/
|
|
2402
|
-
interface on_surface_imported
|
|
3714
|
+
interface on_surface_imported {
|
|
3715
|
+
/**
|
|
3716
|
+
* Identifier of the event
|
|
3717
|
+
*/
|
|
3718
|
+
name: defines.events;
|
|
2403
3719
|
/**
|
|
2404
3720
|
* The original surface name.
|
|
2405
3721
|
*/
|
|
2406
|
-
original_name: string
|
|
2407
|
-
surface_index: uint
|
|
3722
|
+
original_name: string;
|
|
3723
|
+
surface_index: uint;
|
|
3724
|
+
/**
|
|
3725
|
+
* Tick the event was generated.
|
|
3726
|
+
*/
|
|
3727
|
+
tick: uint;
|
|
2408
3728
|
}
|
|
2409
3729
|
/**
|
|
2410
3730
|
* Called when a surface is renamed.
|
|
2411
3731
|
*/
|
|
2412
|
-
interface on_surface_renamed
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
3732
|
+
interface on_surface_renamed {
|
|
3733
|
+
/**
|
|
3734
|
+
* Identifier of the event
|
|
3735
|
+
*/
|
|
3736
|
+
name: defines.events;
|
|
3737
|
+
new_name: string;
|
|
3738
|
+
old_name: string;
|
|
3739
|
+
surface_index: uint;
|
|
3740
|
+
/**
|
|
3741
|
+
* Tick the event was generated.
|
|
3742
|
+
*/
|
|
3743
|
+
tick: uint;
|
|
2416
3744
|
}
|
|
2417
3745
|
/**
|
|
2418
3746
|
* Called when {@link LuaForce::reset_technology_effects | runtime:LuaForce::reset_technology_effects} is finished.
|
|
2419
3747
|
*/
|
|
2420
|
-
interface on_technology_effects_reset
|
|
2421
|
-
force: LuaForce
|
|
3748
|
+
interface on_technology_effects_reset {
|
|
3749
|
+
force: LuaForce;
|
|
3750
|
+
/**
|
|
3751
|
+
* Identifier of the event
|
|
3752
|
+
*/
|
|
3753
|
+
name: defines.events;
|
|
3754
|
+
/**
|
|
3755
|
+
* Tick the event was generated.
|
|
3756
|
+
*/
|
|
3757
|
+
tick: uint;
|
|
2422
3758
|
}
|
|
2423
3759
|
/**
|
|
2424
3760
|
* It is fired once every tick. Since this event is fired every tick, its handler shouldn't include performance heavy code.
|
|
2425
3761
|
*/
|
|
2426
|
-
interface on_tick
|
|
3762
|
+
interface on_tick {
|
|
3763
|
+
/**
|
|
3764
|
+
* Identifier of the event
|
|
3765
|
+
*/
|
|
3766
|
+
name: defines.events;
|
|
3767
|
+
/**
|
|
3768
|
+
* Tick the event was generated.
|
|
3769
|
+
*/
|
|
3770
|
+
tick: uint;
|
|
2427
3771
|
}
|
|
2428
3772
|
/**
|
|
2429
3773
|
* Called when a train changes state (started to stopped and vice versa)
|
|
2430
3774
|
*/
|
|
2431
|
-
interface on_train_changed_state
|
|
2432
|
-
|
|
2433
|
-
|
|
3775
|
+
interface on_train_changed_state {
|
|
3776
|
+
/**
|
|
3777
|
+
* Identifier of the event
|
|
3778
|
+
*/
|
|
3779
|
+
name: defines.events;
|
|
3780
|
+
old_state: defines.train_state;
|
|
3781
|
+
/**
|
|
3782
|
+
* Tick the event was generated.
|
|
3783
|
+
*/
|
|
3784
|
+
tick: uint;
|
|
3785
|
+
train: LuaTrain;
|
|
2434
3786
|
}
|
|
2435
3787
|
/**
|
|
2436
3788
|
* Called when a new train is created either through disconnecting/connecting an existing one or building a new one.
|
|
2437
3789
|
*/
|
|
2438
|
-
interface on_train_created
|
|
3790
|
+
interface on_train_created {
|
|
3791
|
+
/**
|
|
3792
|
+
* Identifier of the event
|
|
3793
|
+
*/
|
|
3794
|
+
name: defines.events;
|
|
2439
3795
|
/**
|
|
2440
3796
|
* The first old train id when splitting/merging trains.
|
|
2441
3797
|
*/
|
|
2442
|
-
old_train_id_1?: uint
|
|
3798
|
+
old_train_id_1?: uint;
|
|
2443
3799
|
/**
|
|
2444
3800
|
* The second old train id when splitting/merging trains.
|
|
2445
3801
|
*/
|
|
2446
|
-
old_train_id_2?: uint
|
|
2447
|
-
|
|
3802
|
+
old_train_id_2?: uint;
|
|
3803
|
+
/**
|
|
3804
|
+
* Tick the event was generated.
|
|
3805
|
+
*/
|
|
3806
|
+
tick: uint;
|
|
3807
|
+
train: LuaTrain;
|
|
2448
3808
|
}
|
|
2449
3809
|
/**
|
|
2450
3810
|
* Called when a trains schedule is changed either by the player or through script.
|
|
2451
3811
|
*/
|
|
2452
|
-
interface on_train_schedule_changed
|
|
3812
|
+
interface on_train_schedule_changed {
|
|
3813
|
+
/**
|
|
3814
|
+
* Identifier of the event
|
|
3815
|
+
*/
|
|
3816
|
+
name: defines.events;
|
|
2453
3817
|
/**
|
|
2454
3818
|
* The player who made the change if any.
|
|
2455
3819
|
*/
|
|
2456
|
-
player_index?: uint
|
|
2457
|
-
|
|
3820
|
+
player_index?: uint;
|
|
3821
|
+
/**
|
|
3822
|
+
* Tick the event was generated.
|
|
3823
|
+
*/
|
|
3824
|
+
tick: uint;
|
|
3825
|
+
train: LuaTrain;
|
|
2458
3826
|
}
|
|
2459
3827
|
/**
|
|
2460
|
-
* Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined `trigger_created_entity=
|
|
3828
|
+
* Called when an entity with a trigger prototype (such as capsules) create an entity AND that trigger prototype defined `trigger_created_entity=true`.
|
|
2461
3829
|
*/
|
|
2462
|
-
interface on_trigger_created_entity
|
|
2463
|
-
entity: LuaEntity
|
|
2464
|
-
|
|
3830
|
+
interface on_trigger_created_entity {
|
|
3831
|
+
entity: LuaEntity;
|
|
3832
|
+
/**
|
|
3833
|
+
* Identifier of the event
|
|
3834
|
+
*/
|
|
3835
|
+
name: defines.events;
|
|
3836
|
+
source?: LuaEntity;
|
|
3837
|
+
/**
|
|
3838
|
+
* Tick the event was generated.
|
|
3839
|
+
*/
|
|
3840
|
+
tick: uint;
|
|
2465
3841
|
}
|
|
2466
3842
|
/**
|
|
2467
|
-
* Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined `trigger_fired_artillery=
|
|
3843
|
+
* Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined `trigger_fired_artillery=true`.
|
|
2468
3844
|
*/
|
|
2469
|
-
interface on_trigger_fired_artillery
|
|
2470
|
-
entity: LuaEntity
|
|
2471
|
-
|
|
3845
|
+
interface on_trigger_fired_artillery {
|
|
3846
|
+
entity: LuaEntity;
|
|
3847
|
+
/**
|
|
3848
|
+
* Identifier of the event
|
|
3849
|
+
*/
|
|
3850
|
+
name: defines.events;
|
|
3851
|
+
source?: LuaEntity;
|
|
3852
|
+
/**
|
|
3853
|
+
* Tick the event was generated.
|
|
3854
|
+
*/
|
|
3855
|
+
tick: uint;
|
|
2472
3856
|
}
|
|
2473
3857
|
/**
|
|
2474
3858
|
* Called when a unit is added to a unit group.
|
|
2475
3859
|
*/
|
|
2476
|
-
interface on_unit_added_to_group
|
|
2477
|
-
group: LuaUnitGroup
|
|
2478
|
-
|
|
3860
|
+
interface on_unit_added_to_group {
|
|
3861
|
+
group: LuaUnitGroup;
|
|
3862
|
+
/**
|
|
3863
|
+
* Identifier of the event
|
|
3864
|
+
*/
|
|
3865
|
+
name: defines.events;
|
|
3866
|
+
/**
|
|
3867
|
+
* Tick the event was generated.
|
|
3868
|
+
*/
|
|
3869
|
+
tick: uint;
|
|
3870
|
+
unit: LuaEntity;
|
|
2479
3871
|
}
|
|
2480
3872
|
/**
|
|
2481
3873
|
* Called when a new unit group is created, before any members are added to it.
|
|
2482
3874
|
*/
|
|
2483
|
-
interface on_unit_group_created
|
|
2484
|
-
group: LuaUnitGroup
|
|
3875
|
+
interface on_unit_group_created {
|
|
3876
|
+
group: LuaUnitGroup;
|
|
3877
|
+
/**
|
|
3878
|
+
* Identifier of the event
|
|
3879
|
+
*/
|
|
3880
|
+
name: defines.events;
|
|
3881
|
+
/**
|
|
3882
|
+
* Tick the event was generated.
|
|
3883
|
+
*/
|
|
3884
|
+
tick: uint;
|
|
2485
3885
|
}
|
|
2486
3886
|
/**
|
|
2487
3887
|
* Called when a unit group finishes gathering and starts executing its command.
|
|
2488
3888
|
*/
|
|
2489
|
-
interface on_unit_group_finished_gathering
|
|
2490
|
-
group: LuaUnitGroup
|
|
3889
|
+
interface on_unit_group_finished_gathering {
|
|
3890
|
+
group: LuaUnitGroup;
|
|
3891
|
+
/**
|
|
3892
|
+
* Identifier of the event
|
|
3893
|
+
*/
|
|
3894
|
+
name: defines.events;
|
|
3895
|
+
/**
|
|
3896
|
+
* Tick the event was generated.
|
|
3897
|
+
*/
|
|
3898
|
+
tick: uint;
|
|
2491
3899
|
}
|
|
2492
3900
|
/**
|
|
2493
3901
|
* Called when a unit is removed from a unit group.
|
|
2494
3902
|
*/
|
|
2495
|
-
interface on_unit_removed_from_group
|
|
2496
|
-
group: LuaUnitGroup
|
|
2497
|
-
|
|
3903
|
+
interface on_unit_removed_from_group {
|
|
3904
|
+
group: LuaUnitGroup;
|
|
3905
|
+
/**
|
|
3906
|
+
* Identifier of the event
|
|
3907
|
+
*/
|
|
3908
|
+
name: defines.events;
|
|
3909
|
+
/**
|
|
3910
|
+
* Tick the event was generated.
|
|
3911
|
+
*/
|
|
3912
|
+
tick: uint;
|
|
3913
|
+
unit: LuaEntity;
|
|
2498
3914
|
}
|
|
2499
3915
|
/**
|
|
2500
3916
|
* Called when a worker (construction or logistic) robot expires through a lack of energy.
|
|
2501
3917
|
*/
|
|
2502
|
-
interface on_worker_robot_expired
|
|
2503
|
-
|
|
3918
|
+
interface on_worker_robot_expired {
|
|
3919
|
+
/**
|
|
3920
|
+
* Identifier of the event
|
|
3921
|
+
*/
|
|
3922
|
+
name: defines.events;
|
|
3923
|
+
robot: LuaEntity;
|
|
3924
|
+
/**
|
|
3925
|
+
* Tick the event was generated.
|
|
3926
|
+
*/
|
|
3927
|
+
tick: uint;
|
|
2504
3928
|
}
|
|
2505
3929
|
/**
|
|
2506
3930
|
* A static event mods can use to tell other mods they built something by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_built | runtime:LuaBootstrap::raise_script_built}, or when `raise_built` is passed to {@link LuaSurface::create_entity | runtime:LuaSurface::create_entity}.
|
|
2507
3931
|
*/
|
|
2508
|
-
interface script_raised_built
|
|
3932
|
+
interface script_raised_built {
|
|
2509
3933
|
/**
|
|
2510
3934
|
* The entity that has been built.
|
|
2511
3935
|
*/
|
|
2512
|
-
entity: LuaEntity
|
|
3936
|
+
entity: LuaEntity;
|
|
3937
|
+
/**
|
|
3938
|
+
* Identifier of the event
|
|
3939
|
+
*/
|
|
3940
|
+
name: defines.events;
|
|
3941
|
+
/**
|
|
3942
|
+
* Tick the event was generated.
|
|
3943
|
+
*/
|
|
3944
|
+
tick: uint;
|
|
2513
3945
|
}
|
|
2514
3946
|
/**
|
|
2515
3947
|
* A static event mods can use to tell other mods they destroyed something by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_destroy | runtime:LuaBootstrap::raise_script_destroy}, or when `raise_destroy` is passed to {@link LuaEntity::destroy | runtime:LuaEntity::destroy}.
|
|
2516
3948
|
*/
|
|
2517
|
-
interface script_raised_destroy
|
|
3949
|
+
interface script_raised_destroy {
|
|
2518
3950
|
/**
|
|
2519
3951
|
* The entity that was destroyed.
|
|
2520
3952
|
*/
|
|
2521
|
-
entity: LuaEntity
|
|
3953
|
+
entity: LuaEntity;
|
|
3954
|
+
/**
|
|
3955
|
+
* Identifier of the event
|
|
3956
|
+
*/
|
|
3957
|
+
name: defines.events;
|
|
3958
|
+
/**
|
|
3959
|
+
* Tick the event was generated.
|
|
3960
|
+
*/
|
|
3961
|
+
tick: uint;
|
|
2522
3962
|
}
|
|
2523
3963
|
/**
|
|
2524
3964
|
* A static event mods can use to tell other mods they revived something by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_revive | runtime:LuaBootstrap::raise_script_revive}, or when `raise_revive` is passed to {@link LuaEntity::revive | runtime:LuaEntity::revive}.
|
|
2525
3965
|
*/
|
|
2526
|
-
interface script_raised_revive
|
|
3966
|
+
interface script_raised_revive {
|
|
2527
3967
|
/**
|
|
2528
3968
|
* The entity that was revived.
|
|
2529
3969
|
*/
|
|
2530
|
-
entity: LuaEntity
|
|
3970
|
+
entity: LuaEntity;
|
|
3971
|
+
/**
|
|
3972
|
+
* Identifier of the event
|
|
3973
|
+
*/
|
|
3974
|
+
name: defines.events;
|
|
2531
3975
|
/**
|
|
2532
3976
|
* The tags associated with this entity, if any.
|
|
2533
3977
|
*/
|
|
2534
|
-
tags?: Tags
|
|
3978
|
+
tags?: Tags;
|
|
3979
|
+
/**
|
|
3980
|
+
* Tick the event was generated.
|
|
3981
|
+
*/
|
|
3982
|
+
tick: uint;
|
|
2535
3983
|
}
|
|
2536
3984
|
/**
|
|
2537
3985
|
* A static event mods can use to tell other mods they changed tiles on a surface by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_set_tiles | runtime:LuaBootstrap::raise_script_set_tiles}, or when `raise_event` is passed to {@link LuaSurface::set_tiles | runtime:LuaSurface::set_tiles}.
|
|
2538
3986
|
*/
|
|
2539
|
-
interface script_raised_set_tiles
|
|
3987
|
+
interface script_raised_set_tiles {
|
|
3988
|
+
/**
|
|
3989
|
+
* Identifier of the event
|
|
3990
|
+
*/
|
|
3991
|
+
name: defines.events;
|
|
2540
3992
|
/**
|
|
2541
3993
|
* The surface whose tiles were changed.
|
|
2542
3994
|
*/
|
|
2543
|
-
surface_index: uint
|
|
3995
|
+
surface_index: uint;
|
|
3996
|
+
/**
|
|
3997
|
+
* Tick the event was generated.
|
|
3998
|
+
*/
|
|
3999
|
+
tick: uint;
|
|
2544
4000
|
/**
|
|
2545
4001
|
* The tiles that were changed.
|
|
2546
4002
|
*/
|
|
2547
|
-
tiles: Tile[]
|
|
4003
|
+
tiles: Tile[];
|
|
2548
4004
|
}
|
|
2549
4005
|
/**
|
|
2550
4006
|
* A static event mods can use to tell other mods they teleported something by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_teleported | runtime:LuaBootstrap::raise_script_teleported}, or when `raise_teleported` is passed to {@link LuaControl::teleport | runtime:LuaControl::teleport}.
|
|
2551
4007
|
*/
|
|
2552
|
-
interface script_raised_teleported
|
|
4008
|
+
interface script_raised_teleported {
|
|
2553
4009
|
/**
|
|
2554
4010
|
* The entity that was teleported.
|
|
2555
4011
|
*/
|
|
2556
|
-
entity: LuaEntity
|
|
4012
|
+
entity: LuaEntity;
|
|
4013
|
+
/**
|
|
4014
|
+
* Identifier of the event
|
|
4015
|
+
*/
|
|
4016
|
+
name: defines.events;
|
|
2557
4017
|
/**
|
|
2558
4018
|
* The entity's position before the teleportation.
|
|
2559
4019
|
*/
|
|
2560
|
-
old_position: MapPosition
|
|
4020
|
+
old_position: MapPosition;
|
|
2561
4021
|
/**
|
|
2562
4022
|
* The entity's surface before the teleportation.
|
|
2563
4023
|
*/
|
|
2564
|
-
old_surface_index: uint8
|
|
4024
|
+
old_surface_index: uint8;
|
|
4025
|
+
/**
|
|
4026
|
+
* Tick the event was generated.
|
|
4027
|
+
*/
|
|
4028
|
+
tick: uint;
|
|
2565
4029
|
}
|
|
2566
4030
|
|
|
2567
4031
|
}
|