factorio-types 1.2.58 → 1.2.59

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/dist/classes.d.ts CHANGED
@@ -2,12 +2,12 @@
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 2.0.77
5
+ // Factorio version 2.1.7
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
9
9
  /**
10
- * Collection of settings for overriding default ai behavior.
10
+ * Collection of settings for overriding default AI behavior.
11
11
  */
12
12
  interface LuaAISettings {
13
13
  /**
@@ -162,10 +162,14 @@ interface LuaActiveTriggerPrototype extends LuaPrototypeBase {
162
162
  * Control behavior for agricultural tower
163
163
  */
164
164
  interface LuaAgriculturalTowerControlBehavior extends LuaGenericOnOffControlBehavior {
165
+ enable_harvesting_condition: boolean;
166
+ enable_planting_condition: boolean;
167
+ harvesting_condition: CircuitConditionDefinition;
165
168
  /**
166
169
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
167
170
  */
168
171
  readonly object_name: string;
172
+ planting_condition: CircuitConditionDefinition;
169
173
  /**
170
174
  * `true` if the agricultural tower reads seeds and harvested plants.
171
175
  */
@@ -270,16 +274,14 @@ interface LuaAssemblingMachineControlBehavior extends LuaGenericOnOffControlBeha
270
274
  circuit_recipe_finished_signal?: SignalID;
271
275
  /**
272
276
  * `true` if the assembling machine sets its recipe from the circuit network.
277
+ *
278
+ * See {@link Circuit Recipe Selection | auxiliary:circuit-recipe-selection} for how that recipe is chosen.
273
279
  */
274
280
  circuit_set_recipe: boolean;
275
281
  /**
276
282
  * The signal sent when the assembling machine is working.
277
283
  */
278
284
  circuit_working_signal?: SignalID;
279
- /**
280
- * `true` if the read contents should include fuel (content of energy source)
281
- */
282
- include_fuel: boolean;
283
285
  /**
284
286
  * `true` if the read contents should include items in crafting.
285
287
  */
@@ -288,6 +290,10 @@ interface LuaAssemblingMachineControlBehavior extends LuaGenericOnOffControlBeha
288
290
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
289
291
  */
290
292
  readonly object_name: string;
293
+ /**
294
+ * `true` if the fuel (content of energy source) should be read.
295
+ */
296
+ read_fuel: boolean;
291
297
  /**
292
298
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
293
299
  */
@@ -358,6 +364,23 @@ interface LuaAutoplaceControlPrototype extends LuaPrototypeBase {
358
364
  */
359
365
  readonly valid: boolean;
360
366
  }
367
+ /**
368
+ * Control behavior for boiler.
369
+ */
370
+ interface LuaBoilerControlBehavior extends LuaGenericOnOffControlBehavior {
371
+ /**
372
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
373
+ */
374
+ readonly object_name: string;
375
+ /**
376
+ * `true` if the content of energy source is being read
377
+ */
378
+ read_fuel: boolean;
379
+ /**
380
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
381
+ */
382
+ readonly valid: boolean;
383
+ }
361
384
  /**
362
385
  * Entry point for registering event handlers. It is accessible through the global object named `script`.
363
386
  */
@@ -387,12 +410,16 @@ interface LuaBootstrap {
387
410
  * Gets the mod event order as a string.
388
411
  */
389
412
  get_event_order(this: void): string;
413
+ /**
414
+ * Creates new empty instance of LuaNotificationQueue
415
+ */
416
+ new_notification_queue(this: void): LuaNotificationQueue;
390
417
  /**
391
418
  * Register a function to be run when mod configuration changes.
392
419
  *
393
- * This is called when the game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, when any prototypes have been added or removed, or when a migration was applied. It allows the mod to make any changes it deems appropriate to both the data structures in its {@link storage | runtime:storage} table or to the game state through {@link LuaGameScript | runtime:LuaGameScript}.
420
+ * This is called when the game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, when any prototypes have been added or removed, or when a migration was applied. It allows the mod to make any changes it deems appropriate to both the data structures in its {@link storage | auxiliary:storage} table or to the game state through {@link LuaGameScript | runtime:LuaGameScript}.
394
421
  *
395
- * For more context, refer to the {@link Data Lifecycle | runtime:data-lifecycle} page.
422
+ * For more context, refer to the {@link Data Lifecycle | auxiliary:data-lifecycle} page.
396
423
  * @param handler The handler for this event. Passing `nil` will unregister it.
397
424
  */
398
425
  on_configuration_changed(this: void, handler: ((this: void, arg0: ConfigurationChangedData) => any) | nil): void;
@@ -483,6 +510,24 @@ interface LuaBootstrap {
483
510
  script.on_event(defines.events.on_built_entity,
484
511
  function(event) game.print("Gotta go fast!") end,
485
512
  {{filter = "name", name = "fast-inserter"}})
513
+ ```
514
+ */
515
+ on_event(this: void, event: defines.events.on_blueprint_settings_pasted, handler: ((this: void, arg0: runtime.on_blueprint_settings_pasted) => any) | nil, filters?: EventFilter): void;
516
+ /**
517
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
518
+ * @param event The event(s) or custom-input to invoke the handler on.
519
+ * @param handler The handler for this event. Passing `nil` will unregister it.
520
+ * @param filters The filters for this event. Can only be used when registering for individual events.
521
+ * @example ```
522
+ -- Register for the on_tick event to print the current tick to console each tick
523
+ script.on_event(defines.events.on_tick,
524
+ function(event) game.print(event.tick) end)
525
+ ```
526
+ * @example ```
527
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
528
+ script.on_event(defines.events.on_built_entity,
529
+ function(event) game.print("Gotta go fast!") end,
530
+ {{filter = "name", name = "fast-inserter"}})
486
531
  ```
487
532
  */
488
533
  on_event(this: void, event: defines.events.on_brush_cloned, handler: ((this: void, arg0: runtime.on_brush_cloned) => any) | nil, filters?: EventFilter): void;
@@ -1311,6 +1356,24 @@ interface LuaBootstrap {
1311
1356
  script.on_event(defines.events.on_built_entity,
1312
1357
  function(event) game.print("Gotta go fast!") end,
1313
1358
  {{filter = "name", name = "fast-inserter"}})
1359
+ ```
1360
+ */
1361
+ on_event(this: void, event: defines.events.on_gui_inventory_action, handler: ((this: void, arg0: runtime.on_gui_inventory_action) => any) | nil, filters?: EventFilter): void;
1362
+ /**
1363
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
1364
+ * @param event The event(s) or custom-input to invoke the handler on.
1365
+ * @param handler The handler for this event. Passing `nil` will unregister it.
1366
+ * @param filters The filters for this event. Can only be used when registering for individual events.
1367
+ * @example ```
1368
+ -- Register for the on_tick event to print the current tick to console each tick
1369
+ script.on_event(defines.events.on_tick,
1370
+ function(event) game.print(event.tick) end)
1371
+ ```
1372
+ * @example ```
1373
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
1374
+ script.on_event(defines.events.on_built_entity,
1375
+ function(event) game.print("Gotta go fast!") end,
1376
+ {{filter = "name", name = "fast-inserter"}})
1314
1377
  ```
1315
1378
  */
1316
1379
  on_event(this: void, event: defines.events.on_gui_leave, handler: ((this: void, arg0: runtime.on_gui_leave) => any) | nil, filters?: EventFilter): void;
@@ -1923,6 +1986,24 @@ interface LuaBootstrap {
1923
1986
  script.on_event(defines.events.on_built_entity,
1924
1987
  function(event) game.print("Gotta go fast!") end,
1925
1988
  {{filter = "name", name = "fast-inserter"}})
1989
+ ```
1990
+ */
1991
+ on_event(this: void, event: defines.events.on_player_color_changed, handler: ((this: void, arg0: runtime.on_player_color_changed) => any) | nil, filters?: EventFilter): void;
1992
+ /**
1993
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
1994
+ * @param event The event(s) or custom-input to invoke the handler on.
1995
+ * @param handler The handler for this event. Passing `nil` will unregister it.
1996
+ * @param filters The filters for this event. Can only be used when registering for individual events.
1997
+ * @example ```
1998
+ -- Register for the on_tick event to print the current tick to console each tick
1999
+ script.on_event(defines.events.on_tick,
2000
+ function(event) game.print(event.tick) end)
2001
+ ```
2002
+ * @example ```
2003
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
2004
+ script.on_event(defines.events.on_built_entity,
2005
+ function(event) game.print("Gotta go fast!") end,
2006
+ {{filter = "name", name = "fast-inserter"}})
1926
2007
  ```
1927
2008
  */
1928
2009
  on_event(this: void, event: defines.events.on_player_configured_blueprint, handler: ((this: void, arg0: runtime.on_player_configured_blueprint) => any) | nil, filters?: EventFilter): void;
@@ -2409,6 +2490,24 @@ interface LuaBootstrap {
2409
2490
  script.on_event(defines.events.on_built_entity,
2410
2491
  function(event) game.print("Gotta go fast!") end,
2411
2492
  {{filter = "name", name = "fast-inserter"}})
2493
+ ```
2494
+ */
2495
+ on_event(this: void, event: defines.events.on_player_music_changed, handler: ((this: void, arg0: runtime.on_player_music_changed) => any) | nil, filters?: EventFilter): void;
2496
+ /**
2497
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
2498
+ * @param event The event(s) or custom-input to invoke the handler on.
2499
+ * @param handler The handler for this event. Passing `nil` will unregister it.
2500
+ * @param filters The filters for this event. Can only be used when registering for individual events.
2501
+ * @example ```
2502
+ -- Register for the on_tick event to print the current tick to console each tick
2503
+ script.on_event(defines.events.on_tick,
2504
+ function(event) game.print(event.tick) end)
2505
+ ```
2506
+ * @example ```
2507
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
2508
+ script.on_event(defines.events.on_built_entity,
2509
+ function(event) game.print("Gotta go fast!") end,
2510
+ {{filter = "name", name = "fast-inserter"}})
2412
2511
  ```
2413
2512
  */
2414
2513
  on_event(this: void, event: defines.events.on_player_muted, handler: ((this: void, arg0: runtime.on_player_muted) => any) | nil, filters?: EventFilter): void;
@@ -4341,9 +4440,9 @@ interface LuaBootstrap {
4341
4440
  /**
4342
4441
  * Register a function to be run on mod initialization.
4343
4442
  *
4344
- * This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript | runtime:LuaGameScript} and the {@link storage | runtime:storage} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
4443
+ * This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript | runtime:LuaGameScript} and the {@link storage | auxiliary:storage} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
4345
4444
  *
4346
- * For more context, refer to the {@link Data Lifecycle | runtime:data-lifecycle} page.
4445
+ * For more context, refer to the {@link Data Lifecycle | auxiliary:data-lifecycle} page.
4347
4446
  * @param handler The handler for this event. Passing `nil` will unregister it.
4348
4447
  * @example ```
4349
4448
  -- Initialize a `players` table in `storage` for later use
@@ -4356,7 +4455,7 @@ interface LuaBootstrap {
4356
4455
  /**
4357
4456
  * Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session.
4358
4457
  *
4359
- * It gives the mod the opportunity to rectify potential differences in local state introduced by the save/load cycle. Doing anything other than the following three will lead to desyncs, breaking multiplayer and replay functionality. Access to {@link LuaGameScript | runtime:LuaGameScript} is not available. The {@link storage | runtime:storage} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
4458
+ * It gives the mod the opportunity to rectify potential differences in local state introduced by the save/load cycle. Doing anything other than the following three will lead to desyncs, breaking multiplayer and replay functionality. Access to {@link LuaGameScript | runtime:LuaGameScript} is not available. The {@link storage | auxiliary:storage} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
4360
4459
  *
4361
4460
  * The only legitimate uses of this event are these:
4362
4461
  *
@@ -4364,11 +4463,11 @@ interface LuaBootstrap {
4364
4463
  *
4365
4464
  * - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
4366
4465
  *
4367
- * - Create local references to data stored in the {@link storage | runtime:storage} table.
4466
+ * - Create local references to data stored in the {@link storage | auxiliary:storage} table.
4368
4467
  *
4369
- * For all other purposes, {@link LuaBootstrap::on_init | runtime:LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | runtime:LuaBootstrap::on_configuration_changed} or {@link migrations | runtime:migrations} should be used instead.
4468
+ * For all other purposes, {@link LuaBootstrap::on_init | runtime:LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | runtime:LuaBootstrap::on_configuration_changed} or {@link migrations | auxiliary:migrations} should be used instead.
4370
4469
  *
4371
- * For more context, refer to the {@link Data Lifecycle | runtime:data-lifecycle} page.
4470
+ * For more context, refer to the {@link Data Lifecycle | auxiliary:data-lifecycle} page.
4372
4471
  * @param handler The handler for this event. Passing `nil` will unregister it.
4373
4472
  */
4374
4473
  on_load(this: void, handler: ((this: void) => any) | nil): void;
@@ -4500,7 +4599,7 @@ interface LuaBootstrap {
4500
4599
  *
4501
4600
  * `register_metatable()` can not be used in the console, in event listeners or during a `remote.call()`.
4502
4601
  *
4503
- * The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in {@link storage | runtime:storage}.
4602
+ * The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in {@link storage | auxiliary:storage}.
4504
4603
  *
4505
4604
  * ```
4506
4605
  * local metatable =
@@ -4576,6 +4675,7 @@ interface LuaBootstrap {
4576
4675
  * A dictionary of feature flags mapping to whether they are enabled.
4577
4676
  */
4578
4677
  readonly feature_flags: {
4678
+ expansion: boolean;
4579
4679
  quality: boolean;
4580
4680
  rail_bridges: boolean;
4581
4681
  space_travel: boolean;
@@ -4680,6 +4780,7 @@ interface LuaBurner {
4680
4780
  * Prototype of a burner energy source.
4681
4781
  */
4682
4782
  interface LuaBurnerPrototype {
4783
+ readonly auto_refuel: boolean;
4683
4784
  readonly burnt_inventory_size: uint32;
4684
4785
  readonly effectivity: double;
4685
4786
  /**
@@ -4740,8 +4841,9 @@ interface LuaBurnerUsagePrototype extends LuaPrototypeBase {
4740
4841
  interface LuaCargoHatch {
4741
4842
  /**
4742
4843
  * Creates a cargo pod for output at the owning entity hatch location.
4844
+ * @param cargo_pod_prototype The cargo pod prototype to create. If not provided, the default cargo pod prototype of the hatch is used.
4743
4845
  */
4744
- create_cargo_pod(this: void): LuaEntity;
4846
+ create_cargo_pod(this: void, cargo_pod_prototype?: EntityID): LuaEntity;
4745
4847
  readonly busy: boolean;
4746
4848
  readonly is_input_compatible: boolean;
4747
4849
  readonly is_output_compatible: boolean;
@@ -4760,14 +4862,12 @@ interface LuaCargoHatch {
4760
4862
  * Control behavior for cargo landing pad.
4761
4863
  */
4762
4864
  interface LuaCargoLandingPadControlBehavior extends LuaControlBehavior {
4763
- /**
4764
- * The circuit mode of operations for the cargo landing pad.
4765
- */
4766
- circuit_exclusive_mode_of_operation: defines.control_behavior.cargo_landing_pad.exclusive_mode;
4767
4865
  /**
4768
4866
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
4769
4867
  */
4770
4868
  readonly object_name: string;
4869
+ read_contents: boolean;
4870
+ set_requests: boolean;
4771
4871
  /**
4772
4872
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
4773
4873
  */
@@ -5074,7 +5174,7 @@ interface LuaContainerControlBehavior extends LuaControlBehavior {
5074
5174
  */
5075
5175
  readonly object_name: string;
5076
5176
  /**
5077
- * `true` if this container is sending its content to a circuit network
5177
+ * `true` if this container is sending its content to a circuit network.
5078
5178
  */
5079
5179
  read_contents: boolean;
5080
5180
  /**
@@ -5452,6 +5552,14 @@ interface LuaControl {
5452
5552
  * The loot pickup distance of this character or max double when not a character or player connected to a character.
5453
5553
  */
5454
5554
  readonly loot_pickup_distance: double;
5555
+ /**
5556
+ * For characters and players the number is between 0 and 1.
5557
+ *
5558
+ * For mining drills the number is with the range [0, mining_target.prototype.mineable_properties.mining_time].
5559
+ *
5560
+ * For all other types the number is 0.
5561
+ */
5562
+ mining_progress: double;
5455
5563
  /**
5456
5564
  * Current mining state. Will error if written to with a {@link controller_type | runtime:LuaPlayer::controller_type} other than `character`, `god`, or `editor`.
5457
5565
  *
@@ -5638,6 +5746,18 @@ interface LuaControlBehavior {
5638
5746
  * The entity this control behavior belongs to.
5639
5747
  */
5640
5748
  readonly entity: LuaEntity;
5749
+ /**
5750
+ * Which circuit networks (red/green) to read signals from. Defaults to both wire colors.
5751
+ *
5752
+ * `nil` if this control behavior does not allow selecting the input networks.
5753
+ */
5754
+ input_networks?: CircuitNetworkSelection;
5755
+ /**
5756
+ * Which circuit networks (red/green) to send signals to. Defaults to both wire colors.
5757
+ *
5758
+ * `nil` if this control behavior does not allow selecting the output networks.
5759
+ */
5760
+ output_networks?: CircuitNetworkSelection;
5641
5761
  /**
5642
5762
  * The concrete type of this control behavior.
5643
5763
  */
@@ -5834,6 +5954,58 @@ interface LuaDamagePrototype extends LuaPrototypeBase {
5834
5954
  */
5835
5955
  readonly valid: boolean;
5836
5956
  }
5957
+ /**
5958
+ * Factorio provides a {@link Debug Adapter | https://microsoft.github.io/debug-adapter-protocol/overview} for compatible tools in single-session mode on stdin/stdout when launched with the `--dap` command line argument.
5959
+ *
5960
+ * The Debug Adapter supports a Launch request with the following arguments:
5961
+ *
5962
+ * - `factorioArgs` :: array{@link [string | runtime:string}]? : Command line arguments for the debug session
5963
+ *
5964
+ * - `followSymlinks` :: {@link boolean | runtime:boolean}? : Follow symlinks when emitting locations (stack traces, etc) (default: true)
5965
+ *
5966
+ * - `tags` :: {@link Any | runtime:Any}? : Extra debug session tags, see also {@link tags | runtime:LuaDebugAdapter::tags}
5967
+ *
5968
+ * Metatable methods may be used to customize debug views:
5969
+ *
5970
+ * - `__tostring`(`self`) -> {@link string | runtime:string} : Called when the object appears as a value.
5971
+ *
5972
+ * - `__debugcounts`(`self`) -> `indexedVariables` :: {@link int32 | runtime:int32} , `namedVariables` :: {@link int32 | runtime:int32} : Called when the object appears in a parent object's listing, to estimate the size of this object's listing, and enabled paged listing for large indexed objects.
5973
+ *
5974
+ * - `__debugchildren`(`self`, `filters` :: {@link DebugVariablesFilter | runtime:DebugVariablesFilter}) -> array({@link DebugVariable | runtime:DebugVariable}) : Called when the object itself is opened for a debug listing. If `__debugcounts` was implemented, the client may choose to fetch Indexed and Named children separately, and Indexed children in pages as-needed for display. See also {@link describe_field | runtime:LuaDebugAdapter::describe_field}.
5975
+ *
5976
+ * This class also provides debug session APIs, as the global object `debugadapter` in all stages.
5977
+ */
5978
+ interface LuaDebugAdapter {
5979
+ /**
5980
+ * Prepare a default debug view entry for a field, to assist in preparing custom listings.
5981
+ * @param name The name of the field
5982
+ * @param value The value of the field
5983
+ */
5984
+ describe_field(this: void, name: string, value: Any): DebugVariable;
5985
+ /**
5986
+ * Start recording profiler timings. If there is a previous recording session running, it will be stopped first.
5987
+ * @param table.show_hook_events Include events to indicate time spent in hooks
5988
+ */
5989
+ start_profile(this: void, table: {
5990
+ show_hook_events?: boolean;
5991
+ }): void;
5992
+ /**
5993
+ * Stop recording profiler timings and save to script_output.
5994
+ */
5995
+ stop_profile(this: void): void;
5996
+ /**
5997
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
5998
+ */
5999
+ readonly object_name: string;
6000
+ /**
6001
+ * The value from the `tags` property of the current session's launch request
6002
+ */
6003
+ readonly tags: AnyBasic;
6004
+ /**
6005
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
6006
+ */
6007
+ readonly valid: boolean;
6008
+ }
5837
6009
  /**
5838
6010
  * Control behavior for decider combinators.
5839
6011
  */
@@ -5932,25 +6104,49 @@ interface LuaDecorativePrototype extends LuaPrototypeBase {
5932
6104
  */
5933
6105
  interface LuaDisplayPanelControlBehavior extends LuaControlBehavior {
5934
6106
  /**
5935
- * Get a specific message definition
5936
- * @param index Message index.
5937
- * @returns The message definition at the specified index.
6107
+ * Adds a single message record.
6108
+ * @param message Message record to be added.
6109
+ * @param index Index at which this record should be inserted. Must be within {@link 1, [records_count | runtime:LuaDisplayPanelControlBehavior::records_count} + 1]. When not provided, record will be appended.
6110
+ * @returns If a message record was added.
5938
6111
  */
5939
- get_message(this: void, index: uint32): DisplayPanelMessageDefinition;
6112
+ add_record(this: void, message: DisplayPanelMessageDefinition, index?: uint32): boolean;
5940
6113
  /**
5941
- * Set the message at the specified index
5942
- * @param index Message index. Use `-1` to append new element.
5943
- * @param message The message definition for the specified index. Specify `nil` to remove the message.
6114
+ * Get a single record.
6115
+ * @param index Index of the record to read.
5944
6116
  */
5945
- set_message(this: void, index: int32, message: DisplayPanelMessageDefinition | nil): void;
6117
+ get_record(this: void, index: uint32): DisplayPanelMessageDefinition;
5946
6118
  /**
5947
- * The full list of configured messages.
6119
+ * Moves record from old position to a new position
6120
+ * @param old_index Index where the record to be moved is currently.
6121
+ * @param new_index Index where the record should be moved to.
6122
+ */
6123
+ move_record(this: void, old_index: uint32, new_index: uint32): void;
6124
+ /**
6125
+ * Removes message record at specified index.
6126
+ * @param index Index of the message record to be removed. Must be within {@link 1, [records_count | runtime:LuaDisplayPanelControlBehavior::records_count}].
6127
+ */
6128
+ remove_record(this: void, index: uint32): void;
6129
+ /**
6130
+ * Change content of a specific record.
6131
+ * @param index Index of the record to change
6132
+ */
6133
+ set_record(this: void, index: uint32, record: DisplayPanelMessageDefinition): void;
6134
+ /**
6135
+ * Provides a maximum amount of records that can be added to this behavior. When at full capacity, attempts to add more records will fail.
5948
6136
  */
5949
- messages: DisplayPanelMessageDefinition[];
6137
+ readonly max_records_count: uint32;
5950
6138
  /**
5951
6139
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
5952
6140
  */
5953
6141
  readonly object_name: string;
6142
+ /**
6143
+ * The full list of configured messages.
6144
+ */
6145
+ records: DisplayPanelMessageDefinition[];
6146
+ /**
6147
+ * Current amount of records this control behavior has.
6148
+ */
6149
+ readonly records_count: uint32;
5954
6150
  /**
5955
6151
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
5956
6152
  */
@@ -5980,6 +6176,197 @@ interface LuaElectricEnergySourcePrototype {
5980
6176
  */
5981
6177
  readonly valid: boolean;
5982
6178
  }
6179
+ /**
6180
+ * A LuaElectricNetwork represents a group of {@link LuaElectricSubNetworks | runtime:LuaElectricSubNetwork} that are directly or indirectly connected to each other through implicit connections (closed power switches, surface connections) and during next electric network update will transfer electricity from producers and consumers.
6181
+ *
6182
+ * Electric networks can be merged together when a power switch is closed and can be split into multiple networks when power switch opens. Similarly turning on or off a global network may merge or split electric networks in a way that follows the expected electricity flows - two sub networks that are not directly or indirectly connected will be put into separate electric networks.
6183
+ *
6184
+ * The electric network is what performs electric flow between entities. It does *not* track connected entities as that's the responsibility of the electric sub network.
6185
+ */
6186
+ interface LuaElectricNetwork {
6187
+ /**
6188
+ * Gets total energy stored inside of accumulators that are part of any electric sub network covered by this electric network.
6189
+ * @param table.name When given, only accumulators of this prototype will be considered.
6190
+ * @param table.quality When given, only accumulators of this quality will be considered.
6191
+ */
6192
+ get_accumulators_energy(this: void, table: {
6193
+ name?: EntityID;
6194
+ quality?: QualityID;
6195
+ }): EnergyAndCapacityPair;
6196
+ /**
6197
+ * Changes energy stored inside of accumulators that are part of any electric sub network covered by this electric network.
6198
+ * @param table.name When given, only accumulators of this prototype will be considered.
6199
+ * @param table.quality When given, only accumulators of this quality will be considered.
6200
+ * @param table.energy New total energy to be set onto matching accumulators.
6201
+ * @param table.equalize Whether all accumulators should have the same charge ratio, regardless of whether that means discharging some of them. Defaults to `false`.
6202
+ */
6203
+ set_accumulators_energy(this: void, table: {
6204
+ name?: EntityID;
6205
+ quality?: QualityID;
6206
+ energy: double;
6207
+ equalize?: boolean;
6208
+ }): void;
6209
+ /**
6210
+ * Energy amounts of satisfaction percents related to latest electric network update.
6211
+ */
6212
+ readonly flow_last_tick: {
6213
+ /**
6214
+ * Total energy of accumulators in the electric network before energy transfer.
6215
+ */
6216
+ accumulator_energy: double;
6217
+ /**
6218
+ * Total capacity of accumulators in the electric network during electric network update.
6219
+ */
6220
+ accumulator_capacity: double;
6221
+ /**
6222
+ * Amount of energy offered by energy producers with "primary-output" usage priority.
6223
+ */
6224
+ primary_output: double;
6225
+ /**
6226
+ * Amount of energy offered by energy producers with "secondary-output" usage priority.
6227
+ */
6228
+ secondary_output: double;
6229
+ /**
6230
+ * Amount of energy offered by energy sources with "tertiary" usage priority or accumulators.
6231
+ */
6232
+ tertiary_output: double;
6233
+ /**
6234
+ * Amount of energy offered by energy producers with "solar" usage priority.
6235
+ */
6236
+ solar_output: double;
6237
+ /**
6238
+ * Amount of energy requested by energy consumers with "primary-input" usage priority.
6239
+ */
6240
+ primary_demand: double;
6241
+ /**
6242
+ * Amount of energy requested by energy consumers with "secondary-input" usage priority.
6243
+ */
6244
+ secondary_demand: double;
6245
+ /**
6246
+ * Amount of energy requested by energy consumers with "tertiary" usage priority or accumulators.
6247
+ */
6248
+ tertiary_demand: double;
6249
+ /**
6250
+ * Total amount of energy moved from producers to consumers.
6251
+ */
6252
+ total_transfer: double;
6253
+ /**
6254
+ * Sum of available production (`solar_output`, `primary_output`, `secondary_output`) increased by amount of energy actually provided from tertiary sources/accumulators.
6255
+ */
6256
+ maximum_production: double;
6257
+ /**
6258
+ * Fraction of `maximum_production` that was actually used up.
6259
+ */
6260
+ production_satisfaction: double;
6261
+ /**
6262
+ * Sum of required consumption (`primary_input`, `secondary_input`) increased by amount of extra energy actually consumed by tertiary sources/accumulators.
6263
+ */
6264
+ maximum_consumption: double;
6265
+ /**
6266
+ * Fraction of `consumption_satisfaction` that was actually provided.
6267
+ */
6268
+ consumption_satisfaction: double;
6269
+ lamp_satisfaction: double;
6270
+ /**
6271
+ * Fraction of `primary_output` energy that was taken away during update.
6272
+ */
6273
+ primary_output_usage: double;
6274
+ /**
6275
+ * Fraction of `secondary_output` energy that was taken away during update.
6276
+ */
6277
+ secondary_output_usage: double;
6278
+ /**
6279
+ * Fraction of `tertiary_output` energy that was taken away during update.
6280
+ */
6281
+ tertiary_output_usage: double;
6282
+ /**
6283
+ * Fraction of `solar_output` energy that was taken away during update.
6284
+ */
6285
+ solar_output_usage: double;
6286
+ /**
6287
+ * Fraction of `primary_demand` energy that was provided during update.
6288
+ */
6289
+ primary_demand_usage: double;
6290
+ /**
6291
+ * Fraction of `secondary_demand` energy that was provided during update.
6292
+ */
6293
+ secondary_demand_usage: double;
6294
+ /**
6295
+ * Fraction of `tertiary_demand` energy that was provided during update.
6296
+ */
6297
+ tertiary_demand_usage: double;
6298
+ };
6299
+ /**
6300
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
6301
+ */
6302
+ readonly object_name: string;
6303
+ /**
6304
+ * Statistics for this electric network.
6305
+ *
6306
+ * If the electric network becomes invalid, the flow statistics obtained from it will also become invalid.
6307
+ */
6308
+ readonly statistics: LuaFlowStatistics;
6309
+ readonly sub_networks: LuaElectricSubNetwork[];
6310
+ /**
6311
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
6312
+ */
6313
+ readonly valid: boolean;
6314
+ }
6315
+ /**
6316
+ * A LuaElectricSubNetwork represents an electricity supply group.
6317
+ *
6318
+ * When a supply group is related to electric poles, it spans over all poles that are connected with real (non ghost) wires and connects entities with an electric energy source in range of those poles.
6319
+ *
6320
+ * When a supply group is related to a global electric network, it connects entities with an electric energy source on the same surface.
6321
+ *
6322
+ * Implicit connections (when a power switch is closed, or when an electric pole is built on a surface with global network) do not cause supply groups to merge since they are not copper wire connections. Those connections will cause sub networks to have the same parent electric network causing electricity to be allowed to flow freely between multiple sub networks (electricity produced inside of one sub network that is connected through a power switch to a second sub network will be able to flow into a consumer connected to the second sub network).
6323
+ *
6324
+ * The electric sub network keeps track of connected entities. It does *not* perform electricity flow as that's the responsibility of the electric network.
6325
+ */
6326
+ interface LuaElectricSubNetwork {
6327
+ /**
6328
+ * Gets total energy stored inside of accumulators connected to the electric sub network.
6329
+ * @param table.name When given, only accumulators of this prototype will be considered.
6330
+ * @param table.quality When given, only accumulators of this quality will be considered.
6331
+ */
6332
+ get_accumulators_energy(this: void, table: {
6333
+ name?: EntityID;
6334
+ quality?: QualityID;
6335
+ }): EnergyAndCapacityPair;
6336
+ /**
6337
+ * Changes energy stored inside of accumulators connected to the electric sub network.
6338
+ * @param table.name When given, only accumulators of this prototype will be considered.
6339
+ * @param table.quality When given, only accumulators of this quality will be considered.
6340
+ * @param table.energy New total energy to be set onto matching accumulators.
6341
+ * @param table.equalize Whether all accumulators should have the same charge ratio, regardless of whether that means discharging some of them. Defaults to `false`.
6342
+ */
6343
+ set_accumulators_energy(this: void, table: {
6344
+ name?: EntityID;
6345
+ quality?: QualityID;
6346
+ energy: double;
6347
+ equalize?: boolean;
6348
+ }): void;
6349
+ /**
6350
+ * Unique identifier of this electric sub network.
6351
+ */
6352
+ readonly id: uint32;
6353
+ /**
6354
+ * List of sub networks that are directly connected to this sub network through power switches or because they span over electric poles placed on a surface with global network (all poles on a surface with global network are implicitly connected to global network making their networks neighbour of a global network).
6355
+ */
6356
+ readonly neighbours: LuaElectricSubNetwork[];
6357
+ /**
6358
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
6359
+ */
6360
+ readonly object_name: string;
6361
+ /**
6362
+ * Parent network to this sub network.
6363
+ */
6364
+ readonly parent_network: LuaElectricNetwork;
6365
+ /**
6366
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
6367
+ */
6368
+ readonly valid: boolean;
6369
+ }
5983
6370
  /**
5984
6371
  * The primary interface for interacting with entities through the Lua API. Entities are everything that exists on the map except for tiles (see {@link LuaTile | runtime:LuaTile}).
5985
6372
  *
@@ -5989,8 +6376,31 @@ interface LuaEntity extends LuaControl {
5989
6376
  /**
5990
6377
  * Adds the given position to this spidertron's autopilot's queue of destinations.
5991
6378
  * @param position The position the spidertron should move to.
6379
+ * @param attempt_patrol If the autopilot logic should attempt to initiate patrol mode at the given position. Defaults to `false`.
6380
+ */
6381
+ add_autopilot_destination(this: void, position: MapPosition, attempt_patrol?: boolean): void;
6382
+ /**
6383
+ * Adds the given fluid to the entity's given fluid storage if possible.
6384
+ *
6385
+ * If the current fluid conflicts or the current filter conflicts the fluid may not be added.
6386
+ * @returns The amount of fluid added.
6387
+ */
6388
+ add_fluid(this: void, index: FluidStorageIndex, fluid: Fluid): FluidAmount;
6389
+ /**
6390
+ * Registers a linked fluidbox connection between this entity and other entity. Because entity may have multiple fluidboxes, each with multiple connections that could be linked, a unique value for this and other linked_connection_id may need to be given.
6391
+ *
6392
+ * It may happen a linked fluidbox connection is not established immediately due to crafting machines being possible to not have certain fluidboxes exposed at a given point in time, but once they appear (due to recipe changes that would use them) they will be linked. Linked connections are persisted as (this_entity, this_linked_connection_id, other_entity, other_linked_connection_id) so if a pipe connection definition's value of linked_connection_id changes existing connections may not restore correct connections.
6393
+ *
6394
+ * Every fluidbox connection that was defined in prototypes as connection_type=="linked" may be linked to at most 1 other fluidbox. When trying to connect already used connection, previous connection will be removed.
6395
+ *
6396
+ * Linked connections cannot go to the same entity even if they would be part of other fluidbox.
6397
+ */
6398
+ add_fluid_box_linked_connection(this: void, this_linked_connection_id: uint32, other_entity: LuaEntity, other_linked_connection_id: uint32): void;
6399
+ /**
6400
+ * Adds the given fluid to the given storage's fluid segment if possible.
6401
+ * @returns The amount of fluid added.
5992
6402
  */
5993
- add_autopilot_destination(this: void, position: MapPosition): void;
6403
+ add_fluid_segment_fluid(this: void, index: FluidStorageIndex, fluid: Fluid): FluidAmount;
5994
6404
  /**
5995
6405
  * Offer a thing on the market.
5996
6406
  * @example ```
@@ -6044,13 +6454,37 @@ interface LuaEntity extends LuaControl {
6044
6454
  */
6045
6455
  cancel_upgrade(this: void, force: ForceID, player?: PlayerIdentification): boolean;
6046
6456
  /**
6047
- * Remove all fluids from this entity.
6457
+ * Removes all fluid from the entity's given fluid storage if possible.
6458
+ * @returns The fluid cleared.
6459
+ */
6460
+ clear_fluid(this: void, index: FluidStorageIndex): Fluid | null;
6461
+ /**
6462
+ * Remove all fluids from this entity and connected fluid segments.
6048
6463
  */
6049
6464
  clear_fluid_inside(this: void): void;
6050
6465
  /**
6051
- * Removes all offers from a market.
6466
+ * Clears the given fluid storage's fluid segment.
6467
+ * @returns The fluid cleared.
6468
+ */
6469
+ clear_fluid_segment_fluid(this: void, index: FluidStorageIndex): Fluid | null;
6470
+ /**
6471
+ * Clears all fluids in this entity but will not clear fluids in any fluid segments fluidboxes may be part of.
6472
+ * @returns The fluids removed.
6473
+ */
6474
+ clear_fluids(this: void): Fluid[];
6475
+ /**
6476
+ * Removes all offers from a market.
6052
6477
  */
6053
6478
  clear_market_items(this: void): void;
6479
+ clear_stored_durability(this: void): void;
6480
+ /**
6481
+ * Removes selected runtime tooltip field.
6482
+ */
6483
+ clear_tooltip_field(this: void, id: uint32): void;
6484
+ /**
6485
+ * Removes all runtime tooltip fields attached to this entity.
6486
+ */
6487
+ clear_tooltip_fields(this: void): void;
6054
6488
  /**
6055
6489
  * Clones this entity.
6056
6490
  * @param table.position The destination position
@@ -6092,9 +6526,13 @@ interface LuaEntity extends LuaControl {
6092
6526
  * Creates a cargo pod if possible.
6093
6527
  *
6094
6528
  * Cargo pod will be created with {@link invalid | runtime:defines.cargo_destination.invalid} destination type. Setting {@link cargo_pod_destination | runtime:LuaEntity::cargo_pod_destination} will cause it to launch.
6095
- * @param cargo_hatch The hatch to create the pod at. A random (available) one is picked if not provided.
6529
+ * @param table.cargo_hatch The hatch to create the pod at. A random (available) one is picked if not provided.
6530
+ * @param table.cargo_pod_prototype The cargo pod prototype to create. If not provided, the default cargo pod prototype of the hatch is used.
6096
6531
  */
6097
- create_cargo_pod(this: void, cargo_hatch?: LuaCargoHatch): LuaEntity | null;
6532
+ create_cargo_pod(this: void, table: {
6533
+ cargo_hatch?: LuaCargoHatch;
6534
+ cargo_pod_prototype?: EntityID;
6535
+ }): LuaEntity | null;
6098
6536
  /**
6099
6537
  * Damages the entity.
6100
6538
  * @param damage The amount of damage to be done.
@@ -6147,6 +6585,29 @@ interface LuaEntity extends LuaControl {
6147
6585
  * @returns If anything was disconnected
6148
6586
  */
6149
6587
  disconnect_rolling_stock(this: void, direction: defines.rail_direction): boolean;
6588
+ /**
6589
+ * Remove fluid from this entity.
6590
+ *
6591
+ * If temperature is given only fluid matching that exact temperature is removed. If minimum and maximum is given fluid within that range is removed.
6592
+ * @param table.name Fluid prototype name.
6593
+ * @param table.amount Amount to remove
6594
+ * @returns Amount of fluid actually removed.
6595
+ */
6596
+ extract_fluid(this: void, table: {
6597
+ name: string;
6598
+ amount: FluidAmount;
6599
+ minimum_temperature?: double;
6600
+ maximum_temperature?: double;
6601
+ temperature?: double;
6602
+ }): FluidAmount;
6603
+ /**
6604
+ * Flips this entity
6605
+ * @returns Whether the flip was successful.
6606
+ */
6607
+ flip(this: void, table: {
6608
+ horizontal: boolean;
6609
+ by_player?: PlayerIdentification;
6610
+ }): boolean;
6150
6611
  /**
6151
6612
  * Take an ascending cargo pod and safely make it skip all animation and immediately switch surface.
6152
6613
  */
@@ -6244,25 +6705,74 @@ interface LuaEntity extends LuaControl {
6244
6705
  */
6245
6706
  get_filter(this: void, slot_index: uint32): (ItemFilter | EntityID | AsteroidChunkID) | null;
6246
6707
  /**
6247
- * Gets fluid of the index-th fluid storage. This includes fluidbox and non-fluidbox fluid storages like fluid wagon contents. Refer to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count} for more information on available storages.
6248
- * @param index Fluid storage index. Valid values are from 1 up to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count}.
6249
- * @returns Fluid in this storage. `nil` if fluid storage is empty.
6708
+ * Gets the fluid in the entity's given fluid storage if one exists.
6709
+ * @returns The fluid in this storage. `nil` if fluid storage is empty.
6710
+ */
6711
+ get_fluid(this: void, index: FluidStorageIndex): Fluid | null;
6712
+ /**
6713
+ * Returns other end of a linked fluidbox connection.
6714
+ * @returns [0] - Other entity to which a linked fluidbox connection was made
6715
+ * @returns [1] - linked_connection_id on other entity
6716
+ */
6717
+ get_fluid_box_linked_connection(this: void, this_linked_connection_id: uint32): LuaMultiReturn<[
6718
+ LuaEntity | null,
6719
+ uint32 | null
6720
+ ]>;
6721
+ /**
6722
+ * Returns list of all linked fluidbox connections registered for this entity.
6723
+ */
6724
+ get_fluid_box_linked_connections(this: void): FluidBoxConnectionRecord[];
6725
+ /**
6726
+ * The entities the given fluidbox is connected to.
6250
6727
  */
6251
- get_fluid(this: void, index: uint32): Fluid | null;
6728
+ get_fluid_box_neighbours(this: void, index: FluidStorageIndex): FluidBoxNeighbourRecord[] | null;
6729
+ /**
6730
+ * Get the given connections and associated data of the fluidbox.
6731
+ */
6732
+ get_fluid_box_pipe_connections(this: void, index: FluidStorageIndex): PipeConnection[] | null;
6733
+ /**
6734
+ * The prototype of the entity's given fluid storage if one exists. If this is used on a fluidbox of a crafting machine which due to recipe was created by merging multiple prototypes, a table of prototypes that were merged will be returned instead For storages on entities that have fluid storage but no prototype for those storages (fluid wagons, and fluid turrets) this returns `nil`.
6735
+ */
6736
+ get_fluid_box_prototype(this: void, index: FluidStorageIndex): (LuaFluidBoxPrototype | LuaFluidBoxPrototype[]) | null;
6737
+ /**
6738
+ * Gets the maximum capacity of the entity's given fluid storage.
6739
+ */
6740
+ get_fluid_capacity(this: void, index: FluidStorageIndex): FluidAmount;
6252
6741
  /**
6253
6742
  * Get amounts of all fluids in this entity.
6254
6743
  *
6255
- * If information about fluid temperatures is required, {@link LuaEntity::get_fluid | runtime:LuaEntity::get_fluid} or {@link LuaEntity::fluidbox | runtime:LuaEntity::fluidbox} should be used instead.
6744
+ * If information about fluid temperatures is required, {@link LuaEntity::get_fluid | runtime:LuaEntity::get_fluid} should be used instead.
6256
6745
  * @returns The amounts, indexed by fluid names.
6257
6746
  */
6258
6747
  get_fluid_contents(this: void): Record<string, FluidAmount>;
6259
6748
  /**
6260
6749
  * Get the amount of all or some fluid in this entity.
6261
6750
  *
6262
- * If information about fluid temperatures is required, {@link LuaEntity::fluidbox | runtime:LuaEntity::fluidbox} should be used instead.
6751
+ * If information about fluid temperatures is required, {@link LuaEntity::get_fluid | runtime:LuaEntity::get_fluid} should be used instead.
6263
6752
  * @param fluid Prototype name of the fluid to count. If not specified, count all fluids.
6264
6753
  */
6265
- get_fluid_count(this: void, fluid?: string): double;
6754
+ get_fluid_count(this: void, fluid?: string): FluidAmount;
6755
+ /**
6756
+ * Get a fluidbox filter, such as the filter of a pump.
6757
+ */
6758
+ get_fluid_filter(this: void, index: FluidStorageIndex): FluidFilter | null;
6759
+ /**
6760
+ * Gets the maximum capacity of the given fluid storage's segment.
6761
+ */
6762
+ get_fluid_segment_capacity(this: void, index: FluidStorageIndex): FluidAmount;
6763
+ /**
6764
+ * Gets the current extent bounding box of of the given fluid storage's segment.
6765
+ */
6766
+ get_fluid_segment_extent_bounding_box(this: void, index: FluidStorageIndex): BoundingBox;
6767
+ /**
6768
+ * Gets the filter of the given fluid storage's segment. The filter is based on the filters set on the fluidboxes of the segment, so it can't be set directly on the segment.
6769
+ */
6770
+ get_fluid_segment_filter(this: void, index: FluidStorageIndex): FluidFilter | null;
6771
+ /**
6772
+ * The fluid within the given storage's fluid segment.
6773
+ */
6774
+ get_fluid_segment_fluid(this: void, index: FluidStorageIndex): Fluid | null;
6775
+ get_fluid_segment_id(this: void, index: FluidStorageIndex): uint32;
6266
6776
  /**
6267
6777
  * Checks what is expected fluid to be produced from the offshore pump's source tile. It accounts for visible tile, hidden tile and double hidden tile. It ignores currently set fluid box filter.
6268
6778
  * @returns Name of fluid that should be produced by this offshore pump based on existing tiles.
@@ -6315,10 +6825,11 @@ interface LuaEntity extends LuaControl {
6315
6825
  /**
6316
6826
  * Get an item insert specification onto a belt connectable: for a given map position provides into which line at what position item should be inserted to be closest to the provided position.
6317
6827
  * @param position Position where the item is to be inserted.
6828
+ * @param mirrored When inserting at position exactly in between lines, mirroring is used to choose line.
6318
6829
  * @returns [0] - Index of the transport line that is closest to the provided map position.
6319
6830
  * @returns [1] - Position along the transport line where item should be dropped.
6320
6831
  */
6321
- get_item_insert_specification(this: void, position: MapPosition): LuaMultiReturn<[
6832
+ get_item_insert_specification(this: void, position: MapPosition, mirrored?: boolean): LuaMultiReturn<[
6322
6833
  uint32,
6323
6834
  float
6324
6835
  ]>;
@@ -6473,6 +6984,19 @@ interface LuaEntity extends LuaControl {
6473
6984
  * The train currently stopped at this train stop, if any.
6474
6985
  */
6475
6986
  get_stopped_train(this: void): LuaTrain | null;
6987
+ /**
6988
+ * @param item Item for which a stored durability is requested.
6989
+ * @returns Durability stored.
6990
+ */
6991
+ get_stored_durability(this: void, item: ItemID): LabStoredDurability;
6992
+ /**
6993
+ * Gets selected runtime tooltip field.
6994
+ */
6995
+ get_tooltip_field(this: void, id: uint32): RuntimeTooltipField | null;
6996
+ /**
6997
+ * Gets all runtime tooltip fields attached to this entity.
6998
+ */
6999
+ get_tooltip_fields(this: void): RuntimeTooltipField[];
6476
7000
  /**
6477
7001
  * The trains scheduled to stop at this train stop.
6478
7002
  */
@@ -6516,12 +7040,16 @@ interface LuaEntity extends LuaControl {
6516
7040
  * @returns `true` if this entity has the given flag set.
6517
7041
  */
6518
7042
  has_flag(this: void, flag: EntityPrototypeFlag): boolean;
7043
+ /**
7044
+ * Whether the given fluid storage has a fluid segment.
7045
+ */
7046
+ has_fluid_segment(this: void, index: FluidStorageIndex): boolean;
6519
7047
  /**
6520
7048
  * Insert fluid into this entity. Fluidbox is chosen automatically.
6521
7049
  * @param fluid Fluid to insert.
6522
7050
  * @returns Amount of fluid actually inserted.
6523
7051
  */
6524
- insert_fluid(this: void, fluid: Fluid): double;
7052
+ insert_fluid(this: void, fluid: Fluid): FluidAmount;
6525
7053
  /**
6526
7054
  * The same as {@link LuaInventory::supports_bar | runtime:LuaInventory::supports_bar} but also works for ghosts where the inventory is not available through {@link LuaControl::get_inventory | runtime:LuaControl::get_inventory}.
6527
7055
  */
@@ -6647,20 +7175,19 @@ interface LuaEntity extends LuaControl {
6647
7175
  */
6648
7176
  release_from_spawner(this: void): void;
6649
7177
  /**
6650
- * Remove fluid from this entity.
6651
- *
6652
- * If temperature is given only fluid matching that exact temperature is removed. If minimum and maximum is given fluid within that range is removed.
6653
- * @param table.name Fluid prototype name.
6654
- * @param table.amount Amount to remove
6655
- * @returns Amount of fluid actually removed.
7178
+ * Removes the given fluid amount from the entity's given fluid storage if possible.
7179
+ * @returns The fluid removed.
6656
7180
  */
6657
- remove_fluid(this: void, table: {
6658
- name: string;
6659
- amount: double;
6660
- minimum_temperature?: double;
6661
- maximum_temperature?: double;
6662
- temperature?: double;
6663
- }): double;
7181
+ remove_fluid(this: void, index: FluidStorageIndex, amount: FluidAmount): Fluid | null;
7182
+ /**
7183
+ * Removes linked fluidbox connection record. If connected, other end will be also removed.
7184
+ */
7185
+ remove_fluid_box_linked_connection(this: void, this_linked_connection_id: uint32): void;
7186
+ /**
7187
+ * Removes the given fluid amount from the given storage's fluid segment if possible.
7188
+ * @returns The fluid removed.
7189
+ */
7190
+ remove_fluid_segment_fluid(this: void, index: FluidStorageIndex, amount: FluidAmount): Fluid | null;
6664
7191
  /**
6665
7192
  * Remove an offer from a market.
6666
7193
  *
@@ -6725,14 +7252,24 @@ interface LuaEntity extends LuaControl {
6725
7252
  */
6726
7253
  set_filter(this: void, index: uint32, filter?: ItemFilter | ItemWithQualityID | EntityID | AsteroidChunkID): void;
6727
7254
  /**
6728
- * Sets fluid to the index-th fluid storage. This includes fluidbox and non-fluidbox fluid storages like fluid wagon contents. Refer to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count} for more information on available storages.
7255
+ * Sets the fluid in the entity's given fluid storage to the provided fluid if possible.
6729
7256
  *
6730
- * Fluid storages that are part of fluidboxes (also available through {@link LuaFluidBox | runtime:LuaFluidBox}) may reject some fluids if they do not match filters or are above the fluidbox volume. To verify how much fluid was set a return value can be used which is the same as value that would be returned by {@link LuaEntity::get_fluid | runtime:LuaEntity::get_fluid}.
6731
- * @param index Fluid storage index. Valid values are from 1 up to {@link LuaEntity::fluids_count | runtime:LuaEntity::fluids_count}.
6732
- * @param fluid Fluid to set. Fluid storage will be cleared if this is not provided.
6733
- * @returns Fluid in this storage after it was set. `nil` if fluid storage is empty.
7257
+ * Fluid filters may block setting the fluid, or less fluid may be set if it's more than the maximum capacity.
7258
+ * @returns How much of the given fluid was actually set.
7259
+ */
7260
+ set_fluid(this: void, index: FluidStorageIndex, fluid: Fluid): FluidAmount;
7261
+ /**
7262
+ * Set a fluidbox filter, such as the filter of a pump.
7263
+ *
7264
+ * Some entities cannot have their fluidbox filter set, notably fluid wagons and crafting machines.
7265
+ * @returns Whether the filter was set.
7266
+ */
7267
+ set_fluid_filter(this: void, index: FluidStorageIndex, filter?: FluidFilter): boolean;
7268
+ /**
7269
+ * Sets the fluid within the given storage's fluid segment.
7270
+ * @returns The amount of fluid set.
6734
7271
  */
6735
- set_fluid(this: void, index: uint32, fluid?: Fluid): Fluid | null;
7272
+ set_fluid_segment_fluid(this: void, index: FluidStorageIndex, fluid: Fluid): FluidAmount;
6736
7273
  /**
6737
7274
  * Sets the heat setting for this heat interface.
6738
7275
  * @param filter The new setting.
@@ -6794,6 +7331,16 @@ interface LuaEntity extends LuaControl {
6794
7331
  * @returns Any items removed from this entity as a result of setting the recipe.
6795
7332
  */
6796
7333
  set_recipe(this: void, recipe?: RecipeID, quality?: QualityID): ItemWithQualityCount[];
7334
+ /**
7335
+ * @param item Item for which a stored durability is requested.
7336
+ * @param durability Durability to set.
7337
+ */
7338
+ set_stored_durability(this: void, item: ItemID, durability: LabStoredDurability): void;
7339
+ /**
7340
+ * Adds or changes runtime tooltip field. If `id` is not given a new one will be allocated in a way that makes it unique within this entity. If a value is given that is already used, existing line will be updated.
7341
+ * @returns Identifier of the record that was given or allocated.
7342
+ */
7343
+ set_tooltip_field(this: void, field: RuntimeTooltipField): uint32;
6797
7344
  /**
6798
7345
  * Revives a ghost silently, so the revival makes no sound and no smoke is created.
6799
7346
  * @param table.raise_revive If true, and an entity ghost; {@link script_raised_revive | runtime:script_raised_revive} will be called. Else if true, and a tile ghost; {@link script_raised_set_tiles | runtime:script_raised_set_tiles} will be called.
@@ -6846,22 +7393,20 @@ interface LuaEntity extends LuaControl {
6846
7393
  update_connections(this: void): void;
6847
7394
  readonly absorbed_pollution: double;
6848
7395
  /**
6849
- * Deactivating an entity will stop all its operations (car will stop moving, inserters will stop working, fish will stop moving etc).
7396
+ * A deactivated entity will stop all of its operations (car will stop moving, inserters will stop working, fish will stop moving, etc).
6850
7397
  *
6851
7398
  * Reading from this returns `false` if the entity is deactivated in at least one of the following ways: {@link by script | runtime:LuaEntity::disabled_by_script}, {@link by circuit network | runtime:LuaEntity::disabled_by_control_behavior}, {@link by recipe | runtime:LuaEntity::disabled_by_recipe}, {@link by freezing | runtime:LuaEntity::frozen}, or by being marked for deconstruction.
6852
7399
  *
6853
- * Writing to this is deprecated and affects only the {@link disabled_by_script | runtime:LuaEntity::disabled_by_script} state.
6854
- *
6855
- * Entities that are not active naturally can't be set to be active (setting it to be active will do nothing). Some entities (Corpse, FireFlame, Roboport, RollingStock, dying entities) need to remain active and will ignore writes.
7400
+ * If this entity is not considered {@link updatable | runtime:LuaEntity::is_updatable} then this always returns `false`.
6856
7401
  */
6857
- active: boolean;
7402
+ readonly active: boolean;
6858
7403
  /**
6859
- * The ai settings of this unit.
7404
+ * The AI settings of this unit.
6860
7405
  */
6861
7406
  readonly ai_settings: LuaAISettings;
6862
7407
  alert_parameters: ProgrammableSpeakerAlertParameters;
6863
7408
  /**
6864
- * Whether this character's personal roboports are allowed to dispatch robots.
7409
+ * Whether this entity's personal roboports are allowed to dispatch robots.
6865
7410
  */
6866
7411
  allow_dispatching_robots: boolean;
6867
7412
  /**
@@ -6909,6 +7454,12 @@ interface LuaEntity extends LuaControl {
6909
7454
  * The queued destination positions of spidertron's autopilot.
6910
7455
  */
6911
7456
  readonly autopilot_destinations: MapPosition[];
7457
+ /**
7458
+ * When there are this many waypoints left the spider vehicle will start patrolling along them.
7459
+ *
7460
+ * Setting this to 0 will disable patrolling.
7461
+ */
7462
+ autopilot_patrol_size: uint32;
6912
7463
  /**
6913
7464
  * The backer name assigned to this entity. Entities that support backer names are labs, locomotives, radars, roboports, and train stops. `nil` if this entity doesn't support backer names.
6914
7465
  *
@@ -6921,7 +7472,7 @@ interface LuaEntity extends LuaControl {
6921
7472
  */
6922
7473
  readonly beacons_count?: uint32;
6923
7474
  /**
6924
- * The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see {@link LuaEntity::neighbours | runtime:LuaEntity::neighbours} for that.
7475
+ * The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see {@link LuaEntity::underground_belt_neighbour | runtime:LuaEntity::underground_belt_neighbour} for that.
6925
7476
  */
6926
7477
  readonly belt_neighbours: {
6927
7478
  /**
@@ -6998,6 +7549,15 @@ interface LuaEntity extends LuaControl {
6998
7549
  * The tick this character corpse died at.
6999
7550
  */
7000
7551
  character_corpse_tick_of_death: uint32;
7552
+ /**
7553
+ * Table of cliff neighbours.
7554
+ */
7555
+ readonly cliff_neighbours: {
7556
+ north?: LuaEntity;
7557
+ east?: LuaEntity;
7558
+ south?: LuaEntity;
7559
+ west?: LuaEntity;
7560
+ };
7001
7561
  /**
7002
7562
  * The orientation of this cliff.
7003
7563
  */
@@ -7127,7 +7687,7 @@ interface LuaEntity extends LuaControl {
7127
7687
  /**
7128
7688
  * Text visible on the display panel. Can be written only when it is not set by control behavior.
7129
7689
  */
7130
- display_panel_text: LocalisedString;
7690
+ display_panel_text: string;
7131
7691
  /**
7132
7692
  * Gives a draw data of the given entity if it supports such data.
7133
7693
  */
@@ -7174,14 +7734,38 @@ interface LuaEntity extends LuaControl {
7174
7734
  * The table of emissions of this energy source in `pollution/Joule`, indexed by pollutant type. `nil` if the entity doesn't have an electric energy source. Multiplying values in the returned table by energy consumption in `Watt` gives `pollution/second`.
7175
7735
  */
7176
7736
  readonly electric_emissions_per_joule?: Record<string, double>;
7737
+ /**
7738
+ * Mode this ElectricEnergyInterface is in. Mode changes how the interface interacts with electric network: if its an electric producer, consumer and what priority it has.
7739
+ */
7740
+ electric_interface_mode: defines.electric_interface_mode;
7741
+ /**
7742
+ * Electric network this entity is connected to.
7743
+ *
7744
+ * This can be used with electric poles, in which case the network will be the same as the one obtained from copper wire connector.
7745
+ *
7746
+ * If this entity has an electric energy source, only a primary network will be provided. To also get other networks for entities in range of multiple networks, use {@link LuaEntity::electric_networks | runtime:LuaEntity::electric_networks} instead.
7747
+ */
7748
+ readonly electric_network?: LuaElectricSubNetwork;
7177
7749
  /**
7178
7750
  * Returns the id of the electric network that this entity is connected to, if any.
7179
7751
  */
7180
7752
  readonly electric_network_id?: uint32;
7181
7753
  /**
7182
7754
  * The electric network statistics for this electric pole.
7755
+ *
7756
+ * If this electric pole becomes invalid, the flow statistics obtained from it will also become invalid. If this electric pole becomes part of a different electric network, the flow statistics will be for the new electric network this pole is part of.
7183
7757
  */
7184
7758
  readonly electric_network_statistics: LuaFlowStatistics;
7759
+ /**
7760
+ * Electric networks this entity with an electric energy source is connected to.
7761
+ *
7762
+ * No array is given if this entity has no electric energy source.
7763
+ *
7764
+ * Empty array will be given if this entity is not in range of any networks.
7765
+ *
7766
+ * Compared to {@link LuaEntity::electric_network | runtime:LuaEntity::electric_network}, this does not work with electric poles since they do not have an electric energy source and as such can only belong to one network at a time.
7767
+ */
7768
+ readonly electric_networks?: LuaElectricSubNetwork[];
7185
7769
  /**
7186
7770
  * Whether equipment grid logistics are enabled while this vehicle is moving.
7187
7771
  */
@@ -7207,11 +7791,11 @@ interface LuaEntity extends LuaControl {
7207
7791
  */
7208
7792
  readonly filter_slot_count: uint32;
7209
7793
  /**
7210
- * Fluidboxes of this entity.
7794
+ * A list of neighbours connected to fluidboxes of this entity. Neighbours are grouped by index of fluid box of this entity to which they are connected. For more detailed informations please use {@link LuaEntity::get_fluid_box_neighbours | runtime:LuaEntity::get_fluid_box_neighbours}.
7211
7795
  */
7212
- readonly fluidbox: LuaFluidBox;
7796
+ readonly fluidbox_neighbours: LuaEntity[][];
7213
7797
  /**
7214
- * Returns count of fluid storages. This includes fluid storages provided by fluidboxes but also covers other fluid storages like fluid turret's internal buffer and fluid wagon's fluid since they are not fluidbox and cannot be exposed through {@link LuaFluidBox | runtime:LuaFluidBox}.
7798
+ * Returns count of fluid storages. This includes fluid storages provided by fluidboxes but also covers other fluid storages like fluid turret's internal buffer and fluid wagon's fluid.
7215
7799
  */
7216
7800
  readonly fluids_count: uint32;
7217
7801
  /**
@@ -7316,6 +7900,10 @@ interface LuaEntity extends LuaControl {
7316
7900
  * If this is not an infinite resource, writing will produce an error.
7317
7901
  */
7318
7902
  initial_amount?: uint32;
7903
+ /**
7904
+ * Max amount of energy this ElectricEnergyInterface will take from electric network in one tick.
7905
+ */
7906
+ input_flow_limit: double;
7319
7907
  /**
7320
7908
  * The insert plan for this ghost or item request proxy.
7321
7909
  */
@@ -7438,10 +8026,8 @@ interface LuaEntity extends LuaControl {
7438
8026
  * Not minable entities can still be destroyed.
7439
8027
  *
7440
8028
  * Tells if entity reports as being minable right now. This takes into account `minable_flag` and entity specific conditions (for example rail under rolling stocks is not minable, vehicle with passenger is not minable).
7441
- *
7442
- * Write to this field since 2.0.26 is deprecated and it will result in write to `minable_flag` instead.
7443
8029
  */
7444
- minable: boolean;
8030
+ readonly minable: boolean;
7445
8031
  /**
7446
8032
  * Script controlled flag that allows entity to be mined.
7447
8033
  */
@@ -7454,10 +8040,6 @@ interface LuaEntity extends LuaControl {
7454
8040
  * The filter mode for this mining drill. `nil` if this mining drill doesn't have filters.
7455
8041
  */
7456
8042
  mining_drill_filter_mode?: 'whitelist' | 'blacklist';
7457
- /**
7458
- * The mining progress for this mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]. `nil` if this isn't a mining drill.
7459
- */
7460
- mining_progress?: double;
7461
8043
  /**
7462
8044
  * The mining target, if any.
7463
8045
  */
@@ -7481,15 +8063,9 @@ interface LuaEntity extends LuaControl {
7481
8063
  */
7482
8064
  readonly neighbour_bonus: double;
7483
8065
  /**
7484
- * A list of neighbours for certain types of entities. Applies to underground belts, walls, gates, reactors, heat pipes, cliffs, and pipe-connectable entities.
7485
- * Differs depending on the type of entity:
7486
- *
7487
- * - When called on a pipe-connectable entity, this is an array of entity arrays of all entities a given fluidbox is connected to.
7488
- * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
7489
- * - When called on a wall-connectable entity, reactor or heat pipe, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
7490
- * - When called on a cliff entity, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
8066
+ * Connections of a {@link neighbour connectable | runtime:LuaEntityPrototype::neighbour_connectable} entity. Includes connections that aren't currently connected to another entity.
7491
8067
  */
7492
- readonly neighbours?: Record<string, LuaEntity> | LuaEntity[][] | LuaEntity;
8068
+ readonly neighbour_connectable_connections: NeighbourConnectableConnection[];
7493
8069
  /**
7494
8070
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
7495
8071
  */
@@ -7502,6 +8078,14 @@ interface LuaEntity extends LuaControl {
7502
8078
  * The smooth orientation of this entity. For turrets this is the orientation of the weapon.
7503
8079
  */
7504
8080
  orientation: RealOrientation;
8081
+ /**
8082
+ * Max amount of energy this ElectricEnergyInterface will provide to electric network in one tick.
8083
+ */
8084
+ output_flow_limit: double;
8085
+ /**
8086
+ * The override logistic mode being used by this infinity container if it is overridden.
8087
+ */
8088
+ override_logistic_mode?: defines.logistic_mode;
7505
8089
  /**
7506
8090
  * Plants registered by this agricultural tower. One plant can be registered in multiple agricultural towers.
7507
8091
  */
@@ -7567,6 +8151,10 @@ interface LuaEntity extends LuaControl {
7567
8151
  * The number of products this machine finished crafting in its lifetime.
7568
8152
  */
7569
8153
  products_finished: uint32;
8154
+ /**
8155
+ * Automated weapons won't target protected entities.
8156
+ */
8157
+ protected: boolean;
7570
8158
  /**
7571
8159
  * The entity prototype of this entity.
7572
8160
  */
@@ -7584,9 +8172,13 @@ interface LuaEntity extends LuaControl {
7584
8172
  */
7585
8173
  proxy_target_inventory: defines.inventory;
7586
8174
  /**
7587
- * The rail target of this pump, if any.
8175
+ * The rail targets of this pump's input
8176
+ */
8177
+ readonly pump_input_rail_targets: LuaEntity[];
8178
+ /**
8179
+ * The rail targets of this pump's output
7588
8180
  */
7589
- readonly pump_rail_target?: LuaEntity;
8181
+ readonly pump_output_rail_targets: LuaEntity[];
7590
8182
  /**
7591
8183
  * The amount of fluid moved by this offshore pump or normal pump in the last tick.
7592
8184
  */
@@ -7688,6 +8280,34 @@ interface LuaEntity extends LuaControl {
7688
8280
  * Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotatable.
7689
8281
  */
7690
8282
  rotatable: boolean;
8283
+ /**
8284
+ * The saved logistic requests if they exist.
8285
+ *
8286
+ * They exist when the infinity container was switched away from having the option to set logistic requests, for example by changing the {@link logistic mode | runtime:LuaEntity::override_logistic_mode} away from requester or buffer.
8287
+ */
8288
+ saved_request_filters?: SavedLogisticFilters;
8289
+ /**
8290
+ * The saved request from buffers value if one exists.
8291
+ *
8292
+ * The value exists when the infinity container was switched away from having the request from buffers option, for example by changing the {@link logistic mode | runtime:LuaEntity::override_logistic_mode} away from requester.
8293
+ */
8294
+ saved_request_from_buffers?: boolean;
8295
+ /**
8296
+ * The saved set requests value if one exists.
8297
+ *
8298
+ * The value exists when the infinity container was switched away from having the set requests option, for example by changing the {@link logistic mode | runtime:LuaEntity::override_logistic_mode} away from requester or buffer.
8299
+ */
8300
+ saved_set_requests?: boolean;
8301
+ /**
8302
+ * The saved storage filters if they exist.
8303
+ *
8304
+ * They exist when the infinity container was switched away from having the option to set storage filters, for example by changing the {@link logistic mode | runtime:LuaEntity::override_logistic_mode} away from storage.
8305
+ */
8306
+ saved_storage_filters?: SavedLogisticFilters;
8307
+ /**
8308
+ * Amount of train stop reservations taken by script.
8309
+ */
8310
+ script_reservations_count: uint32;
7691
8311
  /**
7692
8312
  * The secondary bounding box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
7693
8313
  */
@@ -7838,6 +8458,10 @@ interface LuaEntity extends LuaControl {
7838
8458
  * The train this rolling stock belongs to, if any. `nil` if this is not a rolling stock.
7839
8459
  */
7840
8460
  readonly train?: LuaTrain;
8461
+ /**
8462
+ * Amount of train stop reservations taken by trains.
8463
+ */
8464
+ readonly train_reservations_count: uint32;
7841
8465
  /**
7842
8466
  * Priority of this train stop.
7843
8467
  */
@@ -7848,6 +8472,8 @@ interface LuaEntity extends LuaControl {
7848
8472
  * Train may be included multiple times when braking distance covers this train stop multiple times.
7849
8473
  *
7850
8474
  * Value may be read even when train stop has no control behavior.
8475
+ *
8476
+ * This value is equal to LuaEntity::train_reservations_count + LuaEntity::script_reservations_count.
7851
8477
  */
7852
8478
  readonly trains_count: uint32;
7853
8479
  /**
@@ -7892,6 +8518,10 @@ interface LuaEntity extends LuaControl {
7892
8518
  * The entity prototype type of this entity.
7893
8519
  */
7894
8520
  readonly type: string;
8521
+ /**
8522
+ * Neighbour underground belt connected to this underground belt through underground lines.
8523
+ */
8524
+ readonly underground_belt_neighbour?: LuaEntity;
7895
8525
  /**
7896
8526
  * A unique number identifying this entity for the lifetime of the save. These are allocated sequentially, and not re-used (until overflow).
7897
8527
  *
@@ -7928,6 +8558,15 @@ interface LuaEntity extends LuaControl {
7928
8558
  * Read when this spidertron auto-targets enemies
7929
8559
  */
7930
8560
  vehicle_automatic_targeting_parameters: VehicleAutomaticTargetingParameters;
8561
+ /**
8562
+ * Table of wall-connectable neighbours.
8563
+ */
8564
+ readonly wall_neighbours: {
8565
+ north?: LuaEntity;
8566
+ east?: LuaEntity;
8567
+ south?: LuaEntity;
8568
+ west?: LuaEntity;
8569
+ };
7931
8570
  }
7932
8571
  /**
7933
8572
  * Prototype of an entity.
@@ -7938,6 +8577,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7938
8577
  * The crafting speed of this crafting-machine or character.
7939
8578
  */
7940
8579
  get_crafting_speed(this: void, quality?: QualityID): double;
8580
+ get_duration(this: void, quality?: QualityID): uint32 | null;
7941
8581
  get_energy_distribution_efficiency(this: void, quality?: QualityID): double | null;
7942
8582
  /**
7943
8583
  * Gets the fluid capacity of this entity or 0 if this entity doesn't support fluids.
@@ -7961,7 +8601,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7961
8601
  * Gets the base size of the given inventory on this entity or `nil` if the given inventory doesn't exist.
7962
8602
  * @param quality Defaults to `"normal"`.
7963
8603
  */
7964
- get_inventory_size(this: void, index: defines.inventory, quality?: QualityID): uint32 | null;
8604
+ get_inventory_size(this: void, index: defines.inventory, quality?: QualityID): ItemStackIndex | null;
8605
+ get_inventory_size_bonus(this: void, quality?: QualityID): ItemStackIndex | null;
7965
8606
  /**
7966
8607
  * The maximum circuit wire distance for this entity. 0 if the entity doesn't support circuit wires.
7967
8608
  */
@@ -7994,6 +8635,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7994
8635
  * The maximum power output of this burner generator or generator prototype.
7995
8636
  */
7996
8637
  get_max_power_output(this: void, quality?: QualityID): double | null;
8638
+ /**
8639
+ * The maximum speed of this rolling stock if defined.
8640
+ */
8641
+ get_max_speed(this: void, quality?: QualityID): double | null;
7997
8642
  /**
7998
8643
  * The maximum wire distance for this entity. 0 if the entity doesn't support wires.
7999
8644
  */
@@ -8024,17 +8669,24 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8024
8669
  * @returns `true` if this prototype has the given flag set.
8025
8670
  */
8026
8671
  has_flag(this: void, flag: EntityPrototypeFlag): boolean;
8672
+ readonly absorptions_per_second: Record<string, EnemySpawnerAbsorption>;
8027
8673
  /**
8028
8674
  * A table of pollutions amounts that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution, indexed by the name of each absorbed pollution type.
8029
8675
  */
8030
8676
  readonly absorptions_to_join_attack?: Record<string, float>;
8677
+ readonly acceleration?: double;
8031
8678
  readonly acceleration_rate: double;
8032
8679
  readonly accepted_seeds?: string[];
8680
+ readonly action?: TriggerItem[];
8681
+ readonly action_cooldown?: uint32;
8682
+ readonly action_triggered_automatically?: boolean;
8033
8683
  readonly activation_buffer_ratio?: FluidAmount;
8684
+ readonly activation_distance?: double;
8034
8685
  /**
8035
8686
  * The active energy usage of this rocket silo or combinator prototype.
8036
8687
  */
8037
8688
  readonly active_energy_usage?: double;
8689
+ readonly add_fuel_cooldown?: uint32;
8038
8690
  /**
8039
8691
  * Entities this entity can be pasted onto in addition to the normal allowed ones.
8040
8692
  */
@@ -8044,10 +8696,13 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8044
8696
  */
8045
8697
  readonly affected_by_tiles?: boolean;
8046
8698
  readonly agricultural_tower_radius?: double;
8699
+ readonly ai_settings?: UnitAISettings;
8047
8700
  /**
8048
8701
  * The air resistance of this rolling stock prototype.
8049
8702
  */
8050
8703
  readonly air_resistance?: double;
8704
+ readonly alarm_trigger?: TriggerEffectItem[];
8705
+ readonly alert_after_time: uint32;
8051
8706
  /**
8052
8707
  * The alert icon scale of this entity prototype.
8053
8708
  */
@@ -8068,10 +8723,13 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8068
8723
  * Whether this market allows access to all forces or just friendly ones.
8069
8724
  */
8070
8725
  readonly allow_access_to_all_forces?: boolean;
8726
+ readonly allow_blueprint_connection?: boolean;
8071
8727
  /**
8072
8728
  * Whether this inserter allows burner leeching.
8073
8729
  */
8074
8730
  readonly allow_burner_leech?: boolean;
8731
+ readonly allow_clone_connection?: boolean;
8732
+ readonly allow_container_interaction?: boolean;
8075
8733
  /**
8076
8734
  * When false copy-paste is not allowed for this entity.
8077
8735
  */
@@ -8080,14 +8738,20 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8080
8738
  * Whether this inserter allows custom pickup and drop vectors.
8081
8739
  */
8082
8740
  readonly allow_custom_vectors?: boolean;
8741
+ readonly allow_manual_color?: boolean;
8083
8742
  /**
8084
8743
  * Whether this vehicle allows passengers.
8085
8744
  */
8086
8745
  readonly allow_passengers?: boolean;
8746
+ readonly allow_rail_interaction?: boolean;
8747
+ readonly allow_robot_dispatch_in_automatic_mode?: boolean;
8087
8748
  /**
8088
8749
  * True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)
8089
8750
  */
8090
8751
  readonly allow_run_time_change_of_is_military_target?: boolean;
8752
+ readonly allow_side_loading?: boolean;
8753
+ readonly allow_turning_when_starting_attack?: boolean;
8754
+ readonly allow_unloading?: boolean;
8091
8755
  /**
8092
8756
  * The allowed module effects for this entity, if any.
8093
8757
  */
@@ -8104,6 +8768,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8104
8768
  * Name of the ammo category of this land mine.
8105
8769
  */
8106
8770
  readonly ammo_category?: string;
8771
+ /**
8772
+ * The max stack size of ammo in this artillery turret or artillery wagon.
8773
+ */
8774
+ readonly ammo_stack_limit?: ItemCountType;
8107
8775
  /**
8108
8776
  * The animation speed coefficient of this belt connectable prototype.
8109
8777
  */
@@ -8114,10 +8782,12 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8114
8782
  readonly arm_count_base?: uint32;
8115
8783
  readonly arm_count_quality_scaling?: uint32;
8116
8784
  readonly arm_energy_usage?: double;
8117
- readonly arm_inventory_size_quality_increase?: uint32;
8785
+ readonly arm_inventory_size_quality_increase?: ItemStackIndex;
8118
8786
  readonly arm_slow_energy_usage?: double;
8119
8787
  readonly arm_speed_base?: float;
8120
8788
  readonly arm_speed_quality_scaling?: float;
8789
+ readonly arms_speed_modifier_per_quality_level?: double;
8790
+ readonly attach_to_target?: boolean;
8121
8791
  /**
8122
8792
  * The attack parameters for this entity, if any.
8123
8793
  */
@@ -8127,9 +8797,12 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8127
8797
  * The attack result of this entity, if any.
8128
8798
  */
8129
8799
  readonly attack_result?: TriggerItem[];
8800
+ readonly attack_target_mask: TriggerTargetMask;
8130
8801
  readonly attacking_speed?: double;
8131
8802
  readonly attractor_hit_effect?: TriggerItem[];
8803
+ readonly auto_connect_up_to_n_wires?: uint8;
8132
8804
  readonly auto_setup_collision_box: boolean;
8805
+ readonly auto_sort_inventory?: boolean;
8133
8806
  /**
8134
8807
  * The amount of ammo that inserters automatically insert into this ammo turret, artillery turret or artillery wagon.
8135
8808
  */
@@ -8160,10 +8833,6 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8160
8833
  * The braking force of this vehicle prototype.
8161
8834
  */
8162
8835
  readonly braking_force?: double;
8163
- /**
8164
- * The evolution requirement to build this entity as a base when expanding enemy bases.
8165
- */
8166
- readonly build_base_evolution_requirement: double;
8167
8836
  readonly build_distance?: uint32;
8168
8837
  /**
8169
8838
  * The log2 of {@link grid size | prototype:EntityPrototype::build_grid_size} of the building.
@@ -8182,11 +8851,17 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8182
8851
  */
8183
8852
  readonly burns_fluid?: boolean;
8184
8853
  readonly call_for_help_radius?: double;
8854
+ readonly can_launch_without_landing_pads?: boolean;
8185
8855
  /**
8186
8856
  * Whether this unit prototype can open gates.
8187
8857
  */
8188
8858
  readonly can_open_gates?: boolean;
8859
+ readonly can_retarget_while_starting_attack?: boolean;
8860
+ readonly cant_insert_at_source_message_key?: string;
8861
+ readonly capture_speed?: double;
8189
8862
  readonly captured_spawner_entity?: LuaEntityPrototype;
8863
+ readonly cargo_pod_entity?: LuaEntityPrototype;
8864
+ readonly cargo_station_parameters?: CargoStationParameters;
8190
8865
  /**
8191
8866
  * The chain shooting cooldown modifier of this spider vehicle prototype.
8192
8867
  */
@@ -8196,10 +8871,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8196
8871
  * The chunk exploration radius of this vehicle prototype.
8197
8872
  */
8198
8873
  readonly chunk_exploration_radius?: double;
8874
+ readonly clamps_off_trigger?: TriggerEffectItem[];
8875
+ readonly clamps_on_trigger?: TriggerEffectItem[];
8199
8876
  /**
8200
8877
  * The item prototype name used to destroy this cliff.
8201
8878
  */
8202
8879
  readonly cliff_explosive_prototype?: string;
8880
+ readonly cliff_removal_probability?: double;
8881
+ readonly close_door_trigger_effect?: TriggerEffectItem[];
8203
8882
  readonly collection_box_offset?: float;
8204
8883
  /**
8205
8884
  * The bounding box used for collision checking.
@@ -8209,6 +8888,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8209
8888
  * The collision masks this entity uses
8210
8889
  */
8211
8890
  readonly collision_mask: CollisionMask;
8891
+ readonly collision_mask_allow_on_deep_oil_ocean?: CollisionMask;
8212
8892
  /**
8213
8893
  * Does this prototype collision mask collide with itself?
8214
8894
  */
@@ -8226,8 +8906,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8226
8906
  */
8227
8907
  readonly color?: Color;
8228
8908
  readonly combat_robot_friction?: double;
8909
+ readonly connectable_box?: BoundingBox;
8229
8910
  readonly connection_category: string[];
8230
8911
  readonly connection_distance?: double;
8912
+ readonly connects_to_other_radars?: boolean;
8231
8913
  /**
8232
8914
  * The construction radius for this roboport prototype.
8233
8915
  */
@@ -8283,11 +8965,20 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8283
8965
  speed_from_center: float;
8284
8966
  speed_from_center_deviation: float;
8285
8967
  };
8968
+ readonly creation_shift?: Vector;
8969
+ readonly custom_input_slot_tooltip_key?: string;
8286
8970
  /**
8287
8971
  * When lightning strikes something that is not a lightning attractor, this damage is applied to the target.
8972
+ *
8973
+ * For stickers the damage is applied every {@link LuaEntityPrototype::damage_interval | runtime:LuaEntityPrototype::damage_interval} ticks.
8288
8974
  */
8289
- readonly damage?: double;
8975
+ readonly damage?: DamageParameters;
8290
8976
  readonly damage_hit_tint?: Color;
8977
+ readonly damage_interval?: uint32;
8978
+ readonly damage_multiplier_decrease_per_tick?: float;
8979
+ readonly damage_multiplier_increase_per_added_fuel?: float;
8980
+ readonly damage_per_hp?: float;
8981
+ readonly damage_per_tick?: DamageParameters;
8291
8982
  readonly damaged_trigger_effect?: TriggerEffectItem[];
8292
8983
  /**
8293
8984
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are off.
@@ -8297,12 +8988,46 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8297
8988
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are on.
8298
8989
  */
8299
8990
  readonly darkness_for_all_lamps_on?: float;
8991
+ readonly default_available_construction_output_signal?: SignalID;
8992
+ readonly default_available_logistic_output_signal?: SignalID;
8993
+ readonly default_blue_output_signal?: SignalID;
8994
+ readonly default_blue_signal?: SignalID;
8995
+ readonly default_copy_color_from_train_stop?: boolean;
8996
+ readonly default_day_length_output_signal?: SignalID;
8997
+ readonly default_day_tick_output_signal?: SignalID;
8998
+ readonly default_game_tick_output_signal?: SignalID;
8999
+ readonly default_green_output_signal?: SignalID;
9000
+ readonly default_green_signal?: SignalID;
9001
+ readonly default_orange_output_signal?: SignalID;
9002
+ readonly default_output_signal?: SignalID;
9003
+ readonly default_recipe_finished_signal?: SignalID;
9004
+ readonly default_red_output_signal?: SignalID;
9005
+ readonly default_red_signal?: SignalID;
9006
+ readonly default_rgb_signal?: SignalID;
9007
+ readonly default_roboport_count_output_signal?: SignalID;
9008
+ readonly default_stack_control_input_signal?: SignalID;
9009
+ readonly default_status?: defines.entity_status;
9010
+ readonly default_technology_level_signal?: SignalID;
9011
+ readonly default_temperature_signal?: SignalID;
9012
+ readonly default_total_construction_output_signal?: SignalID;
9013
+ readonly default_total_logistic_output_signal?: SignalID;
9014
+ readonly default_universe_channel?: SignalID;
9015
+ readonly default_working_signal?: SignalID;
9016
+ readonly delay_between_initial_flames?: uint32;
8300
9017
  readonly deposit_radius?: float;
8301
9018
  readonly destroy_action?: TriggerItem[];
8302
9019
  /**
8303
9020
  * Whether this generator prototype destroys non-fuel fluids.
8304
9021
  */
8305
9022
  readonly destroy_non_fuel_fluid?: boolean;
9023
+ readonly destroy_on_empty?: boolean;
9024
+ readonly direction_count?: uint8;
9025
+ readonly direction_only?: boolean;
9026
+ /**
9027
+ * If automatic firing is disabled for this artillery turret or artillery wagon.
9028
+ */
9029
+ readonly disable_automatic_firing?: boolean;
9030
+ readonly disabled_when_recipe_not_researched?: boolean;
8306
9031
  /**
8307
9032
  * The distraction cooldown of this unit prototype.
8308
9033
  */
@@ -8319,6 +9044,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8319
9044
  * The door opening speed for this rocket silo prototype.
8320
9045
  */
8321
9046
  readonly door_opening_speed?: double;
9047
+ readonly doors_trigger?: TriggerEffectItem[];
8322
9048
  /**
8323
9049
  * Whether this logistics or construction robot renders its cargo when flying.
8324
9050
  */
@@ -8327,6 +9053,9 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8327
9053
  * Extra vertical space needed to see the whole entity in GUIs. This is used to calculate the correct zoom and positioning in the entity info gui, for example in the entity tooltip.
8328
9054
  */
8329
9055
  readonly drawing_box_vertical_extension: double;
9056
+ readonly drive_over_elevated_tie_trigger?: TriggerEffectItem[];
9057
+ readonly drive_over_tie_trigger?: TriggerEffectItem[];
9058
+ readonly drive_over_tie_trigger_minimal_speed?: double;
8330
9059
  readonly drop_item_distance?: uint32;
8331
9060
  /**
8332
9061
  * If this mining drill puts full belt stacks onto belts.
@@ -8338,8 +9067,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8338
9067
  */
8339
9068
  readonly dying_speed?: float;
8340
9069
  readonly dying_trigger_effect?: TriggerEffectItem[];
9070
+ readonly early_death_ticks?: uint32;
9071
+ readonly effect_duration?: uint16;
8341
9072
  /**
8342
- * Effect receiver prototype of this crafting machine, lab, or mining drill.
9073
+ * Effect receiver prototype of crafting machine, lab, mining drill, or agricultural tower.
8343
9074
  */
8344
9075
  readonly effect_receiver?: EffectReceiver;
8345
9076
  /**
@@ -8350,10 +9081,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8350
9081
  * The electric energy source prototype this entity uses, if any.
8351
9082
  */
8352
9083
  readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype;
9084
+ readonly elevated_collision_mask?: CollisionMask;
9085
+ readonly elevated_selection_boxes?: BoundingBox[];
9086
+ readonly elevated_selection_priority?: uint8;
8353
9087
  /**
8354
9088
  * A table of pollution emissions per second the entity will create, grouped by the name of the pollution type.
8355
9089
  */
8356
9090
  readonly emissions_per_second: Record<string, double>;
9091
+ readonly ended_in_water_trigger_effect?: TriggerEffectItem[];
8357
9092
  /**
8358
9093
  * The enemy map color used when charting this entity.
8359
9094
  */
@@ -8362,14 +9097,22 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8362
9097
  * When lightning hits a lightning attractor this amount of energy is transferred to the lightning attractor.
8363
9098
  */
8364
9099
  readonly energy?: double;
9100
+ readonly energy_fraction_to_connect?: float;
9101
+ readonly energy_fraction_to_disconnect?: float;
8365
9102
  /**
8366
9103
  * The energy used per hit point taken for this vehicle during collisions.
8367
9104
  */
8368
9105
  readonly energy_per_hit_point?: double;
9106
+ readonly energy_per_item?: double;
8369
9107
  /**
8370
9108
  * The energy consumed per tile moved for this flying robot.
8371
9109
  */
8372
9110
  readonly energy_per_move?: double;
9111
+ readonly energy_per_movement?: double;
9112
+ readonly energy_per_nearby_scan?: double;
9113
+ readonly energy_per_rotation?: double;
9114
+ readonly energy_per_sector?: double;
9115
+ readonly energy_per_shot?: double;
8373
9116
  /**
8374
9117
  * The energy consumed per tick for this flying robot.
8375
9118
  */
@@ -8386,11 +9129,15 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8386
9129
  readonly engine_starting_speed?: double;
8387
9130
  readonly enraged_duration?: MapTick;
8388
9131
  readonly enraged_speed: double;
9132
+ readonly enter_drop_mode_if_held_stack_spoiled?: boolean;
8389
9133
  readonly enter_vehicle_distance?: double;
9134
+ readonly erase_contents_when_mined?: boolean;
9135
+ readonly expires?: boolean;
8390
9136
  /**
8391
9137
  * Whether this explosion has a beam.
8392
9138
  */
8393
9139
  readonly explosion_beam?: double;
9140
+ readonly explosion_effect?: TriggerItem[];
8394
9141
  /**
8395
9142
  * Whether this explosion rotates.
8396
9143
  */
@@ -8404,22 +9151,30 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8404
9151
  */
8405
9152
  readonly fast_replaceable_group?: string;
8406
9153
  /**
8407
- * The filter count of this inserter, loader, mining drill or logistic chest. For logistic containers, `nil` means no limit.
9154
+ * The filter count of this inserter, loader, mining drill, roboport or logistic chest. For logistic containers, `nil` means no limit.
8408
9155
  */
8409
9156
  readonly filter_count?: uint32;
8410
9157
  /**
8411
- * The final attack result for this projectile.
9158
+ * The final attack result for this entity if it has one.
8412
9159
  */
8413
9160
  readonly final_attack_result?: TriggerItem[];
9161
+ readonly fire_spread_cooldown?: uint8;
9162
+ readonly fire_spread_entity?: LuaEntityPrototype;
9163
+ readonly fire_spread_radius?: float;
9164
+ /**
9165
+ * The fixed recipe quality for this assembling machine prototype, if any.
9166
+ */
9167
+ readonly fixed_quality?: LuaQualityPrototype;
8414
9168
  /**
8415
- * The fixed recipe name for this assembling machine prototype, if any.
9169
+ * The fixed recipe for this assembling machine prototype, if any.
8416
9170
  */
8417
- readonly fixed_recipe?: string;
9171
+ readonly fixed_recipe?: LuaRecipePrototype;
8418
9172
  /**
8419
9173
  * The flags for this entity prototype.
8420
9174
  */
8421
9175
  readonly flags: EntityPrototypeFlags;
8422
9176
  readonly flow_scaling?: boolean;
9177
+ readonly fluid_boxes_off_when_no_fluid_recipe?: boolean;
8423
9178
  readonly fluid_buffer_input_flow?: FluidAmount;
8424
9179
  readonly fluid_buffer_size?: FluidAmount;
8425
9180
  /**
@@ -8433,10 +9188,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8433
9188
  */
8434
9189
  readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype;
8435
9190
  readonly fluid_source_offset?: Vector;
8436
- /**
8437
- * The fluid usage of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_fluid_usage_per_tick | runtime:LuaEntityPrototype::get_fluid_usage_per_tick} and should not be used.
8438
- */
8439
- readonly fluid_usage_per_tick?: double;
9191
+ readonly fluid_wagon_connector_speed?: double;
9192
+ readonly fluid_wagon_tank_valve_max_distance?: double;
8440
9193
  /**
8441
9194
  * The fluidbox prototypes for this entity.
8442
9195
  */
@@ -8445,11 +9198,18 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8445
9198
  * The flying acceleration for this rocket silo rocket prototype.
8446
9199
  */
8447
9200
  readonly flying_acceleration?: double;
9201
+ readonly flying_collision_mask?: CollisionMask;
8448
9202
  /**
8449
9203
  * The flying speed for this rocket silo rocket prototype.
8450
9204
  */
8451
9205
  readonly flying_speed?: double;
9206
+ readonly flying_trigger?: TriggerEffectItem[];
9207
+ readonly folded_turret_corpses?: Record<string, LuaEntityPrototype>;
8452
9208
  readonly follows_player?: boolean;
9209
+ readonly footprint_particles?: LuaTable<LuaTilePrototype, LuaParticlePrototype[]>;
9210
+ readonly footstep_particle_triggers?: LuaTable<LuaTilePrototype, TriggerEffectItem[]>;
9211
+ readonly force_die_on_attack?: boolean;
9212
+ readonly force_visibility?: ForceCondition;
8453
9213
  /**
8454
9214
  * The friction of this vehicle prototype.
8455
9215
  */
@@ -8458,13 +9218,19 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8458
9218
  * The friendly map color used when charting this entity.
8459
9219
  */
8460
9220
  readonly friendly_map_color: Color;
9221
+ readonly grab_less_to_match_belt_stack?: boolean;
9222
+ readonly grid_offset?: Vector;
8461
9223
  /**
8462
9224
  * The equipment grid prototype for this entity, if any.
8463
9225
  */
8464
9226
  readonly grid_prototype?: LuaEquipmentGridPrototype;
9227
+ readonly grid_size?: Vector;
9228
+ readonly grounded_landing_search_radius?: double;
8465
9229
  readonly growth_area_radius?: double;
8466
9230
  readonly growth_grid_tile_size?: uint32;
8467
9231
  readonly growth_ticks?: uint32;
9232
+ readonly gui_mode?: 'all' | 'none' | 'admins';
9233
+ readonly gui_title_key?: string;
8468
9234
  /**
8469
9235
  * A mapping of the gun name to the gun prototype this prototype uses. `nil` if this entity prototype doesn't use guns.
8470
9236
  */
@@ -8477,6 +9243,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8477
9243
  * Whether this unit, car, or character prototype has belt immunity.
8478
9244
  */
8479
9245
  readonly has_belt_immunity?: boolean;
9246
+ readonly has_direction?: boolean;
9247
+ readonly hatch_definitions?: CargoHatchDefinition[];
8480
9248
  readonly head_collection_radius?: float;
8481
9249
  /**
8482
9250
  * Amount this entity can heal per tick, if any.
@@ -8494,14 +9262,18 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8494
9262
  * The energy required to keep this entity from freezing. Zero energy means it doesn't freeze.
8495
9263
  */
8496
9264
  readonly heating_energy: double;
9265
+ readonly heating_radius?: float;
8497
9266
  /**
8498
- * The height of this spider vehicle prototype.
9267
+ * The height of this spider unit, spider vehicle or projectile.
8499
9268
  */
8500
9269
  readonly height?: double;
9270
+ readonly height_from_ground?: float;
8501
9271
  readonly held_items_display_count?: uint8;
8502
9272
  readonly held_items_offset?: float;
8503
9273
  readonly held_items_spread?: float;
8504
9274
  readonly hide_resistances?: boolean;
9275
+ readonly hit_at_collision_position?: boolean;
9276
+ readonly hit_collision_mask?: CollisionMask;
8505
9277
  /**
8506
9278
  * The definition of where and how the alt-mode icons of this entity should be drawn.
8507
9279
  */
@@ -8510,6 +9282,11 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8510
9282
  * The icon positioning for inventories of this entity, if defined.
8511
9283
  */
8512
9284
  readonly icons_positioning?: IconSequencePositioning[];
9285
+ readonly ignore_target_mask: TriggerTargetMask;
9286
+ readonly immune_to_all_impacts?: boolean;
9287
+ readonly immune_to_cliff_impacts?: boolean;
9288
+ readonly immune_to_rock_impacts?: boolean;
9289
+ readonly immune_to_tree_impacts?: boolean;
8513
9290
  /**
8514
9291
  * A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
8515
9292
  */
@@ -8526,6 +9303,13 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8526
9303
  * The max number of ingredients this crafting machine prototype supports.
8527
9304
  */
8528
9305
  readonly ingredient_count?: uint32;
9306
+ readonly initial_action?: TriggerItem[];
9307
+ readonly initial_flame_count?: uint8;
9308
+ readonly initial_height?: float;
9309
+ readonly initial_lifetime?: uint32;
9310
+ readonly initial_speed?: Vector;
9311
+ readonly initial_vertical_speed?: float;
9312
+ readonly input_connection_bounding_box?: BoundingBox;
8529
9313
  /**
8530
9314
  * True if this inserter chases items on belts for pickup.
8531
9315
  */
@@ -8551,10 +9335,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8551
9335
  */
8552
9336
  readonly instruments?: ProgrammableSpeakerInstrument[];
8553
9337
  /**
8554
- * Properties of custom inventory. Only provided if inventory_type is `"with_custom_stack_size"`.
9338
+ * Properties of custom inventory. Only provided if `inventory_type` is `"with_custom_stack_size"`.
8555
9339
  */
8556
9340
  readonly inventory_properties?: InventoryWithCustomStackSizeSpecification;
8557
- readonly inventory_size_quality_increase?: uint32;
9341
+ readonly inventory_size_quality_increase?: ItemStackIndex;
8558
9342
  /**
8559
9343
  * The inventory type this container or linked container uses.
8560
9344
  */
@@ -8651,10 +9435,16 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8651
9435
  * The rocket launch delay for this rocket silo prototype.
8652
9436
  */
8653
9437
  readonly launch_wait_time?: uint8;
9438
+ readonly leave_attacking_if_shoot_fails?: boolean;
9439
+ readonly life_time?: uint16;
9440
+ readonly lifetime_increase_by?: uint32;
9441
+ readonly lifetime_increase_cooldown?: uint32;
9442
+ readonly lift_weight?: Weight;
8654
9443
  /**
8655
9444
  * The light blinking speed for this rocket silo prototype.
8656
9445
  */
8657
9446
  readonly light_blinking_speed?: double;
9447
+ readonly limit_overlapping_particles?: boolean;
8658
9448
  /**
8659
9449
  * True if this loader supports a runtime-adjustable belt stack size.
8660
9450
  */
@@ -8700,7 +9490,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8700
9490
  /**
8701
9491
  * Loot that will be dropped when this entity is killed, if any.
8702
9492
  */
8703
- readonly loot?: Loot[];
9493
+ readonly loot?: ItemProduct[];
8704
9494
  readonly loot_pickup_distance?: double;
8705
9495
  /**
8706
9496
  * The manual range modifier for this artillery turret or wagon prototype.
@@ -8714,6 +9504,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8714
9504
  * The bounding box used for map generator collision checking.
8715
9505
  */
8716
9506
  readonly map_generator_bounding_box: BoundingBox;
9507
+ readonly map_grid?: boolean;
8717
9508
  /**
8718
9509
  * Count of defensive enemies this spawner can sustain.
8719
9510
  */
@@ -8751,18 +9542,20 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8751
9542
  * The maximum polyphony for this programmable speaker.
8752
9543
  */
8753
9544
  readonly max_polyphony?: uint32;
8754
- /**
8755
- * The default maximum power output of this generator prototype. This property is deprecated in favor of {@link LuaEntityPrototype::get_max_power_output | runtime:LuaEntityPrototype::get_max_power_output} and should not be used.
8756
- */
8757
- readonly max_power_output?: double;
8758
9545
  /**
8759
9546
  * The maximum pursue distance of this unit prototype.
8760
9547
  */
8761
9548
  readonly max_pursue_distance?: double;
9549
+ readonly max_records_count?: uint32;
9550
+ readonly max_richness_for_spawn_shift?: double;
9551
+ readonly max_separation_force?: double;
9552
+ readonly max_snap_to_train_stop_distance?: float;
8762
9553
  /**
8763
9554
  * The max speed of this projectile or flying robot prototype.
8764
9555
  */
8765
9556
  readonly max_speed?: double;
9557
+ readonly max_text_length?: uint32;
9558
+ readonly max_text_width?: uint32;
8766
9559
  /**
8767
9560
  * The maximum energy for this flying robot above which it won't try to recharge when stationing.
8768
9561
  */
@@ -8772,10 +9565,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8772
9565
  */
8773
9566
  readonly max_underground_distance?: uint8;
8774
9567
  readonly maximum_corner_sliding_distance?: double;
9568
+ readonly maximum_damage_multiplier?: float;
9569
+ readonly maximum_lifetime?: uint32;
9570
+ readonly maximum_spread_count?: uint16;
8775
9571
  /**
8776
9572
  * The maximum fluid temperature of this generator prototype.
8777
9573
  */
8778
9574
  readonly maximum_temperature?: double;
9575
+ readonly meltdown_action?: TriggerItem[];
8779
9576
  /**
8780
9577
  * The minimum darkness at which this unit spawner can spawn entities.
8781
9578
  */
@@ -8817,6 +9614,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8817
9614
  * Whether this unit prototype can move while shooting.
8818
9615
  */
8819
9616
  readonly move_while_shooting?: boolean;
9617
+ readonly movement_modifier?: double;
9618
+ readonly movement_modifier_when_on_ground?: double;
8820
9619
  readonly neighbour_bonus?: double;
8821
9620
  readonly neighbour_connectable?: NeighbourConnectable;
8822
9621
  /**
@@ -8827,47 +9626,81 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8827
9626
  * The normal amount for this resource.
8828
9627
  */
8829
9628
  readonly normal_resource_amount?: uint32;
9629
+ readonly not_buildable_if_no_rails?: boolean;
8830
9630
  /**
8831
9631
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
8832
9632
  */
8833
9633
  readonly object_name: string;
9634
+ readonly on_damage_tick_effect?: TriggerItem[];
9635
+ readonly on_fuel_added_action?: TriggerItem[];
9636
+ readonly open_door_trigger_effect?: TriggerEffectItem[];
9637
+ readonly opened_collision_mask?: CollisionMask;
9638
+ readonly opening_speed?: float;
9639
+ readonly orientations?: OrientedCliffPrototypeSet;
9640
+ readonly output_connection_bounding_box?: BoundingBox;
8834
9641
  readonly overkill_fraction?: float;
9642
+ readonly particle?: LuaParticlePrototype;
9643
+ readonly particle_buffer_size?: uint16;
9644
+ readonly particle_count?: uint8;
9645
+ readonly particle_height?: DeviatedValue;
9646
+ readonly particle_horizontal_speed?: DeviatedValue;
9647
+ readonly particle_spawn_interval?: uint16;
9648
+ readonly particle_spawn_timeout?: uint16;
9649
+ readonly particle_time_before_start?: DeviatedValue;
9650
+ readonly particle_time_to_live?: DeviatedValue;
9651
+ readonly particle_vertical_acceleration?: float;
9652
+ readonly particle_vertical_speed?: DeviatedValue;
8835
9653
  readonly passive_energy_usage?: double;
8836
9654
  readonly patrolling_speed?: double;
8837
9655
  readonly patrolling_turn_radius?: double;
8838
9656
  readonly per_lane_filters?: boolean;
8839
9657
  readonly perceived_performance?: PerceivedPerformance;
9658
+ readonly piercing_damage?: float;
9659
+ readonly place_as_crater?: CraterPlacementDefinition;
9660
+ /**
9661
+ * Repair speed of entities is multiplied by this value when they are on a space platform with this hub prototype.
9662
+ */
9663
+ readonly platform_repair_speed_modifier?: float;
9664
+ /**
9665
+ * Weight which this entity adds to total space platform weight when placed.
9666
+ */
9667
+ readonly platform_weight?: Weight;
9668
+ readonly prepare_with_no_ammo?: boolean;
9669
+ readonly preserve_contents_when_created?: boolean;
8840
9670
  /**
8841
9671
  * The beacon profile: extra multiplier applied to the effects received from beacon by the effect receiver based on amount of beacons that reach that effect receiver
8842
9672
  */
8843
9673
  readonly profile?: double[];
9674
+ readonly progress_to_create_smoke?: float;
8844
9675
  /**
8845
9676
  * True if this entity prototype should be included during tile collision checks with {@link LuaTilePrototype::check_collision_with_entities | runtime:LuaTilePrototype::check_collision_with_entities} enabled.
8846
9677
  */
8847
9678
  readonly protected_from_tile_building: boolean;
8848
- /**
8849
- * The pumping speed of this offshore pump or normal pump. This property is deprecated in favor of {@link LuaEntityPrototype::get_pumping_speed | runtime:LuaEntityPrototype::get_pumping_speed} and should not be used.
8850
- */
8851
- readonly pumping_speed?: double;
9679
+ readonly pulse_duration?: uint32;
8852
9680
  readonly quality_affects_capacity?: boolean;
8853
9681
  readonly quality_affects_energy_usage?: boolean;
8854
9682
  readonly quality_affects_inventory_size?: boolean;
9683
+ readonly quality_affects_max_speed?: boolean;
8855
9684
  readonly quality_affects_mining_radius?: boolean;
8856
9685
  readonly quality_affects_module_slots?: boolean;
8857
9686
  readonly quality_affects_supply_area_distance?: boolean;
8858
- /**
8859
- * The radar range of this unit prototype.
8860
- */
8861
9687
  readonly radar_range?: uint32;
8862
9688
  /**
8863
9689
  * The radius of this entity prototype. The radius is defined as half the distance between the top left corner and bottom right corner of the collision box.
8864
9690
  */
8865
9691
  readonly radius: double;
8866
9692
  readonly radius_visualisation_specification?: RadiusVisualisationSpecification;
9693
+ readonly raise_rocket_trigger?: TriggerEffectItem[];
8867
9694
  readonly random_corpse_variation?: boolean;
9695
+ readonly random_growth_offset?: double;
9696
+ readonly randomize_planting_tile?: boolean;
8868
9697
  readonly range_from_player?: double;
8869
9698
  readonly reach_distance?: uint32;
8870
9699
  readonly reach_resource_distance?: double;
9700
+ readonly recharge_minimum?: double;
9701
+ readonly regular_trigger_effect?: TriggerEffectItem[];
9702
+ readonly regular_trigger_effect_frequency?: uint32;
9703
+ readonly related_rail?: LuaEntityPrototype;
8871
9704
  readonly related_underground_belt?: LuaEntityPrototype;
8872
9705
  /**
8873
9706
  * The remains left behind when this entity is mined.
@@ -8877,10 +9710,21 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8877
9710
  * Whether this entity should remove decoratives that collide with it when this entity is built.
8878
9711
  */
8879
9712
  readonly remove_decoratives: 'automatic' | 'true' | 'false';
9713
+ readonly remove_on_entity_placement?: boolean;
9714
+ readonly remove_on_tile_collision?: boolean;
9715
+ readonly remove_on_tile_placement?: boolean;
8880
9716
  /**
8881
9717
  * Repair-speed modifier for this entity, if any. Actual repair speed will be `tool_repair_speed * entity_repair_speed_modifier`.
8882
9718
  */
8883
9719
  readonly repair_speed_modifier?: float;
9720
+ /**
9721
+ * If this robot with logistic interface requires it be charged to manually mine.
9722
+ */
9723
+ readonly require_charge_to_mine?: boolean;
9724
+ /**
9725
+ * If this drill requires minable resources before it can be placed.
9726
+ */
9727
+ readonly require_resources_to_place?: boolean;
8884
9728
  /**
8885
9729
  * List of resistances towards each damage type. It is a dictionary indexed by damage type names (see `data/base/prototypes/damage-type.lua`).
8886
9730
  */
@@ -8901,11 +9745,13 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8901
9745
  * The resource drain rate percent of this mining drill prototype.
8902
9746
  */
8903
9747
  readonly resource_drain_rate_percent?: uint8;
9748
+ readonly resource_patch_search_radius?: uint32;
8904
9749
  readonly respawn_time?: uint32;
8905
9750
  /**
8906
9751
  * The result units and spawn points with weight and evolution factor for a biter spawner entity.
8907
9752
  */
8908
9753
  readonly result_units?: UnitSpawnDefinition[];
9754
+ readonly reveal_map?: boolean;
8909
9755
  /**
8910
9756
  * The revenge attack parameters for this entity, if any. These attack parameters are used in addition to {@link LuaEntityPrototype::attack_parameters | runtime:LuaEntityPrototype::attack_parameters} if the entity is attacking a target that has previously dealt damage to the entity.
8911
9757
  */
@@ -8916,6 +9762,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8916
9762
  * The rising speed for this rocket silo rocket prototype.
8917
9763
  */
8918
9764
  readonly rising_speed?: double;
9765
+ readonly rocket_dying_explosion?: LuaEntityPrototype;
9766
+ readonly rocket_engine_starting_speed_modifier_per_quality_level?: double;
8919
9767
  /**
8920
9768
  * The rocket entity prototype associated with this rocket silo prototype.
8921
9769
  */
@@ -8924,10 +9772,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8924
9772
  * The rocket parts required for this rocket silo prototype.
8925
9773
  */
8926
9774
  readonly rocket_parts_required?: uint32;
9775
+ readonly rocket_parts_storage_cap?: uint32;
9776
+ readonly rocket_quick_relaunch_start_offset?: double;
8927
9777
  /**
8928
9778
  * The rocket rising delay for this rocket silo prototype.
8929
9779
  */
8930
9780
  readonly rocket_rising_delay?: uint8;
9781
+ readonly rocket_rising_speed_modifier_per_quality_level?: double;
9782
+ readonly rotatable?: boolean;
8931
9783
  /**
8932
9784
  * The rotation snap angle of this car prototype.
8933
9785
  */
@@ -8940,6 +9792,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8940
9792
  * The movement speed of this character prototype.
8941
9793
  */
8942
9794
  readonly running_speed?: double;
9795
+ readonly scale_energy_usage?: boolean;
8943
9796
  /**
8944
9797
  * Whether this generator prototype scales fluid usage.
8945
9798
  */
@@ -8948,6 +9801,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8948
9801
  * How much science pack durability is required to research one science point.
8949
9802
  */
8950
9803
  readonly science_pack_drain_rate_percent: uint8;
9804
+ readonly search_radius?: double;
8951
9805
  /**
8952
9806
  * The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.
8953
9807
  */
@@ -8965,13 +9819,28 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8965
9819
  * The selection priority of this entity - a value between `0` and `255`.
8966
9820
  */
8967
9821
  readonly selection_priority: uint32;
9822
+ readonly separation_force_factor?: double;
9823
+ readonly separation_range?: double;
9824
+ readonly shadow_slave_entity?: LuaEntityPrototype;
9825
+ readonly shoot_in_prepare_state?: boolean;
8968
9826
  /**
8969
9827
  * The cursor size used when shooting at this entity.
8970
9828
  */
8971
9829
  readonly shooting_cursor_size: float;
9830
+ readonly shot_category?: LuaAmmoCategoryPrototype;
9831
+ readonly shots_per_flare?: uint32;
9832
+ readonly should_ground_target?: boolean;
9833
+ readonly shuffle_resources_to_mine?: boolean;
9834
+ readonly smoke?: LuaTrivialSmokePrototype;
9835
+ readonly smoke_count?: uint16;
9836
+ readonly smoke_sources?: SmokeSource[];
9837
+ readonly snap_to_spots_distance?: float;
8972
9838
  readonly solar_panel_performance_at_day: double;
8973
9839
  readonly solar_panel_performance_at_night: double;
8974
9840
  readonly solar_panel_solar_coefficient_property: LuaSurfacePropertyPrototype;
9841
+ readonly source_offset?: Vector;
9842
+ readonly source_variance?: Vector;
9843
+ readonly spawn_blocked_trigger?: TriggerItem[];
8975
9844
  /**
8976
9845
  * The spawning cooldown for this enemy spawner prototype.
8977
9846
  */
@@ -8981,6 +9850,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8981
9850
  };
8982
9851
  readonly spawn_decoration?: TriggerEffectItem[];
8983
9852
  readonly spawn_decorations_on_expansion?: boolean;
9853
+ readonly spawn_entity?: LuaEntityPrototype;
8984
9854
  /**
8985
9855
  * How far from the spawner can the units be spawned.
8986
9856
  */
@@ -8993,19 +9863,43 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
8993
9863
  * The spawning time modifier of this unit prototype.
8994
9864
  */
8995
9865
  readonly spawning_time_modifier?: double;
9866
+ readonly special_neutral_target_damage?: DamageParameters;
8996
9867
  /**
8997
- * The default speed of this flying robot, rolling stock or unit. For rolling stocks, this is their `max_speed`.
9868
+ * The default speed of this flying robot, or unit.
8998
9869
  */
8999
9870
  readonly speed?: double;
9871
+ readonly speed_modifier?: Vector;
9000
9872
  /**
9001
9873
  * The speed multiplier when this flying robot is out of energy.
9002
9874
  */
9003
9875
  readonly speed_multiplier_when_out_of_energy?: float;
9876
+ readonly spent_fluid?: SpentFluidSpecification;
9004
9877
  readonly spider_engine?: SpiderEngineSpecification;
9878
+ readonly spread_delay?: uint32;
9879
+ readonly spread_delay_deviation?: uint32;
9880
+ readonly start_attacking_only_when_can_shoot?: boolean;
9881
+ readonly steering_settings?: SteeringSettings;
9005
9882
  /**
9006
9883
  * The bounding box used to attach sticker type entities.
9007
9884
  */
9008
9885
  readonly sticker_box: BoundingBox;
9886
+ readonly sticker_movement_modifiers?: {
9887
+ target_movement_modifier_from: float;
9888
+ target_movement_modifier_to: float;
9889
+ target_movement_max_from: float;
9890
+ target_movement_max_to: float;
9891
+ };
9892
+ readonly sticker_vehicle_modifiers?: {
9893
+ vehicle_speed_modifier_from: float;
9894
+ vehicle_speed_modifier_to: float;
9895
+ vehicle_speed_max_from: float;
9896
+ vehicle_speed_max_to: float;
9897
+ vehicle_friction_modifier_from: float;
9898
+ vehicle_friction_modifier_to: float;
9899
+ };
9900
+ readonly stickers_per_square_meter?: float;
9901
+ readonly stream_particle_horizontal_speed?: float;
9902
+ readonly stream_particle_horizontal_speed_deviation?: float;
9009
9903
  readonly strike_effect?: TriggerItem[];
9010
9904
  readonly support_range?: float;
9011
9905
  /**
@@ -9016,10 +9910,13 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9016
9910
  * The surface conditions required to build this entity.
9017
9911
  */
9018
9912
  readonly surface_conditions?: SurfaceCondition[];
9913
+ readonly synced_footstep_particle_triggers?: LuaTable<LuaTilePrototype, TriggerEffectItem[]>;
9019
9914
  /**
9020
9915
  * If this car prototype uses tank controls to drive.
9021
9916
  */
9022
9917
  readonly tank_driving?: boolean;
9918
+ readonly target_initial_position_only?: boolean;
9919
+ readonly target_position_deviation?: double;
9023
9920
  /**
9024
9921
  * The target temperature of this boiler or fusion reactor prototype. If `nil` on a fusion reactor, the target temperature is the default temperature of the output fluid.
9025
9922
  */
@@ -9034,6 +9931,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9034
9931
  readonly ticks_to_keep_aiming_direction?: uint32;
9035
9932
  readonly ticks_to_keep_gun?: uint32;
9036
9933
  readonly ticks_to_stay_in_combat?: uint32;
9934
+ readonly tie_distance?: double;
9037
9935
  readonly tile_buildability_rules?: TileBuildabilityRule[];
9038
9936
  /**
9039
9937
  * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)
@@ -9043,14 +9941,19 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9043
9941
  * Specifies the tiling size of the entity, is used to decide, if the center should be in the center of the tile (odd tile size dimension) or on the tile border (even tile size dimension)
9044
9942
  */
9045
9943
  readonly tile_width: uint32;
9944
+ readonly time_to_capture?: MapTick;
9945
+ readonly time_to_damage?: uint16;
9046
9946
  /**
9047
9947
  * The time to live for this prototype or `0` if prototype doesn't have time_to_live or time_before_removed.
9048
9948
  */
9049
- readonly time_to_live: uint32;
9949
+ readonly time_to_live: MapTick;
9050
9950
  /**
9051
9951
  * The time it takes this land mine to arm.
9052
9952
  */
9053
9953
  readonly timeout?: uint32;
9954
+ readonly timeout_to_close?: uint32;
9955
+ readonly tool_attack_distance?: double;
9956
+ readonly tool_attack_result?: TriggerItem[];
9054
9957
  /**
9055
9958
  * The torso bob speed of this spider vehicle prototype.
9056
9959
  */
@@ -9059,14 +9962,23 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9059
9962
  * The torso rotation speed of this spider vehicle prototype.
9060
9963
  */
9061
9964
  readonly torso_rotation_speed?: double;
9965
+ readonly track_coverage_during_drag_building?: boolean;
9966
+ readonly track_particle_triggers: LuaTable<LuaTilePrototype, TriggerEffectItem[]>;
9967
+ readonly transition_collision_mask?: CollisionMask;
9062
9968
  /**
9063
9969
  * If it is a tree, return the number of colors it supports.
9064
9970
  */
9065
9971
  readonly tree_color_count?: uint8;
9972
+ readonly tree_dying_factor?: float;
9973
+ readonly tree_removal_max_distance?: double;
9974
+ readonly tree_removal_probability?: double;
9066
9975
  /**
9067
9976
  * The collision mask entities must collide with to make this landmine blow up.
9068
9977
  */
9069
9978
  readonly trigger_collision_mask?: CollisionMask;
9979
+ readonly trigger_force?: ForceCondition;
9980
+ readonly trigger_interval?: uint32;
9981
+ readonly trigger_radius?: double;
9070
9982
  /**
9071
9983
  * The trigger target mask for this entity prototype type.
9072
9984
  *
@@ -9075,12 +9987,16 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9075
9987
  readonly trigger_target_mask: Record<string, boolean>;
9076
9988
  readonly turn_radius?: double;
9077
9989
  readonly turn_smoothing?: double;
9990
+ readonly turn_speed?: float;
9991
+ readonly turning_speed_increases_exponentially_with_projectile_speed?: boolean;
9992
+ readonly turret_base_has_direction?: boolean;
9993
+ readonly turret_prepare_range?: double;
9078
9994
  /**
9079
9995
  * The range of this turret.
9080
9996
  */
9081
9997
  readonly turret_range?: uint32;
9082
9998
  /**
9083
- * The turret rotation speed of this car prototype.
9999
+ * The turret rotation speed of this prototype.
9084
10000
  */
9085
10001
  readonly turret_rotation_speed?: float;
9086
10002
  readonly two_direction_only?: boolean;
@@ -9093,10 +10009,15 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9093
10009
  * The trigger effects to run every tick when on cooldown while the owning {@link LuaSegmentedUnit | runtime:LuaSegmentedUnit} is enraged.
9094
10010
  */
9095
10011
  readonly update_effects_while_enraged?: TriggerEffectWithCooldown[];
10012
+ readonly use_damage_substitute?: boolean;
10013
+ readonly use_easter_egg?: boolean;
9096
10014
  /**
9097
10015
  * Whether this logistic container prototype uses exact mode
9098
10016
  */
9099
10017
  readonly use_exact_mode?: boolean;
10018
+ readonly use_mirroring?: boolean;
10019
+ readonly use_unloading_distance_limit?: boolean;
10020
+ readonly uses_alternative_behavior?: boolean;
9100
10021
  /**
9101
10022
  * If this drill uses force productivity bonus
9102
10023
  */
@@ -9131,10 +10052,12 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
9131
10052
  * The void energy source prototype this entity uses, if any.
9132
10053
  */
9133
10054
  readonly void_energy_source_prototype?: LuaVoidEnergySourcePrototype;
10055
+ readonly wait_for_full_hand?: boolean;
9134
10056
  /**
9135
10057
  * The weight of this vehicle prototype.
9136
10058
  */
9137
10059
  readonly weight?: double;
10060
+ readonly width?: float;
9138
10061
  }
9139
10062
  /**
9140
10063
  * An item in a {@link LuaEquipmentGrid | runtime:LuaEquipmentGrid}, for example a fusion reactor placed in one's power armor.
@@ -9146,6 +10069,10 @@ interface LuaEquipment {
9146
10069
  * The burner energy source for this equipment, if any.
9147
10070
  */
9148
10071
  readonly burner?: LuaBurner;
10072
+ /**
10073
+ * The power buffer size of this ElectricEnergyInterfaceEquipment.
10074
+ */
10075
+ electric_buffer_size: double;
9149
10076
  /**
9150
10077
  * Current available energy.
9151
10078
  */
@@ -9198,6 +10125,14 @@ interface LuaEquipment {
9198
10125
  * Position of this equipment in the equipment grid.
9199
10126
  */
9200
10127
  readonly position: EquipmentPosition;
10128
+ /**
10129
+ * The power production specific to the ElectricEnergyInterfaceEquipment type.
10130
+ */
10131
+ power_production: double;
10132
+ /**
10133
+ * The power usage specific to the ElectricEnergyInterfaceEquipment type.
10134
+ */
10135
+ power_usage: double;
9201
10136
  readonly prototype: LuaEquipmentPrototype;
9202
10137
  /**
9203
10138
  * Quality of this equipment.
@@ -9471,6 +10406,7 @@ interface LuaEquipmentPrototype extends LuaPrototypeBase {
9471
10406
  * The burner energy source prototype this equipment uses, if any.
9472
10407
  */
9473
10408
  readonly burner_prototype?: LuaBurnerPrototype;
10409
+ readonly darkness_to_turn_on?: float;
9474
10410
  /**
9475
10411
  * The electric energy source prototype this equipment uses, if any.
9476
10412
  */
@@ -9491,6 +10427,7 @@ interface LuaEquipmentPrototype extends LuaPrototypeBase {
9491
10427
  * Category names for this equipment. These {@link categories | runtime:LuaEquipmentGridPrototype::equipment_categories} will be used to determine whether this equipment is allowed in a particular equipment grid.
9492
10428
  */
9493
10429
  readonly equipment_categories: string[];
10430
+ readonly gui_mode?: 'all' | 'none' | 'admins';
9494
10431
  /**
9495
10432
  * The logistic parameters for this roboport equipment.
9496
10433
  */
@@ -9527,9 +10464,9 @@ interface LuaEquipmentPrototype extends LuaPrototypeBase {
9527
10464
  */
9528
10465
  points?: EquipmentPoint[];
9529
10466
  };
9530
- readonly solar_panel_performance_at_day: double;
9531
- readonly solar_panel_performance_at_night: double;
9532
- readonly solar_panel_solar_coefficient_property: LuaSurfacePropertyPrototype;
10467
+ readonly solar_panel_performance_at_day?: double;
10468
+ readonly solar_panel_performance_at_night?: double;
10469
+ readonly solar_panel_solar_coefficient_property?: LuaSurfacePropertyPrototype;
9533
10470
  /**
9534
10471
  * The result item when taking this equipment out of an equipment grid, if any.
9535
10472
  */
@@ -9555,6 +10492,20 @@ interface LuaFlowStatistics {
9555
10492
  * Reset all the statistics data to 0.
9556
10493
  */
9557
10494
  clear(this: void): void;
10495
+ /**
10496
+ * Gets the current-tick input sample for a given prototype.
10497
+ *
10498
+ * These values get merged into the input counts at the end of the tick.
10499
+ * @param id The prototype ID.
10500
+ */
10501
+ get_current_input_sample(this: void, id: FlowStatisticsID): double;
10502
+ /**
10503
+ * Gets the current-tick output sample for a given prototype.
10504
+ *
10505
+ * These values get merged into the output counts at the end of the tick.
10506
+ * @param id The prototype ID.
10507
+ */
10508
+ get_current_output_sample(this: void, id: FlowStatisticsID): double;
9558
10509
  /**
9559
10510
  * Gets the flow count value for the given time frame. If `sample_index` is not provided, then the value returned is the average across the provided precision time period. These are the values shown in the bottom section of the statistics GUIs.
9560
10511
  *
@@ -9595,6 +10546,22 @@ interface LuaFlowStatistics {
9595
10546
  * @param count The count: positive or negative determines if the value goes in the input or output statistics.
9596
10547
  */
9597
10548
  on_flow(this: void, id: FlowStatisticsID, count: float): void;
10549
+ /**
10550
+ * Sets the current-tick input sample for a given prototype.
10551
+ *
10552
+ * These values get merged into the input counts at the end of the tick.
10553
+ * @param id The prototype ID.
10554
+ * @param count The new count.
10555
+ */
10556
+ set_current_input_sample(this: void, id: FlowStatisticsID, count: double): void;
10557
+ /**
10558
+ * Sets the current-tick output sample for a given prototype.
10559
+ *
10560
+ * These values get merged into the output counts at the end of the tick.
10561
+ * @param id The prototype ID.
10562
+ * @param count The new count.
10563
+ */
10564
+ set_current_output_sample(this: void, id: FlowStatisticsID, count: double): void;
9598
10565
  /**
9599
10566
  * Sets the total input count for a given prototype.
9600
10567
  * @param id The prototype ID.
@@ -9613,6 +10580,14 @@ interface LuaFlowStatistics {
9613
10580
  * @param count The new count. The type depends on the instance of the statistics.
9614
10581
  */
9615
10582
  set_storage_count(this: void, id: FlowStatisticsID, count: uint64 | double): void;
10583
+ /**
10584
+ * A mapping of quality name to a list of current tick input samples indexed by prototype name.
10585
+ */
10586
+ readonly current_input_quality_samples: Record<string, Record<string, double>>;
10587
+ /**
10588
+ * A mapping of quality name to a list of current tick output samples indexed by prototype name.
10589
+ */
10590
+ readonly current_output_quality_samples: Record<string, Record<string, double>>;
9616
10591
  /**
9617
10592
  * The force these statistics belong to. `nil` for pollution statistics.
9618
10593
  */
@@ -9621,6 +10596,10 @@ interface LuaFlowStatistics {
9621
10596
  * List of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for the given statistics.
9622
10597
  */
9623
10598
  readonly input_counts: Record<string, uint64 | double>;
10599
+ /**
10600
+ * A mapping of quality name to a list of input counts indexed by prototype name. Represents the data that is shown on the left side of the GUI for the given statistics.
10601
+ */
10602
+ readonly input_quality_counts: Record<string, Record<string, uint64 | double>>;
9624
10603
  /**
9625
10604
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
9626
10605
  */
@@ -9630,143 +10609,30 @@ interface LuaFlowStatistics {
9630
10609
  */
9631
10610
  readonly output_counts: Record<string, uint64 | double>;
9632
10611
  /**
9633
- * List of storage counts indexed by prototype name. Represents the data that is shown on the right side of the GUI for electric networks. For other statistics types these values are currently unused and hidden.
9634
- */
9635
- readonly storage_counts: Record<string, uint64 | double>;
9636
- /**
9637
- * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
9638
- */
9639
- readonly valid: boolean;
9640
- }
9641
- /**
9642
- * An array of fluid boxes of an entity. Entities may contain more than one fluid box, and some can change the number of fluid boxes -- for instance, an assembling machine will change its number of fluid boxes depending on its active recipe. See {@link Fluid | runtime:Fluid}.
9643
- *
9644
- * Do note that reading from a {@link LuaFluidBox | runtime:LuaFluidBox} creates a new table and writing will copy the given fields from the table into the engine's own fluid box structure. Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back. Directly accessing the returned table's attributes won't have the desired effect.
9645
- * @example ```
9646
- -- Double the temperature of the fluid in entity's first fluid box.
9647
- fluid = entity.fluidbox[1]
9648
- fluid.temperature = fluid.temperature * 2
9649
- entity.fluidbox[1] = fluid
9650
- ```
9651
- */
9652
- interface LuaFluidBox {
9653
- /**
9654
- * Registers a linked connection between this entity and other entity. Because entity may have multiple fluidboxes, each with multiple connections that could be linked, a unique value for this and other linked_connection_id may need to be given.
9655
- *
9656
- * It may happen a linked connection is not established immediately due to crafting machines being possible to not have certain fluidboxes exposed at a given point in time, but once they appear (due to recipe changes that would use them) they will be linked. Linked connections are persisted as (this_entity, this_linked_connection_id, other_entity, other_linked_connection_id) so if a pipe connection definition's value of linked_connection_id changes existing connections may not restore correct connections.
9657
- *
9658
- * Every fluidbox connection that was defined in prototypes as connection_type=="linked" may be linked to at most 1 other fluidbox. When trying to connect already used connection, previous connection will be removed.
9659
- *
9660
- * Linked connections cannot go to the same entity even if they would be part of other fluidbox.
9661
- */
9662
- add_linked_connection(this: void, this_linked_connection_id: uint32, other_entity: LuaEntity, other_linked_connection_id: uint32): void;
9663
- /**
9664
- * Flushes all fluid from this fluidbox and its fluid system.
9665
- * @param fluid If provided, only this fluid is flushed.
9666
- * @returns The removed fluid.
9667
- */
9668
- flush(this: void, index: uint32, fluid?: FluidID): Record<string, FluidAmount>;
9669
- /**
9670
- * The capacity of the given fluidbox segment.
9671
- */
9672
- get_capacity(this: void, index: uint32): double;
9673
- /**
9674
- * The fluidboxes to which the fluidbox at the given index is connected.
9675
- */
9676
- get_connections(this: void, index: uint32): LuaFluidBox[];
9677
- /**
9678
- * Get a fluid box filter
9679
- * @param index The index of the filter to get.
9680
- * @returns The filter at the requested index, or `nil` if there isn't one.
9681
- */
9682
- get_filter(this: void, index: uint32): FluidBoxFilter | null;
9683
- /**
9684
- * Gets counts of all fluids in the fluid segment. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid segment.
9685
- *
9686
- * Note that this method only ever returns one fluid, since fluids can't be mixed anymore.
9687
- * @returns The counts, indexed by fluid name.
9688
- */
9689
- get_fluid_segment_contents(this: void, index: uint32): Record<string, uint32> | null;
9690
- /**
9691
- * Gets the current extent bounding box of the fluid segment this fluid box belongs to. May return `nil` for fluid wagon, fluid turret's internal buffer, or a fluidbox which does not belong to a fluid segment.
9692
- */
9693
- get_fluid_segment_extent_bounding_box(this: void, index: uint32): BoundingBox | null;
9694
- /**
9695
- * Gets the unique ID of the fluid segment this fluid box belongs to. May return `nil` for fluid wagon, fluid turret's internal buffer or a fluidbox which does not belong to a fluid segment.
9696
- */
9697
- get_fluid_segment_id(this: void, index: uint32): uint32 | null;
9698
- /**
9699
- * Returns other end of a linked connection.
9700
- * @returns [0] - Other entity to which a linked connection was made
9701
- * @returns [1] - linked_connection_id on other entity
9702
- */
9703
- get_linked_connection(this: void, this_linked_connection_id: uint32): LuaMultiReturn<[
9704
- LuaEntity | null,
9705
- uint32 | null
9706
- ]>;
9707
- /**
9708
- * Returns list of all linked connections registered for this entity.
9709
- */
9710
- get_linked_connections(this: void): FluidBoxConnectionRecord[];
9711
- /**
9712
- * Returns the fluid the fluidbox is locked onto
9713
- * @returns `nil` if the fluidbox is not locked to any fluid.
9714
- */
9715
- get_locked_fluid(this: void, index: uint32): string | null;
9716
- /**
9717
- * Get the fluid box's connections and associated data.
9718
- */
9719
- get_pipe_connections(this: void, index: uint32): PipeConnection[];
9720
- /**
9721
- * The prototype of this fluidbox index. If this is used on a fluidbox of a crafting machine which due to recipe was created by merging multiple prototypes, a table of prototypes that were merged will be returned instead
9722
- */
9723
- get_prototype(this: void, index: uint32): LuaFluidBoxPrototype | LuaFluidBoxPrototype[];
9724
- /**
9725
- * Removes linked connection record. If connected, other end will be also removed.
10612
+ * A mapping of quality name to a list of output counts indexed by prototype name. Represents the data that is shown in the middle of the GUI for electric networks and on the right side for all other statistics types.
9726
10613
  */
9727
- remove_linked_connection(this: void, this_linked_connection_id: uint32): void;
10614
+ readonly output_quality_counts: Record<string, Record<string, uint64 | double>>;
9728
10615
  /**
9729
- * Set a fluid box filter.
9730
- *
9731
- * Some entities cannot have their fluidbox filter set, notably fluid wagons and crafting machines.
9732
- * @param index The index of the filter to set.
9733
- * @param filter The filter to set. Setting `nil` clears the filter.
9734
- * @returns Whether the filter was set successfully.
9735
- */
9736
- set_filter(this: void, index: uint32, filter: FluidBoxFilterSpec | nil): boolean;
9737
- /**
9738
- * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
10616
+ * List of storage counts indexed by prototype name. Represents the data that is shown on the right side of the GUI for electric networks. For other statistics types these values are currently unused and hidden.
9739
10617
  */
9740
- readonly object_name: string;
10618
+ readonly storage_counts: Record<string, uint64 | double>;
9741
10619
  /**
9742
- * The entity that owns this fluidbox.
10620
+ * A mapping of quality name to a list of storage counts indexed by prototype name. Represents the data that is shown on the right side of the GUI for electric networks. For other statistics types these values are currently unused and hidden.
9743
10621
  */
9744
- readonly owner: LuaEntity;
10622
+ readonly storage_quality_counts: Record<string, Record<string, uint64 | double>>;
9745
10623
  /**
9746
10624
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
9747
10625
  */
9748
10626
  readonly valid: boolean;
9749
- /**
9750
- * Access, set or clear a fluid box. The index must always be in bounds (see {@link LuaFluidBox::length_operator | runtime:LuaFluidBox::length_operator}). New fluidboxes may not be added or removed using this operator.
9751
- *
9752
- * Is `nil` if the given fluid box does not contain any fluid. Writing `nil` removes all fluid from the fluid box.
9753
- */
9754
- get: LuaTableGetMethod<any, Fluid>;
9755
- /**
9756
- * Access, set or clear a fluid box. The index must always be in bounds (see {@link LuaFluidBox::length_operator | runtime:LuaFluidBox::length_operator}). New fluidboxes may not be added or removed using this operator.
9757
- *
9758
- * Is `nil` if the given fluid box does not contain any fluid. Writing `nil` removes all fluid from the fluid box.
9759
- */
9760
- set: LuaTableSetMethod<any, Fluid>;
9761
- /**
9762
- * Number of fluid boxes.
9763
- */
9764
- length: LuaLengthMethod<uint32>;
9765
10627
  }
9766
10628
  /**
9767
10629
  * A prototype of a fluidbox owned by some {@link LuaEntityPrototype | runtime:LuaEntityPrototype}.
9768
10630
  */
9769
10631
  interface LuaFluidBoxPrototype {
10632
+ /**
10633
+ * Gets the volume of this fluidbox with the given quality.
10634
+ */
10635
+ get_volume(this: void, quality?: QualityID): double;
9770
10636
  /**
9771
10637
  * The entity that this belongs to.
9772
10638
  */
@@ -9811,7 +10677,6 @@ interface LuaFluidBoxPrototype {
9811
10677
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
9812
10678
  */
9813
10679
  readonly valid: boolean;
9814
- readonly volume: double;
9815
10680
  }
9816
10681
  /**
9817
10682
  * Prototype of a fluid energy source.
@@ -9834,6 +10699,7 @@ interface LuaFluidEnergySourcePrototype {
9834
10699
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
9835
10700
  */
9836
10701
  readonly object_name: string;
10702
+ readonly output_fluid_box?: LuaFluidBoxPrototype;
9837
10703
  readonly render_no_network_icon: boolean;
9838
10704
  readonly render_no_power_icon: boolean;
9839
10705
  readonly scale_fluid_usage: boolean;
@@ -9841,6 +10707,7 @@ interface LuaFluidEnergySourcePrototype {
9841
10707
  * The smoke sources for this prototype, if any.
9842
10708
  */
9843
10709
  readonly smoke: SmokeSource[];
10710
+ readonly spent_fluid?: SpentFluidSpecification;
9844
10711
  /**
9845
10712
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
9846
10713
  */
@@ -9884,6 +10751,7 @@ interface LuaFluidPrototype extends LuaPrototypeBase {
9884
10751
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
9885
10752
  */
9886
10753
  readonly object_name: string;
10754
+ readonly spent_fluid?: SpentFluidSpecification;
9887
10755
  /**
9888
10756
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
9889
10757
  */
@@ -9920,6 +10788,10 @@ interface LuaFontPrototype {
9920
10788
  * `LuaForce` encapsulates data local to each "force" or "faction" of the game. Default forces are player, enemy and neutral. Players and mods can create additional forces (up to 64 total).
9921
10789
  */
9922
10790
  interface LuaForce {
10791
+ /**
10792
+ * Adds an alert to every connected player on this force.
10793
+ */
10794
+ add_alert(this: void, entity: LuaEntity, type: defines.alert_type): void;
9923
10795
  /**
9924
10796
  * Adds a custom chart tag to the given surface and returns the new tag or `nil` if the given position isn't valid for a chart tag.
9925
10797
  *
@@ -9928,6 +10800,11 @@ interface LuaForce {
9928
10800
  * @param tag The tag to add.
9929
10801
  */
9930
10802
  add_chart_tag(this: void, surface: SurfaceIdentification, tag: ChartTagSpec): LuaCustomChartTag | null;
10803
+ /**
10804
+ * Adds a custom alert to every connected player on this force.
10805
+ * @param entity If the alert is clicked, the map will open at the position of this entity.
10806
+ */
10807
+ add_custom_alert(this: void, entity: LuaEntity, icon: SignalID, message: LocalisedString, show_on_map: boolean): void;
9931
10808
  /**
9932
10809
  * Add this technology to the back of the research queue if the queue is enabled. Otherwise, set this technology to be researched now.
9933
10810
  * @returns Whether the technology was successfully added.
@@ -10120,6 +10997,10 @@ interface LuaForce {
10120
10997
  * @param type Defaults to `defines.logistic_group_type.with_trash`.
10121
10998
  */
10122
10999
  get_logistic_groups(this: void, type?: defines.logistic_group_type): string[];
11000
+ /**
11001
+ * Gets the unlockable script state for the given ID.
11002
+ */
11003
+ get_script_visible(this: void, unlockable: UnlockableID): boolean | null;
10123
11004
  get_spawn_position(this: void, surface: SurfaceIdentification): MapPosition;
10124
11005
  get_surface_hidden(this: void, surface: SurfaceIdentification): boolean;
10125
11006
  /**
@@ -10166,6 +11047,10 @@ interface LuaForce {
10166
11047
  * Are the space platforms unlocked? This basically just controls the availability of the space platforms button.
10167
11048
  */
10168
11049
  is_space_platforms_unlocked(this: void): boolean;
11050
+ /**
11051
+ * Is the given unlockable ID visible either through computed technologies or script set state.
11052
+ */
11053
+ is_visible(this: void, unlockable: UnlockableID): boolean;
10169
11054
  /**
10170
11055
  * Kill all units and flush the pathfinder.
10171
11056
  */
@@ -10184,6 +11069,11 @@ interface LuaForce {
10184
11069
  * Locks the space platforms, which disables the space platforms button
10185
11070
  */
10186
11071
  lock_space_platforms(this: void): void;
11072
+ /**
11073
+ * Play a music track for every player in this force.
11074
+ * @param music_specification The track to play.
11075
+ */
11076
+ play_music(this: void, music_specification: PlayMusicSpecification): void;
10187
11077
  /**
10188
11078
  * Play a sound for every player in this force.
10189
11079
  *
@@ -10202,6 +11092,10 @@ interface LuaForce {
10202
11092
  * @param surface Which surface to rechart or all if not given.
10203
11093
  */
10204
11094
  rechart(this: void, surface?: SurfaceIdentification): void;
11095
+ /**
11096
+ * For every connected player on this force - removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.
11097
+ */
11098
+ remove_alert(this: void, filter: AlertFilter): void;
10205
11099
  /**
10206
11100
  * Research all technologies.
10207
11101
  * @param include_disabled_prototypes Whether technologies that are explicitly disabled in the prototype should also be researched. Defaults to `false`.
@@ -10277,6 +11171,10 @@ interface LuaForce {
10277
11171
  * @param count The count to set
10278
11172
  */
10279
11173
  set_item_launched(this: void, item: ItemID, count: uint32): void;
11174
+ /**
11175
+ * Sets the given unlockable ID state. When set to explicitly hidden or visible the value overrides the state computed through technologies.
11176
+ */
11177
+ set_script_visible(this: void, unlockable: UnlockableID, value?: boolean): void;
10280
11178
  /**
10281
11179
  * @param position The new position on the given surface.
10282
11180
  * @param surface Surface to set the spawn position for.
@@ -10328,6 +11226,10 @@ interface LuaForce {
10328
11226
  * Number of items that can be transferred by bulk inserters. When writing to this value, it must be >= 0 and <= 254.
10329
11227
  */
10330
11228
  bulk_inserter_capacity_bonus: uint32;
11229
+ /**
11230
+ * The maximum cargo landing pads that can be built per surface by this force.
11231
+ */
11232
+ cargo_landing_pad_limit: uint32;
10331
11233
  character_build_distance_bonus: uint32;
10332
11234
  character_health_bonus: double;
10333
11235
  /**
@@ -10426,6 +11328,10 @@ interface LuaForce {
10426
11328
  ```
10427
11329
  */
10428
11330
  manual_mining_speed_modifier: double;
11331
+ /**
11332
+ * Maximum distance between cargo bay from its connected cargo landing pad that allows unloading. Only relevant for cargo bays that have both {@link LuaEntityPrototype::allow_unloading | runtime:LuaEntityPrototype::allow_unloading} and {@link LuaEntityPrototype::use_unloading_distance_limit | runtime:LuaEntityPrototype::use_unloading_distance_limit} set to `true`.
11333
+ */
11334
+ max_cargo_bay_unloading_distance: double;
10429
11335
  max_failed_attempts_per_tick_per_construction_queue: uint32;
10430
11336
  max_successful_attempts_per_tick_per_construction_queue: uint32;
10431
11337
  /**
@@ -10502,6 +11408,14 @@ interface LuaForce {
10502
11408
  */
10503
11409
  readonly technologies: Record<string, LuaTechnology>;
10504
11410
  train_braking_force_bonus: double;
11411
+ /**
11412
+ * When true, a "connect to logistic network" button will become enabled for entities that can connect to a logistic network.
11413
+ */
11414
+ unlock_logistic_network: boolean;
11415
+ /**
11416
+ * Whether traveling to space platforms via rockets is unlocked.
11417
+ */
11418
+ unlock_travel_to_space_platforms: boolean;
10505
11419
  /**
10506
11420
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
10507
11421
  */
@@ -10555,10 +11469,6 @@ interface LuaFurnaceControlBehavior extends LuaGenericOnOffControlBehavior {
10555
11469
  * The signal sent when the furnace is working.
10556
11470
  */
10557
11471
  circuit_working_signal?: SignalID;
10558
- /**
10559
- * `true` if the read contents should include fuel (content of energy source)
10560
- */
10561
- include_fuel: boolean;
10562
11472
  /**
10563
11473
  * `true` if the read contents should include items in crafting.
10564
11474
  */
@@ -10567,6 +11477,10 @@ interface LuaFurnaceControlBehavior extends LuaGenericOnOffControlBehavior {
10567
11477
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
10568
11478
  */
10569
11479
  readonly object_name: string;
11480
+ /**
11481
+ * `true` if the fuel (content of energy source) should be read.
11482
+ */
11483
+ read_fuel: boolean;
10570
11484
  /**
10571
11485
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
10572
11486
  */
@@ -10581,8 +11495,9 @@ interface LuaGameScript {
10581
11495
  *
10582
11496
  * Only the server will save in multiplayer. In single player a standard auto-save is triggered.
10583
11497
  * @param name The autosave name if any. Saves will be named _autosave-*name* when provided.
11498
+ * @param allow_in_replay Whether to save the auto-save even during replay playback. Defaults to `false`
10584
11499
  */
10585
- auto_save(this: void, name?: string): void;
11500
+ auto_save(this: void, name?: string, allow_in_replay?: boolean): void;
10586
11501
  /**
10587
11502
  * Bans the given player from this multiplayer game. Does nothing if this is a single player game of if the player running this isn't an admin.
10588
11503
  * @param player The player to ban.
@@ -10613,13 +11528,6 @@ interface LuaGameScript {
10613
11528
  * @param gui_title The title of the GUI that is shown when this inventory is opened.
10614
11529
  */
10615
11530
  create_inventory(this: void, size: uint16, gui_title?: LocalisedString): LuaInventory;
10616
- /**
10617
- * Creates a {@link LuaProfiler | runtime:LuaProfiler}, which is used for measuring script performance.
10618
- *
10619
- * LuaProfiler cannot be serialized.
10620
- * @param stopped Create the timer stopped
10621
- */
10622
- create_profiler(this: void, stopped?: boolean): LuaProfiler;
10623
11531
  /**
10624
11532
  * Creates a deterministic standalone random generator with the given seed or if a seed is not provided the initial map seed is used.
10625
11533
  *
@@ -10635,6 +11543,12 @@ interface LuaGameScript {
10635
11543
  * @returns The surface that was just created.
10636
11544
  */
10637
11545
  create_surface(this: void, name: string, settings?: MapGenSettings): LuaSurface;
11546
+ /**
11547
+ * Deletes the blueprint library of the given player.
11548
+ *
11549
+ * Note: the player must be offline (disconnected).
11550
+ */
11551
+ delete_blueprint_library(this: void, player: PlayerIdentification): void;
10638
11552
  /**
10639
11553
  * Deletes the given surface and all entities on it if possible.
10640
11554
  * @param surface The surface to be deleted. Currently the primary surface (1, 'nauvis') cannot be deleted.
@@ -10725,6 +11639,11 @@ interface LuaGameScript {
10725
11639
  * @param player The player to mute.
10726
11640
  */
10727
11641
  mute_player(this: void, player: PlayerIdentification): void;
11642
+ /**
11643
+ * Play a music track for every player in the game.
11644
+ * @param music_specification The track to play.
11645
+ */
11646
+ play_music(this: void, music_specification: PlayMusicSpecification): void;
10728
11647
  /**
10729
11648
  * Play a sound for every player in the game.
10730
11649
  *
@@ -10890,6 +11809,7 @@ interface LuaGameScript {
10890
11809
  * @param table.selected_technology The technology to highlight.
10891
11810
  * @param table.skip_disabled If `true`, disabled technologies will be skipped. Their successors will be attached to the disabled technology's parents. Defaults to `false`.
10892
11811
  * @param table.quality The `.jpg` render quality as a percentage (from 0% to 100% inclusive), if used. A lower value means a more compressed image. Defaults to `80`.
11812
+ * @param table.allow_in_replay Whether to save the screenshot even during replay playback. Defaults to `false`.
10893
11813
  */
10894
11814
  take_technology_screenshot(this: void, table: {
10895
11815
  path?: string;
@@ -10897,6 +11817,7 @@ interface LuaGameScript {
10897
11817
  selected_technology?: TechnologyID;
10898
11818
  skip_disabled?: boolean;
10899
11819
  quality?: int32;
11820
+ allow_in_replay?: boolean;
10900
11821
  }): void;
10901
11822
  /**
10902
11823
  * Unbans the given player from this multiplayer game. Does nothing if this is a single player game of if the player running this isn't an admin.
@@ -10911,7 +11832,7 @@ interface LuaGameScript {
10911
11832
  /**
10912
11833
  * Whether players who are not {@link admins | runtime:LuaPlayer::admin} can access all debug settings. Set this to false to disallow access to most debug settings for non-admins.
10913
11834
  *
10914
- * The following debug settings are always available to all players: `"show-fps"`, `"show-clock"`, `"show-time-to-next-autosave"`, `"show-detailed-info"`, `"show-time-usage"`, `"show-entity-time-usage"`, `"show-gpu-time-usage"`, `"show-sprite-counts"`, `"show-particle-counts"`, `"show-collector-navmesh-time-usage"`, `"show-lua-object-statistics"`, `"show-heat-buffer-info"`, `"show-multiplayer-waiting-icon"`, `"show-multiplayer-statistics"`, `"show-multiplayer-server-name"`, `"show-debug-info-in-tooltips"`, `"show-resistances-in-tooltips-always"`, `"hide-mod-guis"`, `"show-tile-grid"`, `"show-blueprint-grid"`, `"show-intermediate-volume-of-working-sounds"`, `"show-decorative-names"`, `"allow-increased-zoom"`, `"show-train-no-path-details"`, `"show-entity-tick"`, `"show-update-tick"`
11835
+ * The following debug settings are always available to all players: `"show-fps"`, `"show-playtime"`, `"show-clock"`, `"show-time-to-next-autosave"`, `"show-detailed-info"`, `"show-time-usage"`, `"show-entity-time-usage"`, `"show-gpu-time-usage"`, `"show-sprite-counts"`, `"show-particle-counts"`, `"show-collector-navmesh-time-usage"`, `"show-lua-object-statistics"`, `"show-heat-buffer-info"`, `"show-multiplayer-ups"`, `"show-multiplayer-waiting-icon"`, `"show-multiplayer-statistics"`, `"show-multiplayer-server-name"`, `"show-debug-info-in-tooltips"`, `"show-resistances-in-tooltips-always"`, `"hide-mod-guis"`, `"show-tile-grid"`, `"show-blueprint-grid"`, `"show-intermediate-volume-of-working-sounds"`, `"show-decorative-names"`, `"allow-increased-zoom"`, `"show-train-no-path-details"`, `"show-entity-tick"`, `"show-update-tick"`
10915
11836
  */
10916
11837
  allow_debug_settings: boolean;
10917
11838
  /**
@@ -11485,6 +12406,7 @@ interface LuaGuiElement {
11485
12406
  * The remaining types use strings.
11486
12407
  */
11487
12408
  elem_value?: string | SignalID | PrototypeWithQuality;
12409
+ empty_slot_info?: EmptySlotInfo;
11488
12410
  /**
11489
12411
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
11490
12412
  */
@@ -11505,6 +12427,12 @@ interface LuaGuiElement {
11505
12427
  * The GUI this element is a child of.
11506
12428
  */
11507
12429
  readonly gui: LuaGui;
12430
+ hand_send_stacks_to_trash: boolean;
12431
+ handle_cursor_split: boolean;
12432
+ handle_cursor_transfer: boolean;
12433
+ handle_open_item: boolean;
12434
+ handle_open_mod_item: boolean;
12435
+ handle_send_stack_to_trash: boolean;
11508
12436
  /**
11509
12437
  * Policy of the horizontal scroll bar.
11510
12438
  */
@@ -11525,6 +12453,10 @@ interface LuaGuiElement {
11525
12453
  * The index of this GUI element (unique amongst the GUI elements of a LuaPlayer).
11526
12454
  */
11527
12455
  readonly index: uint32;
12456
+ /**
12457
+ * The inventory target for this custom inventory widget.
12458
+ */
12459
+ inventory?: LuaInventory;
11528
12460
  /**
11529
12461
  * Whether this textfield displays as a password field, which renders all characters as `*`.
11530
12462
  */
@@ -11641,6 +12573,7 @@ interface LuaGuiElement {
11641
12573
  * The value of this slider element.
11642
12574
  */
11643
12575
  slider_value: double;
12576
+ slots_per_row?: uint8;
11644
12577
  /**
11645
12578
  * The sprite to display on this sprite-button or sprite in the default state.
11646
12579
  */
@@ -11651,6 +12584,8 @@ interface LuaGuiElement {
11651
12584
  state: boolean;
11652
12585
  /**
11653
12586
  * The style of this element. When read, this evaluates to a {@link LuaStyle | runtime:LuaStyle}. For writing, it only accepts a string that specifies the textual identifier (prototype name) of the desired style.
12587
+ *
12588
+ * When writing, this clears all custom values set through {@link LuaStyle | runtime:LuaStyle}.
11654
12589
  */
11655
12590
  style: LuaStyle | string;
11656
12591
  /**
@@ -11724,7 +12659,7 @@ interface LuaGuiElement {
11724
12659
  */
11725
12660
  set: LuaTableSetMethod<any, LuaGuiElement>;
11726
12661
  }
11727
- type LuaGuiElementAddParams = BaseLuaGuiElementAddParams | LuaGuiElementAddParamsButton | LuaGuiElementAddParamsCamera | LuaGuiElementAddParamsCheckbox | LuaGuiElementAddParamsChooseElemButton | LuaGuiElementAddParamsDropDown | LuaGuiElementAddParamsFlow | LuaGuiElementAddParamsFrame | LuaGuiElementAddParamsLine | LuaGuiElementAddParamsListBox | LuaGuiElementAddParamsMinimap | LuaGuiElementAddParamsProgressbar | LuaGuiElementAddParamsRadiobutton | LuaGuiElementAddParamsScrollPane | LuaGuiElementAddParamsSlider | LuaGuiElementAddParamsSprite | LuaGuiElementAddParamsSpriteButton | LuaGuiElementAddParamsSwitch | LuaGuiElementAddParamsTab | LuaGuiElementAddParamsTable | LuaGuiElementAddParamsTextBox | LuaGuiElementAddParamsTextfield;
12662
+ type LuaGuiElementAddParams = BaseLuaGuiElementAddParams | LuaGuiElementAddParamsButton | LuaGuiElementAddParamsCamera | LuaGuiElementAddParamsCheckbox | LuaGuiElementAddParamsChooseElemButton | LuaGuiElementAddParamsDropDown | LuaGuiElementAddParamsFlow | LuaGuiElementAddParamsFrame | LuaGuiElementAddParamsInventory | LuaGuiElementAddParamsLine | LuaGuiElementAddParamsListBox | LuaGuiElementAddParamsMinimap | LuaGuiElementAddParamsProgressbar | LuaGuiElementAddParamsRadiobutton | LuaGuiElementAddParamsScrollPane | LuaGuiElementAddParamsSlider | LuaGuiElementAddParamsSprite | LuaGuiElementAddParamsSpriteButton | LuaGuiElementAddParamsSwitch | LuaGuiElementAddParamsTab | LuaGuiElementAddParamsTable | LuaGuiElementAddParamsTextBox | LuaGuiElementAddParamsTextfield;
11728
12663
  interface BaseLuaGuiElementAddParams {
11729
12664
  /**
11730
12665
  * Where to position the child element when in the `relative` element.
@@ -11781,7 +12716,7 @@ interface BaseLuaGuiElementAddParams {
11781
12716
  /**
11782
12717
  * The kind of element to add, which potentially has its own attributes as listed below.
11783
12718
  */
11784
- 'type': 'button' | 'camera' | 'checkbox' | 'choose-elem-button' | 'drop-down' | 'flow' | 'frame' | 'line' | 'list-box' | 'minimap' | 'progressbar' | 'radiobutton' | 'scroll-pane' | 'slider' | 'sprite' | 'sprite-button' | 'switch' | 'tab' | 'table' | 'text-box' | 'textfield';
12719
+ 'type': 'button' | 'camera' | 'checkbox' | 'choose-elem-button' | 'drop-down' | 'flow' | 'frame' | 'inventory' | 'line' | 'list-box' | 'minimap' | 'progressbar' | 'radiobutton' | 'scroll-pane' | 'slider' | 'sprite' | 'sprite-button' | 'switch' | 'tab' | 'table' | 'text-box' | 'textfield';
11785
12720
  /**
11786
12721
  * Whether the child element is visible. Defaults to `true`.
11787
12722
  */
@@ -11977,6 +12912,24 @@ interface LuaGuiElementAddParamsFrame extends BaseLuaGuiElementAddParams {
11977
12912
  */
11978
12913
  'direction'?: GuiDirection;
11979
12914
  }
12915
+ /**
12916
+ *
12917
+ * Applies to variant case `inventory`
12918
+ */
12919
+ interface LuaGuiElementAddParamsInventory extends BaseLuaGuiElementAddParams {
12920
+ /**
12921
+ * The kind of element to add, which potentially has its own attributes as listed below.
12922
+ */
12923
+ 'type': 'inventory';
12924
+ 'empty_slot_info'?: EmptySlotInfo;
12925
+ 'hand_send_stacks_to_trash'?: boolean;
12926
+ 'handle_cursor_split'?: boolean;
12927
+ 'handle_cursor_transfer'?: boolean;
12928
+ 'handle_open_item'?: boolean;
12929
+ 'handle_open_mod_item'?: boolean;
12930
+ 'handle_send_stack_to_trash'?: boolean;
12931
+ 'slots_per_row'?: uint8;
12932
+ }
11980
12933
  /**
11981
12934
  *
11982
12935
  * Applies to variant case `line`
@@ -12305,7 +13258,7 @@ interface LuaGuiElementAddParamsTextfield extends BaseLuaGuiElementAddParams {
12305
13258
  * Prototype of a heat buffer.
12306
13259
  */
12307
13260
  interface LuaHeatBufferPrototype {
12308
- readonly connections: HeatConnection[];
13261
+ readonly connections: HeatConnectionDefinition[];
12309
13262
  readonly default_temperature: double;
12310
13263
  readonly max_temperature: double;
12311
13264
  readonly max_transfer: double;
@@ -12326,7 +13279,7 @@ interface LuaHeatBufferPrototype {
12326
13279
  * Prototype of a heat energy source.
12327
13280
  */
12328
13281
  interface LuaHeatEnergySourcePrototype {
12329
- readonly connections: HeatConnection[];
13282
+ readonly connections: HeatConnectionDefinition[];
12330
13283
  readonly default_temperature: double;
12331
13284
  /**
12332
13285
  * The table of emissions of this energy source in `pollution/Joule`, indexed by pollutant type. Multiplying it by energy consumption in `Watt` gives `pollution/second`.
@@ -12350,6 +13303,24 @@ interface LuaHeatEnergySourcePrototype {
12350
13303
  */
12351
13304
  readonly valid: boolean;
12352
13305
  }
13306
+ /**
13307
+ * Control behavior for heat pipe
13308
+ */
13309
+ interface LuaHeatPipeControlBehavior extends LuaControlBehavior {
13310
+ /**
13311
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
13312
+ */
13313
+ readonly object_name: string;
13314
+ /**
13315
+ * If this will read temperature of the heat pipe
13316
+ */
13317
+ read_temperature: boolean;
13318
+ temperature_signal?: SignalID;
13319
+ /**
13320
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
13321
+ */
13322
+ readonly valid: boolean;
13323
+ }
12353
13324
  /**
12354
13325
  * Provides various helper and utility functions. It is accessible through the global object named `helpers` in all stages (settings, prototype and runtime).
12355
13326
  */
@@ -12405,6 +13376,20 @@ interface LuaHelpers {
12405
13376
  ```
12406
13377
  */
12407
13378
  evaluate_expression(this: void, expression: MathExpression, variables?: Record<string, double>): double;
13379
+ /**
13380
+ * Checks if an ambient sound of a given name is valid.
13381
+ *
13382
+ * Not available in settings and prototype stages.
13383
+ * @param name Name of the ambient sound.
13384
+ */
13385
+ is_valid_ambient_sound(this: void, name: string): boolean;
13386
+ /**
13387
+ * Checks if the given animation name is valid and contains a loaded animation.
13388
+ *
13389
+ * Not available in settings and prototype stages.
13390
+ * @param name Name of an {@link AnimationPrototype | prototype:AnimationPrototype}.
13391
+ */
13392
+ is_valid_animation_path(this: void, name: string): boolean;
12408
13393
  /**
12409
13394
  * Checks if the given SoundPath is valid.
12410
13395
  *
@@ -12483,6 +13468,10 @@ interface LuaHelpers {
12483
13468
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
12484
13469
  */
12485
13470
  readonly object_name: string;
13471
+ /**
13472
+ * Stage of scripting that is currently running
13473
+ */
13474
+ readonly stage: 'settings' | 'prototype' | 'runtime';
12486
13475
  }
12487
13476
  /**
12488
13477
  * Control behavior for inserters.
@@ -12673,6 +13662,20 @@ interface LuaInventory {
12673
13662
  * If this inventory supports filters.
12674
13663
  */
12675
13664
  supports_filters(this: void): boolean;
13665
+ /**
13666
+ * Transfer items from provided LuaInventory into this inventory.
13667
+ *
13668
+ * Note that source inventory must be different than this inventory.
13669
+ * @returns Number of items actually transferred.
13670
+ */
13671
+ transfer_from_inventory(this: void, source: LuaInventory, filter?: ItemFilter): uint32;
13672
+ /**
13673
+ * Transfer items from provided LuaItemStack into this inventory.
13674
+ *
13675
+ * Note that source stack must not belong to this inventory.
13676
+ * @returns Number of items actually transferred.
13677
+ */
13678
+ transfer_from_stack(this: void, source: LuaItemStack): uint32;
12676
13679
  /**
12677
13680
  * The entity that owns this inventory, if any.
12678
13681
  */
@@ -12785,8 +13788,8 @@ interface LuaItemCommon {
12785
13788
  * @param table.direction The direction to use when building
12786
13789
  * @param table.build_mode If `normal`, blueprint will not be built if any one thing can't be built. If `forced`, anything that can be built is built and obstructing nature entities will be deconstructed. If `superforced`, all obstructions will be deconstructed and the blueprint will be built.
12787
13790
  * @param table.skip_fog_of_war If chunks covered by fog-of-war are skipped.
12788
- * @param table.by_player The player to use if any. If provided {@link defines.events.on_built_entity | runtime:defines.events.on_built_entity} will also be fired on successful entity creation.
12789
- * @param table.raise_built If true; {@link defines.events.script_raised_built | runtime:defines.events.script_raised_built} will be fired on successful entity creation. Note: this is ignored if by_player is provided.
13791
+ * @param table.by_player The player to use if any. If provided {@link defines.events.on_built_entity | runtime:defines.events.on_built_entity} will be fired for new entities and {@link defines.events.on_blueprint_settings_pasted | runtime:defines.events.on_blueprint_settings_pasted} will be fired for existing entities that are updated.
13792
+ * @param table.raise_built If true; {@link defines.events.script_raised_built | runtime:defines.events.script_raised_built} will be fired for new entities and {@link defines.events.on_blueprint_settings_pasted | runtime:defines.events.on_blueprint_settings_pasted} will be fired for existing entities that are updated. Note: this is ignored if by_player is provided.
12790
13793
  * @returns Array of created ghosts
12791
13794
  */
12792
13795
  build_blueprint(this: void, table: {
@@ -12912,6 +13915,10 @@ interface LuaItemCommon {
12912
13915
  * Gets the tag with the given name or returns `nil` if it doesn't exist.
12913
13916
  */
12914
13917
  get_tag(this: void, tag_name: string): AnyBasic | null;
13918
+ /**
13919
+ * Gets the names of all tags on this item.
13920
+ */
13921
+ get_tag_names(this: void): string[];
12915
13922
  /**
12916
13923
  * Gets the tile filter at the given index for this deconstruction item.
12917
13924
  */
@@ -13036,7 +14043,7 @@ interface LuaItemCommon {
13036
14043
  */
13037
14044
  entity_enable_logistics_while_moving: boolean;
13038
14045
  /**
13039
- * The number of entity filters this deconstruction item supports.
14046
+ * The number of entity filters this deconstruction item has.
13040
14047
  */
13041
14048
  readonly entity_filter_count: uint32;
13042
14049
  /**
@@ -13139,13 +14146,17 @@ interface LuaItemCommon {
13139
14146
  * The location of this item if it can be found.
13140
14147
  */
13141
14148
  readonly owner_location: ItemLocationData;
14149
+ /**
14150
+ * The description for this deconstruction planner or upgrade planner
14151
+ */
14152
+ planner_description: string;
13142
14153
  /**
13143
14154
  * Icons of this blueprint item, blueprint book, deconstruction item or upgrade planner. An item that doesn't have icons returns `nil` on read and throws error on write.
13144
14155
  */
13145
14156
  preview_icons?: BlueprintSignalIcon[];
13146
14157
  tags: Tags;
13147
14158
  /**
13148
- * The number of tile filters this deconstruction item supports.
14159
+ * The number of tile filters this deconstruction item has.
13149
14160
  */
13150
14161
  readonly tile_filter_count: uint32;
13151
14162
  /**
@@ -13193,6 +14204,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13193
14204
  * The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary.
13194
14205
  */
13195
14206
  get_entity_type_filters(this: void, selection_mode: defines.selection_mode): Record<string, true> | null;
14207
+ /**
14208
+ * The main inventory size for item-with-inventory-prototype.
14209
+ */
14210
+ get_inventory_size(this: void, quality?: QualityID): uint32 | null;
13196
14211
  /**
13197
14212
  * The inventory size bonus for this armor prototype.
13198
14213
  */
@@ -13256,7 +14271,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13256
14271
  * The collision box used by character entities when wearing this armor.
13257
14272
  */
13258
14273
  readonly collision_box?: BoundingBox;
14274
+ readonly color_hint: ColorHintSpecification;
14275
+ readonly consumption_quality_multiplier?: float;
13259
14276
  readonly create_electric_network?: boolean;
14277
+ readonly cuts?: boolean;
13260
14278
  readonly default_import_location: LuaSpaceLocationPrototype;
13261
14279
  /**
13262
14280
  * The default label color used for this item with label, if any.
@@ -13279,10 +14297,6 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13279
14297
  * The durability message value used when displaying the durability of this tool.
13280
14298
  */
13281
14299
  readonly durability_description_value?: string;
13282
- /**
13283
- * The number of entity filters this deconstruction item has.
13284
- */
13285
- readonly entity_filter_slots?: uint32;
13286
14300
  /**
13287
14301
  * The prototype of this armor's equipment grid, if any.
13288
14302
  */
@@ -13338,13 +14352,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13338
14352
  readonly infinite?: boolean;
13339
14353
  readonly ingredient_to_weight_coefficient: double;
13340
14354
  readonly initial_items?: ItemProduct[];
13341
- /**
13342
- * The main inventory size for item-with-inventory-prototype.
13343
- */
13344
- readonly inventory_size?: uint32;
13345
14355
  readonly item_filters?: LuaItemPrototype[];
13346
14356
  readonly item_group_filters?: LuaGroup[];
13347
14357
  readonly item_subgroup_filters?: LuaGroup[];
14358
+ readonly lab_ignores_spoil_percent: boolean;
13348
14359
  /**
13349
14360
  * The localised string used when the player attempts to put items into this item with inventory that aren't allowed.
13350
14361
  */
@@ -13379,10 +14390,14 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13379
14390
  * The result entity when planting this item as a seed.
13380
14391
  */
13381
14392
  readonly plant_result?: LuaEntityPrototype;
14393
+ readonly pollution_quality_multiplier?: float;
14394
+ readonly productivity_quality_multiplier?: float;
13382
14395
  /**
13383
14396
  * If this armor provides flight to character entities when worm.
13384
14397
  */
13385
14398
  readonly provides_flight?: boolean;
14399
+ readonly quality_affects_inventory_size?: boolean;
14400
+ readonly quality_quality_multiplier?: float;
13386
14401
  readonly radius_color?: Color;
13387
14402
  /**
13388
14403
  * Prototypes of all rails possible to be used by this rail planner prototype.
@@ -13405,14 +14420,21 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13405
14420
  * How this item interacts when being sent to orbit.
13406
14421
  */
13407
14422
  readonly send_to_orbit_mode: 'not-sendable' | 'manual' | 'automated';
14423
+ readonly shoot_protected?: boolean;
13408
14424
  /**
13409
14425
  * If this selection tool skips things covered by fog of war.
13410
14426
  */
13411
14427
  readonly skip_fog_of_war?: boolean;
14428
+ readonly space_platform_request_priority: boolean;
13412
14429
  /**
13413
14430
  * The repairing speed if this is a repairing tool.
13414
14431
  */
13415
14432
  readonly speed?: float;
14433
+ readonly speed_quality_multiplier?: float;
14434
+ readonly spoil_level: uint8;
14435
+ readonly spoil_quality_change: int8;
14436
+ readonly spoil_quality_max?: LuaQualityPrototype;
14437
+ readonly spoil_quality_min?: LuaQualityPrototype;
13416
14438
  /**
13417
14439
  * The spoil result of this item, if any
13418
14440
  */
@@ -13435,18 +14457,18 @@ interface LuaItemPrototype extends LuaPrototypeBase {
13435
14457
  * Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules with higher tier modules if they have the same category.
13436
14458
  */
13437
14459
  readonly tier?: uint32;
13438
- /**
13439
- * The number of tile filters this deconstruction item has.
13440
- */
13441
- readonly tile_filter_slots?: uint32;
13442
14460
  readonly tiles?: SpacePlatformTileDefinition[];
13443
14461
  readonly trigger?: TriggerItem;
14462
+ /**
14463
+ * Whether this item is referenced by any {@link lab input | prototype:LabPrototype::inputs}.
14464
+ */
14465
+ readonly used_by_labs: boolean;
13444
14466
  /**
13445
14467
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
13446
14468
  */
13447
14469
  readonly valid: boolean;
13448
14470
  /**
13449
- * Weight of this item. More information on how item weight is determined can be found on its {@link auxiliary page | runtime:item-weight}.
14471
+ * Weight of this item. More information on how item weight is determined can be found on its {@link auxiliary page | auxiliary:item-weight}.
13450
14472
  */
13451
14473
  readonly weight: Weight;
13452
14474
  }
@@ -13582,6 +14604,29 @@ interface LuaItemStack extends LuaItemCommon {
13582
14604
  */
13583
14605
  readonly valid_for_read: boolean;
13584
14606
  }
14607
+ /**
14608
+ * Control behavior for lab.
14609
+ */
14610
+ interface LuaLabControlBehavior extends LuaControlBehavior {
14611
+ /**
14612
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
14613
+ */
14614
+ readonly object_name: string;
14615
+ read_contents: boolean;
14616
+ /**
14617
+ * `true` if the fuel (content of energy source) should be read.
14618
+ */
14619
+ read_fuel: boolean;
14620
+ read_research_cost: boolean;
14621
+ read_technology_level: boolean;
14622
+ research_conditions: ResearchCondition[];
14623
+ set_research: boolean;
14624
+ technology_level_signal: SignalID;
14625
+ /**
14626
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
14627
+ */
14628
+ readonly valid: boolean;
14629
+ }
13585
14630
  /**
13586
14631
  * Control behavior for lamps.
13587
14632
  */
@@ -13608,6 +14653,19 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
13608
14653
  */
13609
14654
  readonly valid: boolean;
13610
14655
  }
14656
+ /**
14657
+ * Control behavior for land mines.
14658
+ */
14659
+ interface LuaLandMineControlBehavior extends LuaGenericOnOffControlBehavior {
14660
+ /**
14661
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
14662
+ */
14663
+ readonly object_name: string;
14664
+ /**
14665
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
14666
+ */
14667
+ readonly valid: boolean;
14668
+ }
13611
14669
  /**
13612
14670
  * A lazily loaded value. For performance reasons, we sometimes return a custom lazily-loaded value type instead of the native Lua value. This custom type lazily constructs the necessary value when {@link LuaLazyLoadedValue::get | runtime:LuaLazyLoadedValue::get} is called, therefore preventing its unnecessary construction in some cases.
13613
14671
  *
@@ -13742,17 +14800,23 @@ interface LuaLogisticContainerControlBehavior extends LuaControlBehavior {
13742
14800
  */
13743
14801
  circuit_condition: CircuitConditionDefinition;
13744
14802
  /**
13745
- * Whether the circuit condition is in effect
14803
+ * Whether the circuit condition is in effect.
13746
14804
  */
13747
14805
  circuit_condition_enabled: boolean;
13748
- /**
13749
- * The circuit mode of operations for the logistic container. Can only be set on containers whose {@link logistic_mode | runtime:LuaEntityPrototype::logistic_mode} is set to `"requester"` or `"buffer"`.
13750
- */
13751
- circuit_exclusive_mode_of_operation: defines.control_behavior.logistic_container.exclusive_mode;
13752
14806
  /**
13753
14807
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
13754
14808
  */
13755
14809
  readonly object_name: string;
14810
+ /**
14811
+ * `true` if this logistic container is sending its content to a circuit network.
14812
+ */
14813
+ read_contents: boolean;
14814
+ /**
14815
+ * `true` if this logistic container has its requests set by a circuit network.
14816
+ *
14817
+ * Can only be set to `true` on containers whose {@link logistic_mode | runtime:LuaEntityPrototype::logistic_mode} or {@link override_logistic_mode | runtime:LuaEntity::override_logistic_mode} is set to `"requester"` or `"buffer"`.
14818
+ */
14819
+ set_requests: boolean;
13756
14820
  /**
13757
14821
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
13758
14822
  */
@@ -14276,6 +15340,56 @@ interface LuaNamedNoiseFunction extends LuaPrototypeBase {
14276
15340
  */
14277
15341
  readonly valid: boolean;
14278
15342
  }
15343
+ /**
15344
+ * Object that keeps track of objects invalidation and queues notifications for when object becomes invalid.
15345
+ *
15346
+ * This object is an alternative mechanism to {@link LuaBootstrap::register_on_object_destroyed | runtime:LuaBootstrap::register_on_object_destroyed} where instead of raising lua events, this object only queues notifications and makes them available to use later by calls to {@link LuaNotificationQueue::poll | runtime:LuaNotificationQueue::poll} or {@link LuaNotificationQueue::poll_all | runtime:LuaNotificationQueue::poll_all}.
15347
+ *
15348
+ * New instances of this object can be obtained from {@link LuaBootstrap::new_notification_queue | runtime:LuaBootstrap::new_notification_queue}.
15349
+ *
15350
+ * Each instance of this object is unique, always valid and cannot be copied. This object lives entirely in script state and if its no longer referenced by script, it will be destroyed by garbage collector.
15351
+ */
15352
+ interface LuaNotificationQueue {
15353
+ /**
15354
+ * Registers an object so that after it's destroyed, a notification is queued.
15355
+ *
15356
+ * If this object is already registered within this notification queue, an existing registration number will be provided without creating new registration.
15357
+ * @param object The object to register.
15358
+ * @returns The registration number.
15359
+ */
15360
+ add(this: void, object: RegistrationTarget): uint64;
15361
+ /**
15362
+ * Removes all registrations.
15363
+ */
15364
+ clear(this: void): void;
15365
+ /**
15366
+ * Checks if provided object is already registered and returns existing registration number for it. If object is not registered, it is not registered and nil is returned instead.
15367
+ * @param object The object to check.
15368
+ * @returns The registration number if object is registered.
15369
+ */
15370
+ find(this: void, object: RegistrationTarget): uint64 | null;
15371
+ /**
15372
+ * Gets at most 1 registration id for which an object was destroyed.
15373
+ */
15374
+ poll(this: void): uint64 | null;
15375
+ /**
15376
+ * Gets all registration ids for which object were destroyed.
15377
+ */
15378
+ poll_all(this: void): uint64[];
15379
+ /**
15380
+ * Removes a registration based on registration number.
15381
+ * @param registration_id Registration to be removed.
15382
+ */
15383
+ remove(this: void, registration_id: uint64): void;
15384
+ /**
15385
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
15386
+ */
15387
+ readonly object_name: string;
15388
+ /**
15389
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
15390
+ */
15391
+ readonly valid: boolean;
15392
+ }
14279
15393
  /**
14280
15394
  * Prototype of an optimized particle.
14281
15395
  */
@@ -14556,6 +15670,8 @@ interface LuaPlayer extends LuaControl {
14556
15670
  /**
14557
15671
  * Asks the player if they would like to connect to the given server.
14558
15672
  *
15673
+ * If the "auto-accept-connect-to-server" interface setting is enabled, the prompt is skipped.
15674
+ *
14559
15675
  * This only does anything when used on a multiplayer peer. Single player and server hosts will ignore the prompt.
14560
15676
  * @param table.address The server (address:port) if port is not given the default Factorio port is used.
14561
15677
  * @param table.name The name of the server.
@@ -14598,6 +15714,16 @@ interface LuaPlayer extends LuaControl {
14598
15714
  time_to_live?: uint32;
14599
15715
  speed?: double;
14600
15716
  }): void;
15717
+ /**
15718
+ * Performs the cursor split action on the given inventory at the given index as if the player did it.
15719
+ * @returns If the action succeeded.
15720
+ */
15721
+ cursor_split(this: void, inventory: LuaInventory, index: uint32): boolean;
15722
+ /**
15723
+ * Performs the cursor transfer action on the given inventory at the given index as if the player did it.
15724
+ * @returns If the action succeeded.
15725
+ */
15726
+ cursor_transfer(this: void, inventory: LuaInventory, index: uint32): boolean;
14601
15727
  /**
14602
15728
  * Disables alerts for the given alert category.
14603
15729
  * @returns Whether the alert type was disabled (false if it was already disabled).
@@ -14661,13 +15787,7 @@ interface LuaPlayer extends LuaControl {
14661
15787
  * Get all alerts matching the given filters, or all alerts if no filters are given.
14662
15788
  * @returns A mapping of surface index to an array of arrays of {@link alerts | runtime:Alert} indexed by the {@link alert type | runtime:defines.alert_type}.
14663
15789
  */
14664
- get_alerts(this: void, table: {
14665
- entity?: LuaEntity;
14666
- prototype?: LuaEntityPrototype;
14667
- position?: MapPosition;
14668
- type?: defines.alert_type;
14669
- surface?: SurfaceIdentification;
14670
- }): LuaTable<uint32, Record<defines.alert_type, Alert[]>>;
15790
+ get_alerts(this: void, filter: AlertFilter): LuaTable<uint32, Record<defines.alert_type, Alert[]>>;
14671
15791
  /**
14672
15792
  * The characters associated with this player.
14673
15793
  *
@@ -14687,9 +15807,8 @@ interface LuaPlayer extends LuaControl {
14687
15807
  get_infinity_inventory_filter(this: void, index: uint32): InfinityInventoryFilter | null;
14688
15808
  /**
14689
15809
  * Gets the quick bar filter for the given slot or `nil`.
14690
- * @param index The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc.
14691
15810
  */
14692
- get_quick_bar_slot(this: void, index: uint32): ItemFilter | null;
15811
+ get_quick_bar_slot(this: void, page_index: uint8, slot_index: uint8): QuickBarSlot | null;
14693
15812
  /**
14694
15813
  * Get all recipes that currently have recipe notifications for this player.
14695
15814
  */
@@ -14731,17 +15850,16 @@ interface LuaPlayer extends LuaControl {
14731
15850
  */
14732
15851
  mute_alert(this: void, alert_type: defines.alert_type): boolean;
14733
15852
  /**
14734
- * Invokes the "smart pipette" action on the player as if the user pressed it.
14735
- * @param allow_ghost Defaults to false.
15853
+ * Emulates the player using the "smart pipette" that results in the given id and quality.
15854
+ * @param allow_ghost Defaults to `false`.
14736
15855
  * @returns Whether the smart pipette found something to put into the cursor.
14737
15856
  */
14738
15857
  pipette(this: void, id: PipetteID, quality?: QualityID, allow_ghost?: boolean): boolean;
14739
15858
  /**
14740
- * Invokes the "smart pipette" action on the player as if the user pressed it. This method is deprecated in favor of {@link LuaPlayer::pipette | runtime:LuaPlayer::pipette} and should not be used.
14741
- * @param allow_ghost Defaults to false.
14742
- * @returns Whether the smart pipette found something to place.
15859
+ * Play a music track for this player.
15860
+ * @param music_specification The track to play.
14743
15861
  */
14744
- pipette_entity(this: void, entity: EntityWithQualityID, allow_ghost?: boolean): boolean;
15862
+ play_music(this: void, music_specification: PlayMusicSpecification): void;
14745
15863
  /**
14746
15864
  * Play a sound for this player.
14747
15865
  *
@@ -14771,29 +15889,21 @@ interface LuaPlayer extends LuaControl {
14771
15889
  /**
14772
15890
  * Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.
14773
15891
  */
14774
- remove_alert(this: void, table: {
14775
- entity?: LuaEntity;
14776
- prototype?: EntityID;
14777
- position?: MapPosition;
14778
- type?: defines.alert_type;
14779
- surface?: SurfaceIdentification;
14780
- icon?: SignalID;
14781
- message?: LocalisedString;
14782
- }): void;
15892
+ remove_alert(this: void, filter: AlertFilter): void;
14783
15893
  /**
14784
- * Requests a translation for the given localised string. If the request is successful, the {@link on_string_translated | runtime:on_string_translated} event will be fired with the results.
15894
+ * Requests a translation for the given localised string. The {@link on_string_translated | runtime:on_string_translated} event will be fired with the results.
14785
15895
  *
14786
- * Does nothing if this player is not connected (see {@link LuaPlayer::connected | runtime:LuaPlayer::connected}).
15896
+ * If this player is not connected (see {@link LuaPlayer::connected | runtime:LuaPlayer::connected}) the translation will happen next time they connect.
14787
15897
  * @returns The unique ID for the requested translation.
14788
15898
  */
14789
- request_translation(this: void, localised_string: LocalisedString): uint32 | null;
15899
+ request_translation(this: void, localised_string: LocalisedString): uint32;
14790
15900
  /**
14791
- * Requests translation for the given set of localised strings. If the request is successful, a {@link on_string_translated | runtime:on_string_translated} event will be fired for each string with the results.
15901
+ * Requests translation for the given set of localised strings. A {@link on_string_translated | runtime:on_string_translated} event will be fired for each string with the results.
14792
15902
  *
14793
- * Does nothing if this player is not connected (see {@link LuaPlayer::connected | runtime:LuaPlayer::connected}).
15903
+ * If this player is not connected (see {@link LuaPlayer::connected | runtime:LuaPlayer::connected}) the translation will happen next time they connect.
14794
15904
  * @returns The unique IDs for the requested translations.
14795
15905
  */
14796
- request_translations(this: void, localised_strings: LocalisedString[]): uint32[] | null;
15906
+ request_translations(this: void, localised_strings: LocalisedString[]): uint32[];
14797
15907
  /**
14798
15908
  * Sets which quick bar page is being used for the given screen page.
14799
15909
  * @param screen_index The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change.
@@ -14845,10 +15955,9 @@ interface LuaPlayer extends LuaControl {
14845
15955
  set_infinity_inventory_filter(this: void, index: uint32, filter: InfinityInventoryFilter | nil): void;
14846
15956
  /**
14847
15957
  * Sets the quick bar filter for the given slot. If a {@link LuaItemStack | runtime:LuaItemStack} is provided, the slot will be set to that particular item instance if it has extra data, for example a specific blueprint or spidertron remote. Otherwise, it will be set to all items of that prototype, for example iron plates.
14848
- * @param index The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc.
14849
15958
  * @param filter The filter or `nil` to clear it.
14850
15959
  */
14851
- set_quick_bar_slot(this: void, index: uint32, filter: LuaItemStack | ItemWithQualityID | nil): void;
15960
+ set_quick_bar_slot(this: void, page_index: uint8, slot_index: uint8, filter: LuaItemStack | ItemWithQualityID | QuickBarSlot | nil): void;
14852
15961
  /**
14853
15962
  * Make a custom Lua shortcut available or unavailable.
14854
15963
  * @param prototype_name Prototype name of the custom shortcut.
@@ -14865,6 +15974,31 @@ interface LuaPlayer extends LuaControl {
14865
15974
  * @param zoom_limits The new zoom limits. See {@link LuaPlayer::zoom_limits | runtime:LuaPlayer::zoom_limits} for usage information.
14866
15975
  */
14867
15976
  set_zoom_limits(this: void, controller_type: defines.controllers, zoom_limits: ZoomLimits): void;
15977
+ /**
15978
+ * Performs the given transfer action between the source and target as if the player did the action.
15979
+ *
15980
+ * This can be paired with {@link defines.events.on_gui_inventory_action | runtime:defines.events.on_gui_inventory_action} to make custom inventory GUIs that act like builtin inventories.
15981
+ *
15982
+ * Reach distance is ignored and can be checked using {@link LuaControl::can_reach_entity | runtime:LuaControl::can_reach_entity} if wanted.
15983
+ * @param table.source_inventory The inventory to transfer from.
15984
+ * @param table.index The inventory slot index.
15985
+ * @param table.transfer_type The type of transfer to perform. Only stack_transfer, stack_split, inventory_transfer, and inventory_split can be used.
15986
+ * @param table.target_equipment_grid If true - when transferring into vehicles - only placeable equipment items will be placed into the equipment grid as equipment and normal items are skipped. Defaults to `false`.
15987
+ * @param table.play_transfer_sound If the standard sound for transferring items should be played on success. Defaults to `true`.
15988
+ * @param table.check_for_invalid_armor_removal If transfer from the player armor inventory is blocked when flying or if it would shrink the inventory to the point items would spill. Defaults to `true`.
15989
+ * @param table.notify_if_invalid_armor_removal If on being blocked by invalid armor removal it sends a notification to the player that the transfer is blocked. Defaults to `true`.
15990
+ * @returns List of all items moved. This will be `nil` if the transfer was blocked.
15991
+ */
15992
+ stack_transfers(this: void, table: {
15993
+ source_inventory: LuaInventory;
15994
+ index: uint32;
15995
+ target: LuaInventory | LuaEntity | LuaPlayer | LuaItem | LuaItemStack | LuaEquipment;
15996
+ transfer_type: defines.inventory_actions;
15997
+ target_equipment_grid?: boolean;
15998
+ play_transfer_sound?: boolean;
15999
+ check_for_invalid_armor_removal?: boolean;
16000
+ notify_if_invalid_armor_removal?: boolean;
16001
+ }): ItemWithQualityCount[] | null;
14868
16002
  /**
14869
16003
  * Starts selection with selection tool from the specified position. Does nothing if the player's cursor is not a selection tool.
14870
16004
  * @param position The position to start selection from.
@@ -14941,6 +16075,14 @@ interface LuaPlayer extends LuaControl {
14941
16075
  */
14942
16076
  readonly connected: boolean;
14943
16077
  readonly controller_type: defines.controllers;
16078
+ /**
16079
+ * The name of an ambient sound (music) the player is currently listening to.
16080
+ *
16081
+ * If music is not playing, returns an empty string.
16082
+ *
16083
+ * If the player is disconnected, returns the last played ambient sound.
16084
+ */
16085
+ readonly current_music: string;
14944
16086
  /**
14945
16087
  * Returns true if the current item stack in cursor will be destroyed after clearing the cursor. Manually putting it into inventory still preserves the item. If the cursor stack is not one of the supported types (blueprint, blueprint-book, deconstruction-planner, upgrade-planner), write operation will be silently ignored.
14946
16088
  */
@@ -14949,6 +16091,10 @@ interface LuaPlayer extends LuaControl {
14949
16091
  * When in a cutscene; the character this player would be using once the cutscene is over, if any. Returns `nil` when the player is disconnected (see {@link LuaPlayer::connected | runtime:LuaPlayer::connected}).
14950
16092
  */
14951
16093
  readonly cutscene_character?: LuaEntity;
16094
+ /**
16095
+ * Set to `true` to disallow opening the space map and hide the space map button.
16096
+ */
16097
+ disable_space_map: boolean;
14952
16098
  /**
14953
16099
  * The display density scale for this player. The display density scale is the factor of {@link LuaPlayer::display_scale | runtime:LuaPlayer::display_scale} that is determined by the physical DPI of the screen that Factorio is running on. In most cases, the default value is 1. If the player is playing on a high-density display, this value may be 2 or greater.
14954
16100
  *
@@ -14974,7 +16120,7 @@ interface LuaPlayer extends LuaControl {
14974
16120
  /**
14975
16121
  * The source entity used during entity settings copy-paste, if any.
14976
16122
  */
14977
- readonly entity_copy_source?: LuaEntity;
16123
+ entity_copy_source?: LuaEntity;
14978
16124
  /**
14979
16125
  * The player's game view settings.
14980
16126
  */
@@ -15064,6 +16210,10 @@ interface LuaPlayer extends LuaControl {
15064
16210
  * The current vehicle of this player's physical controller.
15065
16211
  */
15066
16212
  readonly physical_vehicle?: LuaEntity;
16213
+ /**
16214
+ * Amount of slots one row(page) of quickbar has.
16215
+ */
16216
+ readonly quick_bar_width: uint8;
15067
16217
  /**
15068
16218
  * If items not included in this map editor infinity inventory filters should be removed.
15069
16219
  */
@@ -15072,6 +16222,23 @@ interface LuaPlayer extends LuaControl {
15072
16222
  * The render mode of the player, like map or zoom to world.
15073
16223
  */
15074
16224
  readonly render_mode: defines.render_mode;
16225
+ /**
16226
+ * The quality used when this player respawns.
16227
+ *
16228
+ * This can be set at any time however it is best to set it during the {@link defines.events.on_player_died | runtime:defines.events.on_player_died} event.
16229
+ */
16230
+ readonly respawn_quality?: LuaQualityPrototype;
16231
+ /**
16232
+ * The quality used when this player respawns.
16233
+ *
16234
+ * This can be set at any time however it is best to set it during the {@link defines.events.on_player_died | runtime:defines.events.on_player_died} event.
16235
+ * @customName respawn_quality
16236
+ */
16237
+ respawn_quality_write?: QualityID;
16238
+ /**
16239
+ * The filters that will be applied when this player respawns. These only have meaning if the player is actively waiting to respawn.
16240
+ */
16241
+ saved_logistic_filters: SavedLogisticFilters;
15075
16242
  /**
15076
16243
  * If `true`, circle and name of given player is rendered on the map/chart.
15077
16244
  */
@@ -15186,10 +16353,14 @@ interface LuaProcessionLayerInheritanceGroupPrototype extends LuaPrototypeBase {
15186
16353
  * Prototype of a procession.
15187
16354
  */
15188
16355
  interface LuaProcessionPrototype extends LuaPrototypeBase {
16356
+ readonly ground_timeline?: ProcessionTimeline;
15189
16357
  /**
15190
16358
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
15191
16359
  */
15192
16360
  readonly object_name: string;
16361
+ readonly procession_style: uint32[];
16362
+ readonly timeline: ProcessionTimeline;
16363
+ readonly usage: 'departure' | 'arrival' | 'intermezzo';
15193
16364
  /**
15194
16365
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
15195
16366
  */
@@ -15559,11 +16730,9 @@ interface LuaPrototypes {
15559
16730
  */
15560
16731
  readonly trivial_smoke: Record<string, LuaTrivialSmokePrototype>;
15561
16732
  /**
15562
- * All utility constants.
15563
- *
15564
- * See {@link UtilityConstants | prototype:UtilityConstants} for possible values.
16733
+ * All game-defined utility constants. Note that his is implemented as a {@link LuaCustomTable | runtime:LuaCustomTable}.
15565
16734
  */
15566
- readonly utility_constants: Record<string, AnyBasic>;
16735
+ readonly utility_constants: UtilityConstants;
15567
16736
  /**
15568
16737
  * A dictionary containing every LuaVirtualSignalPrototype indexed by `name`.
15569
16738
  */
@@ -15612,6 +16781,11 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
15612
16781
  readonly beacon_module_slots_bonus: ItemStackIndex;
15613
16782
  readonly beacon_power_usage_multiplier: float;
15614
16783
  readonly beacon_supply_area_distance_bonus: float;
16784
+ readonly cargo_wagon_inventory_size_multiplier: double;
16785
+ /**
16786
+ * Probability of additional quality increase happening after quality was increased to reach this quality in the same crafting/mining operation.
16787
+ */
16788
+ readonly chain_probability: double;
15615
16789
  /**
15616
16790
  * The color of the prototype
15617
16791
  */
@@ -15635,11 +16809,17 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
15635
16809
  * Level basically specifies the stat-increasing value of this quality level.
15636
16810
  */
15637
16811
  readonly level: uint32;
16812
+ readonly locomotive_power_multiplier: double;
15638
16813
  readonly logistic_cell_charging_energy_multiplier: double;
15639
16814
  readonly logistic_cell_charging_station_count_bonus: uint32;
15640
16815
  readonly mining_drill_mining_radius_bonus: float;
15641
16816
  readonly mining_drill_module_slots_bonus: ItemStackIndex;
15642
16817
  readonly mining_drill_resource_drain_multiplier: float;
16818
+ readonly module_consumption_multiplier: float;
16819
+ readonly module_pollution_multiplier: float;
16820
+ readonly module_productivity_multiplier: float;
16821
+ readonly module_quality_multiplier: float;
16822
+ readonly module_speed_multiplier: float;
15643
16823
  /**
15644
16824
  * The next higher level of the quality
15645
16825
  */
@@ -15652,8 +16832,19 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
15652
16832
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
15653
16833
  */
15654
16834
  readonly object_name: string;
16835
+ readonly previous: LuaQualityPrototype;
16836
+ /**
16837
+ * Probability of additional quality decrease happening after quality was decreased to reach this quality in the same crafting/mining operation.
16838
+ */
16839
+ readonly previous_chain_probability: double;
16840
+ /**
16841
+ * The probability multiplier of getting the previous level of quality.
16842
+ */
16843
+ readonly previous_probability: double;
15655
16844
  readonly range_multiplier: double;
16845
+ readonly rolling_stock_max_speed_multiplier: double;
15656
16846
  readonly science_pack_drain_multiplier: float;
16847
+ readonly spoil_ticks_multiplier: float;
15657
16848
  readonly tool_durability_multiplier: double;
15658
16849
  /**
15659
16850
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
@@ -15677,10 +16868,20 @@ interface LuaRCON {
15677
16868
  * Control behavior for radars
15678
16869
  */
15679
16870
  interface LuaRadarControlBehavior extends LuaControlBehavior {
16871
+ /**
16872
+ * Whether this radar is in universe (channel) or surface mode.
16873
+ */
16874
+ mode: defines.control_behavior.radar.mode;
15680
16875
  /**
15681
16876
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
15682
16877
  */
15683
16878
  readonly object_name: string;
16879
+ /**
16880
+ * The channel that is used in universe mode. Radars on the same force with the same channel in universe mode are connected to each other with hidden radar wires.
16881
+ *
16882
+ * If the channel is empty or a {@link parameter | runtime:LuaPrototypeBase::parameter}, the radar will be disconnected.
16883
+ */
16884
+ universe_channel?: SignalID;
15684
16885
  /**
15685
16886
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
15686
16887
  */
@@ -15888,13 +17089,9 @@ interface LuaRecipe {
15888
17089
  */
15889
17090
  reload(this: void): void;
15890
17091
  /**
15891
- * Additional categories of this recipe.
15892
- */
15893
- readonly additional_categories: string[];
15894
- /**
15895
- * Category of the recipe.
17092
+ * Categories of the recipe.
15896
17093
  */
15897
- readonly category: string;
17094
+ readonly categories: string[];
15898
17095
  /**
15899
17096
  * Can the recipe be used?
15900
17097
  */
@@ -15986,21 +17183,31 @@ interface LuaRecipeCategoryPrototype extends LuaPrototypeBase {
15986
17183
  * A crafting recipe prototype.
15987
17184
  */
15988
17185
  interface LuaRecipePrototype extends LuaPrototypeBase {
17186
+ /**
17187
+ * Ingredient materials required to craft recipe when configured to a specific quality.
17188
+ * @param recipe_quality Defaults to `normal`.
17189
+ */
17190
+ get_ingredient_quality(this: void, ingredient_index: uint32, recipe_quality?: QualityID): LuaQualityPrototype;
17191
+ /**
17192
+ * Average amount of the product given.
17193
+ */
17194
+ get_product_amount(this: void, product_index: uint32, productivity?: double): double;
17195
+ /**
17196
+ * Quality of the product given when recipe is configured to a specific quality.
17197
+ * @param recipe_quality Defaults to `normal`.
17198
+ */
17199
+ get_product_quality(this: void, product_index: uint32, recipe_quality?: QualityID): LuaQualityPrototype;
15989
17200
  /**
15990
17201
  * Checks if recipe has given category
15991
17202
  * @returns `true` if recipe has this category.
15992
17203
  */
15993
17204
  has_category(this: void, category: RecipeCategoryID): boolean;
15994
- /**
15995
- * Additional categories of the recipe.
15996
- */
15997
- readonly additional_categories: string[];
15998
17205
  /**
15999
17206
  * If this recipe is enabled for the purpose of intermediate hand-crafting.
16000
17207
  */
16001
17208
  readonly allow_as_intermediate: boolean;
16002
17209
  /**
16003
- * Is this recipe allowed to be broken down for the recipe tooltip "Total raw" calculations?
17210
+ * Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.
16004
17211
  */
16005
17212
  readonly allow_decomposition: boolean;
16006
17213
  /**
@@ -16028,13 +17235,13 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
16028
17235
  */
16029
17236
  readonly always_show_made_in: boolean;
16030
17237
  /**
16031
- * If the products are always shown in the recipe tooltip.
17238
+ * True if a player can set quality of the recipe to craft. False when only normal quality recipes can be crafted.
16032
17239
  */
16033
- readonly always_show_products: boolean;
17240
+ readonly can_set_quality: boolean;
16034
17241
  /**
16035
- * Category of the recipe.
17242
+ * Categories of the recipe.
16036
17243
  */
16037
- readonly category: string;
17244
+ readonly categories: string[];
16038
17245
  readonly crafting_machine_tints: Color[];
16039
17246
  readonly effect_limitation_messages?: LocalisedString[];
16040
17247
  /**
@@ -16065,7 +17272,7 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
16065
17272
  readonly hide_from_flow_stats: boolean;
16066
17273
  readonly hide_from_player_crafting: boolean;
16067
17274
  /**
16068
- * Is this recipe is marked to be hidden from the signal GUI.
17275
+ * Whether this recipe is marked to be hidden from the signal GUI.
16069
17276
  */
16070
17277
  readonly hide_from_signal_gui: boolean;
16071
17278
  /**
@@ -16076,7 +17283,6 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
16076
17283
  ```
16077
17284
  */
16078
17285
  readonly ingredients: Ingredient[];
16079
- readonly is_parameter: boolean;
16080
17286
  /**
16081
17287
  * The main product of this recipe, if any.
16082
17288
  */
@@ -16106,12 +17312,6 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
16106
17312
  * The multiplier used when this recipe is copied from an assembling machine to a requester chest. For each item in the recipe the item count * this value is set in the requester chest.
16107
17313
  */
16108
17314
  readonly request_paste_multiplier: uint32;
16109
- readonly reset_freshness_on_craft: boolean;
16110
- readonly result_is_always_fresh: boolean;
16111
- /**
16112
- * If the amount is shown in the recipe tooltip title when the recipe produces more than 1 product.
16113
- */
16114
- readonly show_amount_in_title: boolean;
16115
17315
  /**
16116
17316
  * The surface conditions required to craft this recipe.
16117
17317
  */
@@ -16121,7 +17321,7 @@ interface LuaRecipePrototype extends LuaPrototypeBase {
16121
17321
  */
16122
17322
  readonly trash?: LuaItemPrototype[];
16123
17323
  /**
16124
- * Is this recipe unlocks the result item(s) so they're shown in filter-select GUIs.
17324
+ * Whether this recipe unlocks the result item(s) so they're shown in filter-select GUIs.
16125
17325
  */
16126
17326
  readonly unlock_results: boolean;
16127
17327
  /**
@@ -16143,8 +17343,8 @@ interface LuaRecord {
16143
17343
  * @param table.direction The direction to use when building
16144
17344
  * @param table.build_mode If `normal`, blueprint will not be built if any one thing can't be built. If `forced`, anything that can be built is built and obstructing nature entities will be deconstructed. If `superforced`, all obstructions will be deconstructed and the blueprint will be built.
16145
17345
  * @param table.skip_fog_of_war If chunks covered by fog-of-war are skipped.
16146
- * @param table.by_player The player to use if any. If provided {@link defines.events.on_built_entity | runtime:defines.events.on_built_entity} will also be fired on successful entity creation.
16147
- * @param table.raise_built If true; {@link defines.events.script_raised_built | runtime:defines.events.script_raised_built} will be fired on successful entity creation. Note: this is ignored if by_player is provided.
17346
+ * @param table.by_player The player to use if any. If provided {@link defines.events.on_built_entity | runtime:defines.events.on_built_entity} will be fired for new entities and {@link defines.events.on_blueprint_settings_pasted | runtime:defines.events.on_blueprint_settings_pasted} will be fired for existing entities that are updated.
17347
+ * @param table.raise_built If true; {@link defines.events.script_raised_built | runtime:defines.events.script_raised_built} will be fired for new entities and {@link defines.events.on_blueprint_settings_pasted | runtime:defines.events.on_blueprint_settings_pasted} will be fired for existing entities that are updated. Note: this is ignored if by_player is provided.
16148
17348
  * @returns Array of created ghosts
16149
17349
  */
16150
17350
  build_blueprint(this: void, table: {
@@ -16357,7 +17557,7 @@ interface LuaRecord {
16357
17557
  */
16358
17558
  readonly default_icons: BlueprintSignalIcon[];
16359
17559
  /**
16360
- * The number of entity filters this deconstruction planner supports.
17560
+ * The number of entity filters this deconstruction planner has.
16361
17561
  */
16362
17562
  readonly entity_filter_count: uint32;
16363
17563
  /**
@@ -16368,14 +17568,14 @@ interface LuaRecord {
16368
17568
  * The entity filters for this deconstruction planner. The attribute is a sparse array with the keys representing the index of the filter. All prototypes in this array must not have the `"not-deconstructable"` flag set and are either a `cliff` or marked as `minable`.
16369
17569
  */
16370
17570
  entity_filters: ItemFilter[];
16371
- /**
16372
- * Is this blueprint record a preview? A preview record must be synced by the player before entity and tile data can be read. This property is deprecated in favor of {@link LuaRecord::is_preview | runtime:LuaRecord::is_preview} and should not be used.
16373
- */
16374
- readonly is_blueprint_preview: boolean;
16375
17571
  /**
16376
17572
  * Checks if this record is in a preview state.
16377
17573
  */
16378
17574
  readonly is_preview: boolean;
17575
+ /**
17576
+ * The current label for this record, if any.
17577
+ */
17578
+ label?: string;
16379
17579
  /**
16380
17580
  * The current count of mappers in the upgrade item.
16381
17581
  */
@@ -16384,12 +17584,16 @@ interface LuaRecord {
16384
17584
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
16385
17585
  */
16386
17586
  readonly object_name: string;
17587
+ /**
17588
+ * The description for this deconstruction planner or upgrade planner.
17589
+ */
17590
+ planner_description: string;
16387
17591
  /**
16388
17592
  * The preview icons for this record.
16389
17593
  */
16390
17594
  preview_icons: BlueprintSignalIcon[];
16391
17595
  /**
16392
- * The number of tile filters this deconstruction planner supports.
17596
+ * The number of tile filters this deconstruction planner has.
16393
17597
  */
16394
17598
  readonly tile_filter_count: uint32;
16395
17599
  /**
@@ -16576,6 +17780,10 @@ interface LuaRenderObject {
16576
17780
  * Where top left corner of this rectangle is drawn.
16577
17781
  */
16578
17782
  left_top: ScriptRenderTarget;
17783
+ /**
17784
+ * Whether this sprite or animation should be rendered as a sprite, light or both at once.
17785
+ */
17786
+ light_mode: ScriptSpriteLightMode;
16579
17787
  /**
16580
17788
  * Radius of the outer edge of this arc.
16581
17789
  */
@@ -16748,6 +17956,7 @@ interface LuaRendering {
16748
17956
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
16749
17957
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
16750
17958
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
17959
+ * @param table.light_mode Whether this object should be rendered as a sprite, light or both at once. Defaults to "occluder".
16751
17960
  */
16752
17961
  draw_animation(this: void, table: {
16753
17962
  animation: string;
@@ -16770,6 +17979,7 @@ interface LuaRendering {
16770
17979
  visible?: boolean;
16771
17980
  only_in_alt_mode?: boolean;
16772
17981
  render_mode?: ScriptRenderMode;
17982
+ light_mode?: ScriptSpriteLightMode;
16773
17983
  }): LuaRenderObject;
16774
17984
  /**
16775
17985
  * Create an arc.
@@ -16834,7 +18044,7 @@ interface LuaRendering {
16834
18044
  render_mode?: ScriptRenderMode;
16835
18045
  }): LuaRenderObject;
16836
18046
  /**
16837
- * Create a light.
18047
+ * Create a gradient light which is not occluded by any sprites. It is rendered at lower resolution, so it takes less GPU power. The same technique is used for lights drawn by {@link LightDefinition | prototype:LightDefinition}.
16838
18048
  *
16839
18049
  * The base game uses the utility sprites `light_medium` and `light_small` for lights.
16840
18050
  * @param table.orientation The orientation of the light. Default is 0.
@@ -16993,6 +18203,7 @@ interface LuaRendering {
16993
18203
  * @param table.visible If this is rendered to anyone at all. Defaults to true.
16994
18204
  * @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
16995
18205
  * @param table.render_mode Mode which this object should render in. Defaults to "game".
18206
+ * @param table.light_mode Whether this object should be rendered as a sprite, light or both at once. Defaults to "occluder".
16996
18207
  * @example ```
16997
18208
  -- This will draw an iron plate icon at the character's feet. The sprite will move together with the character.
16998
18209
  rendering.draw_sprite{sprite = "item.iron-plate", target = game.player.character, surface = game.player.surface}
@@ -17021,6 +18232,7 @@ interface LuaRendering {
17021
18232
  visible?: boolean;
17022
18233
  only_in_alt_mode?: boolean;
17023
18234
  render_mode?: ScriptRenderMode;
18235
+ light_mode?: ScriptSpriteLightMode;
17024
18236
  }): LuaRenderObject;
17025
18237
  /**
17026
18238
  * Create a text.
@@ -17703,6 +18915,25 @@ interface LuaSimulation {
17703
18915
  */
17704
18916
  readonly valid: boolean;
17705
18917
  }
18918
+ /**
18919
+ * Control behavior for entities with a single fluid box (i.e. pipe, pipe-to-ground, storage-tank).
18920
+ */
18921
+ interface LuaSingleFluidBoxControlBehavior extends LuaControlBehavior {
18922
+ circuit_exclusive_mode_of_operation: defines.control_behavior.single_fluid_box.exclusive_mode;
18923
+ /**
18924
+ * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
18925
+ */
18926
+ readonly object_name: string;
18927
+ /**
18928
+ * If this will read the temperature of the fluid.
18929
+ */
18930
+ read_temperature: boolean;
18931
+ temperature_signal?: SignalID;
18932
+ /**
18933
+ * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
18934
+ */
18935
+ readonly valid: boolean;
18936
+ }
17706
18937
  /**
17707
18938
  * Prototype of a space connection.
17708
18939
  */
@@ -17771,9 +19002,10 @@ interface LuaSpaceLocationPrototype extends LuaPrototypeBase {
17771
19002
  interface LuaSpacePlatform {
17772
19003
  /**
17773
19004
  * Applies the starter pack for this platform if it hasn't already been applied.
19005
+ * @param silent If the platform creation is announced to players on the force. Defaults to `false`.
17774
19006
  * @returns The platform hub.
17775
19007
  */
17776
- apply_starter_pack(this: void): LuaEntity | null;
19008
+ apply_starter_pack(this: void, silent?: boolean): LuaEntity | null;
17777
19009
  /**
17778
19010
  * Returns `true` when the space platform isn't waiting on any delivery from the planet.
17779
19011
  */
@@ -17903,7 +19135,7 @@ interface LuaSpacePlatform {
17903
19135
  *
17904
19136
  * The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
17905
19137
  *
17906
- * This is a simiplifed schedule that does **not** include groups and interrupts. See {@link LuaSpacePlatform::get_schedule | runtime:LuaSpacePlatform::get_schedule} for full access to the schedule, including interrupts and groups.
19138
+ * This is a simplified schedule that does **not** include groups and interrupts. See {@link LuaSpacePlatform::get_schedule | runtime:LuaSpacePlatform::get_schedule} for full access to the schedule, including interrupts and groups.
17907
19139
  */
17908
19140
  schedule?: PlatformSchedule;
17909
19141
  /**
@@ -17917,13 +19149,27 @@ interface LuaSpacePlatform {
17917
19149
  *
17918
19150
  * Write operation requires a valid space connection and it sets the distance to 0.5.
17919
19151
  */
17920
- space_connection?: LuaSpaceConnectionPrototype;
19152
+ readonly space_connection?: LuaSpaceConnectionPrototype;
19153
+ /**
19154
+ * The space connection this space platform is traveling through or `nil`.
19155
+ *
19156
+ * Write operation requires a valid space connection and it sets the distance to 0.5.
19157
+ * @customName space_connection
19158
+ */
19159
+ space_connection_write?: SpaceConnectionID;
19160
+ /**
19161
+ * The space location this space platform is stopped at or `nil`.
19162
+ *
19163
+ * Write operation requires a valid space location and will cancel pending item requests.
19164
+ */
19165
+ readonly space_location?: LuaSpaceLocationPrototype;
17921
19166
  /**
17922
19167
  * The space location this space platform is stopped at or `nil`.
17923
19168
  *
17924
19169
  * Write operation requires a valid space location and will cancel pending item requests.
19170
+ * @customName space_location
17925
19171
  */
17926
- space_location?: LuaSpaceLocationPrototype;
19172
+ space_location_write?: SpaceLocationID;
17927
19173
  speed: double;
17928
19174
  /**
17929
19175
  * The starter pack used to create this space platform.
@@ -17982,6 +19228,7 @@ interface LuaSpacePlatformHubControlBehavior extends LuaControlBehavior {
17982
19228
  * Whether the signals are used for circuit conditions in the platform's schedule
17983
19229
  */
17984
19230
  send_to_platform: boolean;
19231
+ set_requests: boolean;
17985
19232
  /**
17986
19233
  * Signal to be transmitted with platform's current speed.
17987
19234
  */
@@ -18011,27 +19258,20 @@ interface LuaSplitterControlBehavior extends LuaControlBehavior {
18011
19258
  */
18012
19259
  readonly valid: boolean;
18013
19260
  }
18014
- /**
18015
- * Control behavior for storage tanks.
18016
- */
18017
- interface LuaStorageTankControlBehavior extends LuaControlBehavior {
18018
- /**
18019
- * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
18020
- */
18021
- readonly object_name: string;
18022
- /**
18023
- * If the storage tank content is sent to circuit network
18024
- */
18025
- read_contents: boolean;
18026
- /**
18027
- * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
18028
- */
18029
- readonly valid: boolean;
18030
- }
18031
19261
  /**
18032
19262
  * Style of a GUI element. All of the attributes listed here may be `nil` if not available for a particular GUI element.
18033
19263
  */
18034
19264
  interface LuaStyle {
19265
+ /**
19266
+ * Gets the given sub-style of this style if it exists. See {@link StyleSpecification | prototype:StyleSpecification} types for what sub styles are usable.
19267
+ *
19268
+ * Note: when creating sub-styles they have no set values and have the parent set to the styles top-level default.
19269
+ *
19270
+ * Note: when the parent {@link LuaGuiElement::style | runtime:LuaGuiElement::style} is directly changed (element.style = "new_style") any sub-styles will be invalidated.
19271
+ * @param style_name The style to get.
19272
+ * @param create If true, and the given sub-style is valid - it will be created if it does not exist. Defaults to `false`.
19273
+ */
19274
+ get_style(this: void, style_name: string, create?: boolean): LuaStyle | null;
18035
19275
  badge_font: string;
18036
19276
  badge_horizontal_spacing: int32;
18037
19277
  /**
@@ -18142,7 +19382,7 @@ interface LuaStyle {
18142
19382
  /**
18143
19383
  * Name of this style.
18144
19384
  */
18145
- readonly name: string;
19385
+ name: string;
18146
19386
  /**
18147
19387
  * Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.
18148
19388
  */
@@ -18849,9 +20089,9 @@ interface LuaSurface {
18849
20089
  */
18850
20090
  get_property(this: void, property: SurfacePropertyID): double;
18851
20091
  /**
18852
- * Gets a random generated chunk position or 0,0 if no chunks have been generated on this surface.
20092
+ * Gets a random generated chunk position or nil if no chunks have been generated on this surface.
18853
20093
  */
18854
- get_random_chunk(this: void): ChunkPosition;
20094
+ get_random_chunk(this: void): ChunkPosition | null;
18855
20095
  /**
18856
20096
  * Gets the resource amount of all resources on this surface
18857
20097
  */
@@ -18906,6 +20146,11 @@ interface LuaSurface {
18906
20146
  * @param chunk_position The chunk's position.
18907
20147
  */
18908
20148
  is_chunk_generated(this: void, chunk_position: ChunkPosition): boolean;
20149
+ /**
20150
+ * Play a music track for every player on this surface.
20151
+ * @param music_specification The track to play.
20152
+ */
20153
+ play_music(this: void, music_specification: PlayMusicSpecification): void;
18909
20154
  /**
18910
20155
  * Play a sound for every player on this surface.
18911
20156
  *
@@ -19201,8 +20446,14 @@ interface LuaSurface {
19201
20446
  * Surface-wide effects applied to entities with effect receivers. `nil` if this surface is not using surface-wide effect source.
19202
20447
  */
19203
20448
  global_effect?: ModuleEffects;
20449
+ /**
20450
+ * Global electric network for this surface.
20451
+ */
20452
+ readonly global_electric_network?: LuaElectricSubNetwork;
19204
20453
  /**
19205
20454
  * The global electric network statistics for this surface.
20455
+ *
20456
+ * If this global network is disabled or this surface is removed, the flow statistics obtained from it will also become invalid. However if the surface index of a deleted surface is reused, the related flow statistics may become valid again.
19206
20457
  */
19207
20458
  readonly global_electric_network_statistics?: LuaFlowStatistics;
19208
20459
  /**
@@ -19249,6 +20500,14 @@ interface LuaSurface {
19249
20500
  * The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
19250
20501
  */
19251
20502
  readonly object_name: string;
20503
+ /**
20504
+ * If set, this pollution type will be used over any other planet or platform values.
20505
+ *
20506
+ * If set to an empty table, pollution is disabled. If set to `nil`, the override is 'unset'.
20507
+ *
20508
+ * Reading will be `nil` if unset or a table with the current override (`nil` if overridden to disabled).
20509
+ */
20510
+ override_pollution_type?: Pollutant;
19252
20511
  /**
19253
20512
  * Is peaceful mode enabled on this surface?
19254
20513
  */
@@ -19299,7 +20558,7 @@ interface LuaSurface {
19299
20558
  */
19300
20559
  wind_speed: double;
19301
20560
  }
19302
- type LuaSurfaceCreateEntityParams = BaseLuaSurfaceCreateEntityParams | LuaSurfaceCreateEntityParamsAccumulator | LuaSurfaceCreateEntityParamsAgriculturalTower | LuaSurfaceCreateEntityParamsAmmoTurret | LuaSurfaceCreateEntityParamsArithmeticCombinator | LuaSurfaceCreateEntityParamsArtilleryFlare | LuaSurfaceCreateEntityParamsArtilleryProjectile | LuaSurfaceCreateEntityParamsArtilleryTurret | LuaSurfaceCreateEntityParamsArtilleryWagon | LuaSurfaceCreateEntityParamsAssemblingMachine | LuaSurfaceCreateEntityParamsAsteroid | LuaSurfaceCreateEntityParamsAsteroidCollector | LuaSurfaceCreateEntityParamsBeam | LuaSurfaceCreateEntityParamsCar | LuaSurfaceCreateEntityParamsCargoLandingPad | LuaSurfaceCreateEntityParamsCargoWagon | LuaSurfaceCreateEntityParamsCharacterCorpse | LuaSurfaceCreateEntityParamsCliff | LuaSurfaceCreateEntityParamsConstantCombinator | LuaSurfaceCreateEntityParamsContainer | LuaSurfaceCreateEntityParamsDeciderCombinator | LuaSurfaceCreateEntityParamsDeconstructibleTileProxy | LuaSurfaceCreateEntityParamsDisplayPanel | LuaSurfaceCreateEntityParamsElectricEnergyInterface | LuaSurfaceCreateEntityParamsElectricPole | LuaSurfaceCreateEntityParamsElectricTurret | LuaSurfaceCreateEntityParamsEntityGhost | LuaSurfaceCreateEntityParamsFire | LuaSurfaceCreateEntityParamsFluidTurret | LuaSurfaceCreateEntityParamsFluidWagon | LuaSurfaceCreateEntityParamsFurnace | LuaSurfaceCreateEntityParamsHighlightBox | LuaSurfaceCreateEntityParamsInfinityCargoWagon | LuaSurfaceCreateEntityParamsInfinityContainer | LuaSurfaceCreateEntityParamsInfinityPipe | LuaSurfaceCreateEntityParamsInserter | LuaSurfaceCreateEntityParamsItemEntity | LuaSurfaceCreateEntityParamsItemRequestProxy | LuaSurfaceCreateEntityParamsLamp | LuaSurfaceCreateEntityParamsLaneSplitter | LuaSurfaceCreateEntityParamsLinkedBelt | LuaSurfaceCreateEntityParamsLinkedContainer | LuaSurfaceCreateEntityParamsLoader | LuaSurfaceCreateEntityParamsLoader1x1 | LuaSurfaceCreateEntityParamsLocomotive | LuaSurfaceCreateEntityParamsLogisticContainer | LuaSurfaceCreateEntityParamsMiningDrill | LuaSurfaceCreateEntityParamsParticle | LuaSurfaceCreateEntityParamsPlant | LuaSurfaceCreateEntityParamsPowerSwitch | LuaSurfaceCreateEntityParamsProgrammableSpeaker | LuaSurfaceCreateEntityParamsProjectile | LuaSurfaceCreateEntityParamsProxyContainer | LuaSurfaceCreateEntityParamsPump | LuaSurfaceCreateEntityParamsRailChainSignal | LuaSurfaceCreateEntityParamsRailSignal | LuaSurfaceCreateEntityParamsReactor | LuaSurfaceCreateEntityParamsResource | LuaSurfaceCreateEntityParamsRoboport | LuaSurfaceCreateEntityParamsRocketSilo | LuaSurfaceCreateEntityParamsSelectorCombinator | LuaSurfaceCreateEntityParamsSimpleEntityWithForce | LuaSurfaceCreateEntityParamsSimpleEntityWithOwner | LuaSurfaceCreateEntityParamsSpacePlatformHub | LuaSurfaceCreateEntityParamsSpeechBubble | LuaSurfaceCreateEntityParamsSpiderVehicle | LuaSurfaceCreateEntityParamsSplitter | LuaSurfaceCreateEntityParamsStorageTank | LuaSurfaceCreateEntityParamsStream | LuaSurfaceCreateEntityParamsTileGhost | LuaSurfaceCreateEntityParamsTrainStop | LuaSurfaceCreateEntityParamsTransportBelt | LuaSurfaceCreateEntityParamsTurret | LuaSurfaceCreateEntityParamsUndergroundBelt | LuaSurfaceCreateEntityParamsValve | LuaSurfaceCreateEntityParamsWall;
20561
+ type LuaSurfaceCreateEntityParams = BaseLuaSurfaceCreateEntityParams | LuaSurfaceCreateEntityParamsAccumulator | LuaSurfaceCreateEntityParamsAgriculturalTower | LuaSurfaceCreateEntityParamsAmmoTurret | LuaSurfaceCreateEntityParamsArithmeticCombinator | LuaSurfaceCreateEntityParamsArtilleryFlare | LuaSurfaceCreateEntityParamsArtilleryProjectile | LuaSurfaceCreateEntityParamsArtilleryTurret | LuaSurfaceCreateEntityParamsArtilleryWagon | LuaSurfaceCreateEntityParamsAssemblingMachine | LuaSurfaceCreateEntityParamsAsteroid | LuaSurfaceCreateEntityParamsAsteroidCollector | LuaSurfaceCreateEntityParamsBeam | LuaSurfaceCreateEntityParamsBoiler | LuaSurfaceCreateEntityParamsCar | LuaSurfaceCreateEntityParamsCargoLandingPad | LuaSurfaceCreateEntityParamsCargoWagon | LuaSurfaceCreateEntityParamsCharacterCorpse | LuaSurfaceCreateEntityParamsCliff | LuaSurfaceCreateEntityParamsConstantCombinator | LuaSurfaceCreateEntityParamsContainer | LuaSurfaceCreateEntityParamsDeciderCombinator | LuaSurfaceCreateEntityParamsDeconstructibleTileProxy | LuaSurfaceCreateEntityParamsDisplayPanel | LuaSurfaceCreateEntityParamsElectricEnergyInterface | LuaSurfaceCreateEntityParamsElectricPole | LuaSurfaceCreateEntityParamsElectricTurret | LuaSurfaceCreateEntityParamsEntityGhost | LuaSurfaceCreateEntityParamsFire | LuaSurfaceCreateEntityParamsFluidTurret | LuaSurfaceCreateEntityParamsFluidWagon | LuaSurfaceCreateEntityParamsFurnace | LuaSurfaceCreateEntityParamsHeatInterface | LuaSurfaceCreateEntityParamsHeatPipe | LuaSurfaceCreateEntityParamsHighlightBox | LuaSurfaceCreateEntityParamsInfinityCargoWagon | LuaSurfaceCreateEntityParamsInfinityContainer | LuaSurfaceCreateEntityParamsInfinityPipe | LuaSurfaceCreateEntityParamsInserter | LuaSurfaceCreateEntityParamsItemEntity | LuaSurfaceCreateEntityParamsItemRequestProxy | LuaSurfaceCreateEntityParamsLab | LuaSurfaceCreateEntityParamsLamp | LuaSurfaceCreateEntityParamsLandMine | LuaSurfaceCreateEntityParamsLaneSplitter | LuaSurfaceCreateEntityParamsLinkedBelt | LuaSurfaceCreateEntityParamsLinkedContainer | LuaSurfaceCreateEntityParamsLoader | LuaSurfaceCreateEntityParamsLoader1x1 | LuaSurfaceCreateEntityParamsLocomotive | LuaSurfaceCreateEntityParamsLogisticContainer | LuaSurfaceCreateEntityParamsMiningDrill | LuaSurfaceCreateEntityParamsOffshorePump | LuaSurfaceCreateEntityParamsParticle | LuaSurfaceCreateEntityParamsPipe | LuaSurfaceCreateEntityParamsPipeToGround | LuaSurfaceCreateEntityParamsPlant | LuaSurfaceCreateEntityParamsPowerSwitch | LuaSurfaceCreateEntityParamsProgrammableSpeaker | LuaSurfaceCreateEntityParamsProjectile | LuaSurfaceCreateEntityParamsProxyContainer | LuaSurfaceCreateEntityParamsPump | LuaSurfaceCreateEntityParamsRadar | LuaSurfaceCreateEntityParamsRailChainSignal | LuaSurfaceCreateEntityParamsRailSignal | LuaSurfaceCreateEntityParamsReactor | LuaSurfaceCreateEntityParamsResource | LuaSurfaceCreateEntityParamsRoboport | LuaSurfaceCreateEntityParamsRocketSilo | LuaSurfaceCreateEntityParamsSelectorCombinator | LuaSurfaceCreateEntityParamsSimpleEntityWithForce | LuaSurfaceCreateEntityParamsSimpleEntityWithOwner | LuaSurfaceCreateEntityParamsSpacePlatformHub | LuaSurfaceCreateEntityParamsSpeechBubble | LuaSurfaceCreateEntityParamsSpiderVehicle | LuaSurfaceCreateEntityParamsSplitter | LuaSurfaceCreateEntityParamsStorageTank | LuaSurfaceCreateEntityParamsStream | LuaSurfaceCreateEntityParamsTileGhost | LuaSurfaceCreateEntityParamsTrainStop | LuaSurfaceCreateEntityParamsTransportBelt | LuaSurfaceCreateEntityParamsTurret | LuaSurfaceCreateEntityParamsUndergroundBelt | LuaSurfaceCreateEntityParamsValve | LuaSurfaceCreateEntityParamsWall;
19303
20562
  interface BaseLuaSurfaceCreateEntityParams {
19304
20563
  /**
19305
20564
  * Used by entities with a burner energy source.
@@ -19462,6 +20721,10 @@ interface LuaSurfaceCreateEntityParamsArtilleryTurret extends BaseLuaSurfaceCrea
19462
20721
  */
19463
20722
  interface LuaSurfaceCreateEntityParamsArtilleryWagon extends BaseLuaSurfaceCreateEntityParams {
19464
20723
  'artillery_auto_targeting'?: boolean;
20724
+ /**
20725
+ * True by default. If set to false, rolling stock will not connect to other rolling stocks nearby.
20726
+ */
20727
+ 'auto_connect'?: boolean;
19465
20728
  /**
19466
20729
  * The color of this rolling stock, if it supports colors.
19467
20730
  */
@@ -19525,6 +20788,13 @@ interface LuaSurfaceCreateEntityParamsBeam extends BaseLuaSurfaceCreateEntityPar
19525
20788
  */
19526
20789
  'target_position'?: MapPosition;
19527
20790
  }
20791
+ /**
20792
+ *
20793
+ * Applies to variant case `boiler`
20794
+ */
20795
+ interface LuaSurfaceCreateEntityParamsBoiler extends BaseLuaSurfaceCreateEntityParams {
20796
+ 'control_behavior'?: BoilerBlueprintControlBehavior;
20797
+ }
19528
20798
  /**
19529
20799
  *
19530
20800
  * Applies to variant case `car`
@@ -19553,6 +20823,10 @@ interface LuaSurfaceCreateEntityParamsCargoLandingPad extends BaseLuaSurfaceCrea
19553
20823
  * Applies to variant case `cargo-wagon`
19554
20824
  */
19555
20825
  interface LuaSurfaceCreateEntityParamsCargoWagon extends BaseLuaSurfaceCreateEntityParams {
20826
+ /**
20827
+ * True by default. If set to false, rolling stock will not connect to other rolling stocks nearby.
20828
+ */
20829
+ 'auto_connect'?: boolean;
19556
20830
  /**
19557
20831
  * The color of this rolling stock, if it supports colors.
19558
20832
  */
@@ -19601,8 +20875,9 @@ interface LuaSurfaceCreateEntityParamsContainer extends BaseLuaSurfaceCreateEnti
19601
20875
  /**
19602
20876
  * Inventory index where the red limiting bar should be set.
19603
20877
  */
19604
- 'bar'?: uint32;
20878
+ 'bar'?: ItemStackIndex;
19605
20879
  'control_behavior'?: ContainerBlueprintControlBehavior;
20880
+ 'filters'?: BlueprintItemFilter[];
19606
20881
  }
19607
20882
  /**
19608
20883
  *
@@ -19702,6 +20977,10 @@ interface LuaSurfaceCreateEntityParamsFluidTurret extends BaseLuaSurfaceCreateEn
19702
20977
  * Applies to variant case `fluid-wagon`
19703
20978
  */
19704
20979
  interface LuaSurfaceCreateEntityParamsFluidWagon extends BaseLuaSurfaceCreateEntityParams {
20980
+ /**
20981
+ * True by default. If set to false, rolling stock will not connect to other rolling stocks nearby.
20982
+ */
20983
+ 'auto_connect'?: boolean;
19705
20984
  /**
19706
20985
  * The color of this rolling stock, if it supports colors.
19707
20986
  */
@@ -19721,6 +21000,21 @@ interface LuaSurfaceCreateEntityParamsFluidWagon extends BaseLuaSurfaceCreateEnt
19721
21000
  interface LuaSurfaceCreateEntityParamsFurnace extends BaseLuaSurfaceCreateEntityParams {
19722
21001
  'control_behavior'?: FurnaceBlueprintControlBehavior;
19723
21002
  }
21003
+ /**
21004
+ *
21005
+ * Applies to variant case `heat-interface`
21006
+ */
21007
+ interface LuaSurfaceCreateEntityParamsHeatInterface extends BaseLuaSurfaceCreateEntityParams {
21008
+ 'mode'?: HeatSettingMode;
21009
+ 'temperature'?: double;
21010
+ }
21011
+ /**
21012
+ *
21013
+ * Applies to variant case `heat-pipe`
21014
+ */
21015
+ interface LuaSurfaceCreateEntityParamsHeatPipe extends BaseLuaSurfaceCreateEntityParams {
21016
+ 'control_behavior'?: HeatPipeBlueprintControlBehavior;
21017
+ }
19724
21018
  /**
19725
21019
  *
19726
21020
  * Applies to variant case `highlight-box`
@@ -19752,6 +21046,10 @@ interface LuaSurfaceCreateEntityParamsHighlightBox extends BaseLuaSurfaceCreateE
19752
21046
  * Applies to variant case `infinity-cargo-wagon`
19753
21047
  */
19754
21048
  interface LuaSurfaceCreateEntityParamsInfinityCargoWagon extends BaseLuaSurfaceCreateEntityParams {
21049
+ /**
21050
+ * True by default. If set to false, rolling stock will not connect to other rolling stocks nearby.
21051
+ */
21052
+ 'auto_connect'?: boolean;
19755
21053
  /**
19756
21054
  * The color of this rolling stock, if it supports colors.
19757
21055
  */
@@ -19771,10 +21069,16 @@ interface LuaSurfaceCreateEntityParamsInfinityCargoWagon extends BaseLuaSurfaceC
19771
21069
  * Applies to variant case `infinity-container`
19772
21070
  */
19773
21071
  interface LuaSurfaceCreateEntityParamsInfinityContainer extends BaseLuaSurfaceCreateEntityParams {
19774
- 'bar'?: uint32;
21072
+ 'bar'?: ItemStackIndex;
19775
21073
  'control_behavior'?: LogisticContainerBlueprintControlBehavior;
21074
+ 'filters'?: BlueprintItemFilter[];
19776
21075
  'infinity_settings'?: BlueprintInfinityInventorySettings;
21076
+ 'override_logistic_mode'?: LogisticMode;
19777
21077
  'request_filters'?: BlueprintLogisticSections;
21078
+ 'saved_request_filters'?: LogisticSections;
21079
+ 'saved_request_from_buffers'?: boolean;
21080
+ 'saved_set_requests'?: boolean;
21081
+ 'saved_storage_filters'?: LogisticSections;
19778
21082
  }
19779
21083
  /**
19780
21084
  *
@@ -19822,9 +21126,9 @@ interface LuaSurfaceCreateEntityParamsItemEntity extends BaseLuaSurfaceCreateEnt
19822
21126
  */
19823
21127
  interface LuaSurfaceCreateEntityParamsItemRequestProxy extends BaseLuaSurfaceCreateEntityParams {
19824
21128
  /**
19825
- * The stacks of items to be delivered to target entity from logistic network.
21129
+ * Specification of items to be delivered to the target entity by the logistic network. While this is called "modules", any item can be specified.
19826
21130
  */
19827
- 'modules': BlueprintInsertPlan[];
21131
+ 'modules'?: BlueprintInsertPlan[];
19828
21132
  /**
19829
21133
  * Specification of items to be removed from the target entity by the logistic network.
19830
21134
  */
@@ -19834,6 +21138,13 @@ interface LuaSurfaceCreateEntityParamsItemRequestProxy extends BaseLuaSurfaceCre
19834
21138
  */
19835
21139
  'target': LuaEntity;
19836
21140
  }
21141
+ /**
21142
+ *
21143
+ * Applies to variant case `lab`
21144
+ */
21145
+ interface LuaSurfaceCreateEntityParamsLab extends BaseLuaSurfaceCreateEntityParams {
21146
+ 'control_behavior'?: LabBlueprintControlBehavior;
21147
+ }
19837
21148
  /**
19838
21149
  *
19839
21150
  * Applies to variant case `lamp`
@@ -19849,6 +21160,13 @@ interface LuaSurfaceCreateEntityParamsLamp extends BaseLuaSurfaceCreateEntityPar
19849
21160
  'color'?: Color;
19850
21161
  'control_behavior'?: LampBlueprintControlBehavior;
19851
21162
  }
21163
+ /**
21164
+ *
21165
+ * Applies to variant case `land-mine`
21166
+ */
21167
+ interface LuaSurfaceCreateEntityParamsLandMine extends BaseLuaSurfaceCreateEntityParams {
21168
+ 'control_behavior'?: LandMineBlueprintControlBehavior;
21169
+ }
19852
21170
  /**
19853
21171
  *
19854
21172
  * Applies to variant case `lane-splitter`
@@ -19905,6 +21223,10 @@ interface LuaSurfaceCreateEntityParamsLoader1x1 extends BaseLuaSurfaceCreateEnti
19905
21223
  * Applies to variant case `locomotive`
19906
21224
  */
19907
21225
  interface LuaSurfaceCreateEntityParamsLocomotive extends BaseLuaSurfaceCreateEntityParams {
21226
+ /**
21227
+ * True by default. If set to false, rolling stock will not connect to other rolling stocks nearby.
21228
+ */
21229
+ 'auto_connect'?: boolean;
19908
21230
  /**
19909
21231
  * The color of this rolling stock, if it supports colors.
19910
21232
  */
@@ -19926,8 +21248,9 @@ interface LuaSurfaceCreateEntityParamsLocomotive extends BaseLuaSurfaceCreateEnt
19926
21248
  * Applies to variant case `logistic-container`
19927
21249
  */
19928
21250
  interface LuaSurfaceCreateEntityParamsLogisticContainer extends BaseLuaSurfaceCreateEntityParams {
19929
- 'bar'?: uint32;
21251
+ 'bar'?: ItemStackIndex;
19930
21252
  'control_behavior'?: LogisticContainerBlueprintControlBehavior;
21253
+ 'filters'?: BlueprintItemFilter[];
19931
21254
  'request_filters'?: SlotFilter[];
19932
21255
  }
19933
21256
  /**
@@ -19938,6 +21261,13 @@ interface LuaSurfaceCreateEntityParamsMiningDrill extends BaseLuaSurfaceCreateEn
19938
21261
  'control_behavior'?: MiningDrillBlueprintControlBehavior;
19939
21262
  'filter'?: BlueprintMiningDrillFilter;
19940
21263
  }
21264
+ /**
21265
+ *
21266
+ * Applies to variant case `offshore-pump`
21267
+ */
21268
+ interface LuaSurfaceCreateEntityParamsOffshorePump extends BaseLuaSurfaceCreateEntityParams {
21269
+ 'control_behavior'?: GenericOnOffBlueprintControlBehavior;
21270
+ }
19941
21271
  /**
19942
21272
  *
19943
21273
  * Applies to variant case `particle`
@@ -19948,6 +21278,20 @@ interface LuaSurfaceCreateEntityParamsParticle extends BaseLuaSurfaceCreateEntit
19948
21278
  'movement': Vector;
19949
21279
  'vertical_speed': float;
19950
21280
  }
21281
+ /**
21282
+ *
21283
+ * Applies to variant case `pipe`
21284
+ */
21285
+ interface LuaSurfaceCreateEntityParamsPipe extends BaseLuaSurfaceCreateEntityParams {
21286
+ 'control_behavior'?: SingleFluidBoxBlueprintControlBehavior;
21287
+ }
21288
+ /**
21289
+ *
21290
+ * Applies to variant case `pipe-to-ground`
21291
+ */
21292
+ interface LuaSurfaceCreateEntityParamsPipeToGround extends BaseLuaSurfaceCreateEntityParams {
21293
+ 'control_behavior'?: SingleFluidBoxBlueprintControlBehavior;
21294
+ }
19951
21295
  /**
19952
21296
  *
19953
21297
  * Applies to variant case `plant`
@@ -19963,7 +21307,7 @@ interface LuaSurfaceCreateEntityParamsPlant extends BaseLuaSurfaceCreateEntityPa
19963
21307
  * Applies to variant case `power-switch`
19964
21308
  */
19965
21309
  interface LuaSurfaceCreateEntityParamsPowerSwitch extends BaseLuaSurfaceCreateEntityParams {
19966
- 'control_behavior'?: PowerSwitchBlueprintControlBehavior;
21310
+ 'control_behavior'?: GenericOnOffBlueprintControlBehavior;
19967
21311
  'switch_state'?: boolean;
19968
21312
  }
19969
21313
  /**
@@ -20006,6 +21350,13 @@ interface LuaSurfaceCreateEntityParamsPump extends BaseLuaSurfaceCreateEntityPar
20006
21350
  'control_behavior'?: PumpBlueprintControlBehavior;
20007
21351
  'fluid_filter'?: string;
20008
21352
  }
21353
+ /**
21354
+ *
21355
+ * Applies to variant case `radar`
21356
+ */
21357
+ interface LuaSurfaceCreateEntityParamsRadar extends BaseLuaSurfaceCreateEntityParams {
21358
+ 'control_behavior'?: RadarBlueprintControlBehavior;
21359
+ }
20009
21360
  /**
20010
21361
  *
20011
21362
  * Applies to variant case `rail-chain-signal`
@@ -20106,6 +21457,7 @@ interface LuaSurfaceCreateEntityParamsSimpleEntityWithOwner extends BaseLuaSurfa
20106
21457
  interface LuaSurfaceCreateEntityParamsSpacePlatformHub extends BaseLuaSurfaceCreateEntityParams {
20107
21458
  'bar'?: ItemStackIndex;
20108
21459
  'control_behavior'?: SpacePlatformHubBlueprintControlBehavior;
21460
+ 'providing_to_other_platforms'?: boolean;
20109
21461
  'request_filters'?: BlueprintLogisticSections;
20110
21462
  'request_missing_construction_materials'?: boolean;
20111
21463
  }
@@ -20148,7 +21500,7 @@ interface LuaSurfaceCreateEntityParamsSplitter extends BaseLuaSurfaceCreateEntit
20148
21500
  * Applies to variant case `storage-tank`
20149
21501
  */
20150
21502
  interface LuaSurfaceCreateEntityParamsStorageTank extends BaseLuaSurfaceCreateEntityParams {
20151
- 'control_behavior'?: StorageTankBlueprintControlBehavior;
21503
+ 'control_behavior'?: SingleFluidBoxBlueprintControlBehavior;
20152
21504
  }
20153
21505
  /**
20154
21506
  *
@@ -20488,7 +21840,7 @@ interface LuaTechnologyPrototype extends LuaPrototypeBase {
20488
21840
  *
20489
21841
  * A territory is owned by the surface for which it was created. It comprises any number of disconnected or connected chunks. A chunk can only be owned by at most one territory. A territory's chunks may or may not be generated.
20490
21842
  *
20491
- * Territories may be patrolled by any number of {@link LuaSegmentedUnit | runtime:LuaSegmentedUnit}s. A territory with no units will not appear on player's maps.
21843
+ * Territories may be patrolled by any number of {@link LuaSegmentedUnit | runtime:LuaSegmentedUnit}s. A territory with default visibility condition but with no units will not appear on player's maps.
20492
21844
  *
20493
21845
  * Territories may define a patrol path that {@link LuaSegmentedUnit | runtime:LuaSegmentedUnit}s will follow. If no such path is defined, then units will wander randomly throughout the territory chunks. If a territory contains no patrol path and no chunks, then units will behave as if they are assigned to any territory.
20494
21846
  *
@@ -20548,6 +21900,10 @@ interface LuaTerritory {
20548
21900
  * Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
20549
21901
  */
20550
21902
  readonly valid: boolean;
21903
+ /**
21904
+ * Condition when this territory is visible.
21905
+ */
21906
+ visibility_condition: TerritoryVisibilityCondition;
20551
21907
  }
20552
21908
  /**
20553
21909
  * A single "square" on the map.
@@ -20655,7 +22011,7 @@ interface LuaTilePrototype extends LuaPrototypeBase {
20655
22011
  /**
20656
22012
  * The collision mask this tile uses
20657
22013
  */
20658
- readonly collision_mask: CollisionMask;
22014
+ readonly collision_mask: TileCollisionMask;
20659
22015
  /**
20660
22016
  * The probability that decorative entities will be removed from on top of this tile when this tile is generated.
20661
22017
  */
@@ -20910,7 +22266,7 @@ interface LuaTrain {
20910
22266
  *
20911
22267
  * The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
20912
22268
  *
20913
- * This is a simiplifed schedule that does **not** include train groups and interrupts. See {@link LuaTrain::get_schedule | runtime:LuaTrain::get_schedule} for full access to the train schedule, including interrupts and train groups.
22269
+ * This is a simplified schedule that does **not** include train groups and interrupts. See {@link LuaTrain::get_schedule | runtime:LuaTrain::get_schedule} for full access to the train schedule, including interrupts and train groups.
20914
22270
  */
20915
22271
  schedule?: TrainSchedule;
20916
22272
  /**
@@ -21460,6 +22816,12 @@ interface LuaWireConnector {
21460
22816
  * All wire connectors this connector is connected to. It includes all wires (ghost wires and real wires).
21461
22817
  */
21462
22818
  readonly connections: WireConnection[];
22819
+ /**
22820
+ * The electric sub network this copper wire connector provides.
22821
+ *
22822
+ * No value will be provided if this is not a copper wire connector. May be `nil` in case of a copper wire connector when it belongs to a ghost or its from a power switch when there are no real wires connecting it to other entities.
22823
+ */
22824
+ readonly electric_network?: LuaElectricSubNetwork;
21463
22825
  /**
21464
22826
  * If this connector is owned by an entity inside of a ghost. If any of 2 ends of a wire attaches to a ghost connector, then a wire is considered to be a ghost.
21465
22827
  */