typed-factorio 1.13.0 → 1.15.0
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.
@@ -24,7 +24,7 @@ interface LuaAISettings {
|
|
24
24
|
*/
|
25
25
|
do_separation: boolean
|
26
26
|
/**
|
27
|
-
*
|
27
|
+
* Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
|
28
28
|
* @see {@link https://lua-api.factorio.com/latest/LuaAISettings.html#LuaAISettings.path_resolution_modifier Online documentation}
|
29
29
|
*/
|
30
30
|
path_resolution_modifier: int8
|
@@ -217,9 +217,11 @@ interface LuaBootstrap {
|
|
217
217
|
*/
|
218
218
|
on_init(handler: (() => void) | nil): void
|
219
219
|
/**
|
220
|
-
* 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.
|
220
|
+
* 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.
|
221
221
|
*
|
222
|
-
*
|
222
|
+
* 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} is not available. The {@linkplain https://lua-api.factorio.com/latest/Global.html global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
|
223
|
+
*
|
224
|
+
* The only legitimate uses of this event are these:
|
223
225
|
* - Re-setup {@linkplain https://www.lua.org/pil/13.html metatables} as they are not persisted through the save/load cycle.
|
224
226
|
* - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
|
225
227
|
* - Create local references to data stored in the {@linkplain https://lua-api.factorio.com/latest/Global.html global} table.
|
@@ -230,14 +232,6 @@ interface LuaBootstrap {
|
|
230
232
|
* @see {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_load Online documentation}
|
231
233
|
*/
|
232
234
|
on_load(handler: (() => void) | nil): void
|
233
|
-
/**
|
234
|
-
* Register a metatable to have linkage recorded and restored when saving/loading. The metatable itself will not be saved. Instead, only the linkage to a registered metatable is saved, and the metatable registered under that name will be used when loading the table.
|
235
|
-
* @param name The name of this metatable. Names must be unique per mod.
|
236
|
-
* @param metatable The metatable to register.
|
237
|
-
* @remarks `register_metatable()` can not be used in the console, in event listeners or during a `remote.call()`.
|
238
|
-
* @see {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.register_metatable Online documentation}
|
239
|
-
*/
|
240
|
-
register_metatable(name: string, metatable: table): void
|
241
235
|
/**
|
242
236
|
* Register a function to be run when mod configuration changes. 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 {@linkplain https://lua-api.factorio.com/latest/Global.html global} table or to the game state through {@link LuaGameScript}.
|
243
237
|
* @param handler The handler for this event. Passing `nil` will unregister it.
|
@@ -287,6 +281,31 @@ interface LuaBootstrap {
|
|
287
281
|
* @see {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.register_on_entity_destroyed Online documentation}
|
288
282
|
*/
|
289
283
|
register_on_entity_destroyed(entity: LuaEntity): RegistrationNumber
|
284
|
+
/**
|
285
|
+
* Register a metatable to have linkage recorded and restored when saving/loading. The metatable itself will not be saved. Instead, only the linkage to a registered metatable is saved, and the metatable registered under that name will be used when loading the table.
|
286
|
+
* @param name The name of this metatable. Names must be unique per mod.
|
287
|
+
* @param metatable The metatable to register.
|
288
|
+
* @example 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 {@linkplain https://lua-api.factorio.com/latest/Global.html global}.
|
289
|
+
*
|
290
|
+
* ```
|
291
|
+
* local metatable = {
|
292
|
+
* __index = function(key)
|
293
|
+
* return "no value for key " .. key
|
294
|
+
* end
|
295
|
+
* }
|
296
|
+
* script.register_metatable("my_metatable", metatable)
|
297
|
+
* ```
|
298
|
+
*
|
299
|
+
* This previously defined `metatable` can then be set on any table as usual:
|
300
|
+
*
|
301
|
+
* ```
|
302
|
+
* local table = {key="value"}
|
303
|
+
* setmetatable(table, metatable)
|
304
|
+
* ```
|
305
|
+
* @remarks `register_metatable()` can not be used in the console, in event listeners or during a `remote.call()`.
|
306
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.register_metatable Online documentation}
|
307
|
+
*/
|
308
|
+
register_metatable(name: string, metatable: table): void
|
290
309
|
/**
|
291
310
|
* Generate a new, unique event ID that can be used to raise custom events with {@link LuaBootstrap#raise_event LuaBootstrap::raise_event}.
|
292
311
|
* @returns The newly generated event ID.
|
@@ -351,6 +370,7 @@ interface LuaBootstrap {
|
|
351
370
|
* - {@link ScriptRaisedBuiltEvent script_raised_built}
|
352
371
|
* - {@link ScriptRaisedDestroyEvent script_raised_destroy}
|
353
372
|
* - {@link ScriptRaisedReviveEvent script_raised_revive}
|
373
|
+
* - {@link ScriptRaisedTeleportedEvent script_raised_teleported}
|
354
374
|
* - {@link ScriptRaisedSetTilesEvent script_raised_set_tiles}
|
355
375
|
* @param event ID of the event to raise.
|
356
376
|
* @param data Table with extra data that will be passed to the event handler. Any invalid LuaObjects will silently stop the event from being raised.
|
@@ -494,6 +514,25 @@ interface LuaBootstrap {
|
|
494
514
|
*/
|
495
515
|
readonly tags?: Tags
|
496
516
|
}): void
|
517
|
+
/**
|
518
|
+
* **Raised events:**
|
519
|
+
* - {@link ScriptRaisedTeleportedEvent script_raised_teleported} _instantly_ Raised with the provided arguments.
|
520
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.raise_script_teleported Online documentation}
|
521
|
+
*/
|
522
|
+
raise_script_teleported(params: {
|
523
|
+
/**
|
524
|
+
* The entity that was teleported.
|
525
|
+
*/
|
526
|
+
readonly entity: LuaEntity
|
527
|
+
/**
|
528
|
+
* The entity's surface before the teleportation.
|
529
|
+
*/
|
530
|
+
readonly old_surface_index: uint8
|
531
|
+
/**
|
532
|
+
* The entity's position before the teleportation.
|
533
|
+
*/
|
534
|
+
readonly old_position: MapPosition | MapPositionArray
|
535
|
+
}): void
|
497
536
|
/**
|
498
537
|
* **Raised events:**
|
499
538
|
* - {@link ScriptRaisedSetTilesEvent script_raised_set_tiles} _instantly_ Raised with the provided arguments.
|
@@ -596,7 +635,7 @@ interface LuaBurner {
|
|
596
635
|
*/
|
597
636
|
remaining_burning_fuel: double
|
598
637
|
/**
|
599
|
-
* The currently burning item.
|
638
|
+
* The currently burning item. Writing `nil` will void the currently burning item without producing a {@link LuaBurner#burnt_result LuaBurner::burnt_result}.
|
600
639
|
* @remarks Writing to this automatically handles correcting {@link LuaBurner#remaining_burning_fuel LuaBurner::remaining_burning_fuel}.
|
601
640
|
* @see {@link https://lua-api.factorio.com/latest/LuaBurner.html#LuaBurner.currently_burning Online documentation}
|
602
641
|
*/
|
@@ -785,7 +824,7 @@ interface LuaCombinatorControlBehavior extends LuaControlBehavior {
|
|
785
824
|
}
|
786
825
|
|
787
826
|
/**
|
788
|
-
* Allows for the registration of custom console commands
|
827
|
+
* Allows for the registration of custom console commands through the global object named `commands`. Similarly to {@link LuaBootstrap#on_event event subscriptions}, these don't persist through a save-and-load cycle.
|
789
828
|
* @see {@link https://lua-api.factorio.com/latest/LuaCommandProcessor.html Online documentation}
|
790
829
|
* @noSelf
|
791
830
|
*/
|
@@ -840,10 +879,11 @@ interface LuaCommandProcessor {
|
|
840
879
|
*/
|
841
880
|
interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
|
842
881
|
/**
|
843
|
-
* Sets the signal at the given index
|
882
|
+
* Sets the signal at the given index.
|
883
|
+
* @param signal Passing `nil` clears the signal.
|
844
884
|
* @see {@link https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.set_signal Online documentation}
|
845
885
|
*/
|
846
|
-
set_signal(index: uint, signal
|
886
|
+
set_signal(index: uint, signal?: Signal): void
|
847
887
|
/**
|
848
888
|
* Gets the signal at the given index. Returned {@link Signal} will not contain signal if none is set for the index.
|
849
889
|
* @see {@link https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.get_signal Online documentation}
|
@@ -862,7 +902,7 @@ interface LuaConstantCombinatorControlBehavior extends LuaControlBehavior {
|
|
862
902
|
*/
|
863
903
|
enabled: boolean
|
864
904
|
/**
|
865
|
-
* The number of signals this constant combinator supports
|
905
|
+
* The number of signals this constant combinator supports.
|
866
906
|
* @see {@link https://lua-api.factorio.com/latest/LuaConstantCombinatorControlBehavior.html#LuaConstantCombinatorControlBehavior.signals_count Online documentation}
|
867
907
|
*/
|
868
908
|
readonly signals_count: uint
|
@@ -979,6 +1019,16 @@ interface LuaControl {
|
|
979
1019
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_inventory Online documentation}
|
980
1020
|
*/
|
981
1021
|
get_inventory(inventory: defines.inventory): LuaInventory | nil
|
1022
|
+
/**
|
1023
|
+
* The highest index of all inventories this entity can use. Allows iteration over all of them if desired.
|
1024
|
+
* @example
|
1025
|
+
*
|
1026
|
+
* ```
|
1027
|
+
* for k = 1, entity.get_max_inventory_index() do [...] end
|
1028
|
+
* ```
|
1029
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.get_max_inventory_index Online documentation}
|
1030
|
+
*/
|
1031
|
+
get_max_inventory_index(): defines.inventory
|
982
1032
|
/**
|
983
1033
|
* Gets the main inventory for this character or player if this is a character or player.
|
984
1034
|
* @returns The inventory or `nil` if this entity is not a character or player.
|
@@ -1048,10 +1098,12 @@ interface LuaControl {
|
|
1048
1098
|
*
|
1049
1099
|
* **Raised events:**
|
1050
1100
|
* - {@link OnPlayerChangedPositionEvent on_player_changed_position}? _instantly_ Raised if the teleported entity is a player character.
|
1101
|
+
* - {@link ScriptRaisedTeleportedEvent script_raised_teleported}? _instantly_ Raised if the `raise_teleported` flag was set and the entity was successfully teleported.
|
1051
1102
|
* @param position Where to teleport to.
|
1052
1103
|
* @param surface Surface to teleport to. If not given, will teleport to the entity's current surface. Only players, cars, and spidertrons can be teleported cross-surface.
|
1104
|
+
* @param raise_teleported If true, {@link defines.events.script_raised_teleported} will be fired on successful entity teleportation.
|
1053
1105
|
* @returns `true` if the entity was successfully teleported.
|
1054
|
-
* @remarks Some entities may not be teleported. For instance, transport belts won't allow teleportation and this method will always return `false` when used on any such entity.<br>You can also pass 1 or 2 numbers as the parameters and they will be used as relative teleport coordinates `'teleport(0, 1)'` to move the entity 1 tile positive y. `'teleport(4)'` to move the entity 4 tiles to the positive x.
|
1106
|
+
* @remarks Some entities may not be teleported. For instance, transport belts won't allow teleportation and this method will always return `false` when used on any such entity.<br>You can also pass 1 or 2 numbers as the parameters and they will be used as relative teleport coordinates `'teleport(0, 1)'` to move the entity 1 tile positive y. `'teleport(4)'` to move the entity 4 tiles to the positive x.<br>`script_raised_teleported` will not be raised if teleporting a player with no character.
|
1055
1107
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.teleport Online documentation}
|
1056
1108
|
*/
|
1057
1109
|
teleport(position: MapPosition | MapPositionArray, surface?: SurfaceIdentification): boolean
|
@@ -1248,7 +1300,7 @@ interface LuaControl {
|
|
1248
1300
|
*/
|
1249
1301
|
readonly surface: LuaSurface
|
1250
1302
|
/**
|
1251
|
-
* Unique ID associated with the surface this entity is currently on.
|
1303
|
+
* Unique {@link LuaSurface#index index} (ID) associated with the surface this entity is currently on.
|
1252
1304
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.surface_index Online documentation}
|
1253
1305
|
*/
|
1254
1306
|
readonly surface_index: SurfaceIndex
|
@@ -1269,10 +1321,10 @@ interface LuaControl {
|
|
1269
1321
|
get force(): LuaForce
|
1270
1322
|
set force(value: ForceIdentification)
|
1271
1323
|
/**
|
1272
|
-
* Unique ID associated with the force of this entity.
|
1324
|
+
* Unique {@link LuaForce#index index} (ID) associated with the force of this entity.
|
1273
1325
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.force_index Online documentation}
|
1274
1326
|
*/
|
1275
|
-
readonly force_index:
|
1327
|
+
readonly force_index: ForceIndex
|
1276
1328
|
/**
|
1277
1329
|
* The currently selected entity. Assigning an entity will select it if is selectable, otherwise the selection is cleared.
|
1278
1330
|
*
|
@@ -1349,26 +1401,26 @@ interface LuaControl {
|
|
1349
1401
|
riding_state: RidingState
|
1350
1402
|
/**
|
1351
1403
|
* Current mining state.
|
1352
|
-
* @remarks When the player isn't mining tiles the player will mine what ever entity is currently selected. See {@link LuaControl#selected LuaControl::selected} and {@link LuaControl#update_selected_entity LuaControl::update_selected_entity}.
|
1404
|
+
* @remarks When the player isn't mining tiles, the player will mine what ever entity is currently selected. See {@link LuaControl#selected LuaControl::selected} and {@link LuaControl#update_selected_entity LuaControl::update_selected_entity}.
|
1353
1405
|
* @see {@link https://lua-api.factorio.com/latest/LuaControl.html#LuaControl.mining_state Online documentation}
|
1354
1406
|
*/
|
1355
1407
|
get mining_state(): {
|
1356
1408
|
/**
|
1357
|
-
* Whether the player is mining at all
|
1409
|
+
* Whether the player is mining at all.
|
1358
1410
|
*/
|
1359
1411
|
readonly mining: boolean
|
1360
1412
|
/**
|
1361
|
-
* What
|
1413
|
+
* What location the player is mining. Only relevant if `mining` is `true`.
|
1362
1414
|
*/
|
1363
1415
|
readonly position?: MapPosition
|
1364
1416
|
}
|
1365
1417
|
set mining_state(value: {
|
1366
1418
|
/**
|
1367
|
-
* Whether the player is mining at all
|
1419
|
+
* Whether the player is mining at all.
|
1368
1420
|
*/
|
1369
1421
|
readonly mining: boolean
|
1370
1422
|
/**
|
1371
|
-
* What
|
1423
|
+
* What location the player is mining. Only relevant if `mining` is `true`.
|
1372
1424
|
*/
|
1373
1425
|
readonly position?: MapPosition | MapPositionArray
|
1374
1426
|
})
|
@@ -2612,21 +2664,21 @@ interface LuaEntity extends LuaControl {
|
|
2612
2664
|
*/
|
2613
2665
|
update_connections(): void
|
2614
2666
|
/**
|
2615
|
-
* Current recipe being assembled by this machine
|
2667
|
+
* Current recipe being assembled by this machine, if any.
|
2616
2668
|
*
|
2617
2669
|
* _Can only be used if this is CraftingMachine_
|
2618
2670
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_recipe Online documentation}
|
2619
2671
|
*/
|
2620
2672
|
get_recipe(): LuaRecipe | nil
|
2621
2673
|
/**
|
2622
|
-
* Sets the
|
2674
|
+
* Sets the given recipe in this assembly machine.
|
2623
2675
|
*
|
2624
2676
|
* _Can only be used if this is AssemblingMachine_
|
2625
|
-
* @param recipe The new recipe
|
2677
|
+
* @param recipe The new recipe. Writing `nil` clears the recipe, if any.
|
2626
2678
|
* @returns Any items removed from this entity as a result of setting the recipe.
|
2627
2679
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_recipe Online documentation}
|
2628
2680
|
*/
|
2629
|
-
set_recipe(recipe
|
2681
|
+
set_recipe(recipe?: string | LuaRecipe): Record<string, uint>
|
2630
2682
|
/**
|
2631
2683
|
* Rotates this entity as if the player rotated it.
|
2632
2684
|
*
|
@@ -2673,11 +2725,11 @@ interface LuaEntity extends LuaControl {
|
|
2673
2725
|
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
2674
2726
|
*
|
2675
2727
|
* _Can only be used if this is Vehicle_
|
2676
|
-
* @param driver The new driver
|
2677
|
-
* @remarks This differs
|
2728
|
+
* @param driver The new driver. Writing `nil` ejects the current driver, if any.
|
2729
|
+
* @remarks This differs from {@link LuaEntity#set_passenger LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
|
2678
2730
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver Online documentation}
|
2679
2731
|
*/
|
2680
|
-
set_driver(driver
|
2732
|
+
set_driver(driver?: LuaEntity | PlayerIdentification): void
|
2681
2733
|
/**
|
2682
2734
|
* Gets the passenger of this car or spidertron if any.
|
2683
2735
|
*
|
@@ -2694,10 +2746,11 @@ interface LuaEntity extends LuaControl {
|
|
2694
2746
|
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
2695
2747
|
*
|
2696
2748
|
* _Can only be used if this is Car or SpiderVehicle_
|
2697
|
-
* @
|
2749
|
+
* @param passenger The new passenger. Writing `nil` ejects the current passenger, if any.
|
2750
|
+
* @remarks This differs from {@link LuaEntity#get_driver LuaEntity::get_driver} in that the passenger can't drive the car.
|
2698
2751
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger Online documentation}
|
2699
2752
|
*/
|
2700
|
-
set_passenger(passenger
|
2753
|
+
set_passenger(passenger?: LuaEntity | PlayerIdentification): void
|
2701
2754
|
/**
|
2702
2755
|
* Returns `true` if this entity produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.
|
2703
2756
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_connected_to_electric_network Online documentation}
|
@@ -2988,6 +3041,18 @@ interface LuaEntity extends LuaControl {
|
|
2988
3041
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.stop_spider Online documentation}
|
2989
3042
|
*/
|
2990
3043
|
stop_spider(): void
|
3044
|
+
/**
|
3045
|
+
* Returns a table with all beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
3046
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beacons Online documentation}
|
3047
|
+
*/
|
3048
|
+
get_beacons(): LuaEntity[] | nil
|
3049
|
+
/**
|
3050
|
+
* Returns a table with all entities affected by this beacon
|
3051
|
+
*
|
3052
|
+
* _Can only be used if this is Beacon_
|
3053
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beacon_effect_receivers Online documentation}
|
3054
|
+
*/
|
3055
|
+
get_beacon_effect_receivers(): LuaEntity[]
|
2991
3056
|
/**
|
2992
3057
|
* Name of the entity prototype. E.g. "inserter" or "filter-inserter".
|
2993
3058
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.name Online documentation}
|
@@ -3290,7 +3355,7 @@ interface LuaEntity extends LuaControl {
|
|
3290
3355
|
*/
|
3291
3356
|
backer_name?: string
|
3292
3357
|
/**
|
3293
|
-
* The label on this entity, if any. `nil` if this is not a spider-
|
3358
|
+
* The label on this spider-vehicle entity, if any. `nil` if this is not a spider-vehicle.
|
3294
3359
|
*
|
3295
3360
|
* **Raised events:**
|
3296
3361
|
* - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
|
@@ -3384,14 +3449,14 @@ interface LuaEntity extends LuaControl {
|
|
3384
3449
|
*/
|
3385
3450
|
readonly consumption_bonus: double
|
3386
3451
|
/**
|
3387
|
-
*
|
3452
|
+
* Whether this underground belt goes into or out of the ground.
|
3388
3453
|
*
|
3389
3454
|
* _Can only be used if this is TransportBeltToGround_
|
3390
3455
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_to_ground_type Online documentation}
|
3391
3456
|
*/
|
3392
3457
|
readonly belt_to_ground_type: "input" | "output"
|
3393
3458
|
/**
|
3394
|
-
*
|
3459
|
+
* Whether this loader gets items from or puts item into a container.
|
3395
3460
|
*
|
3396
3461
|
* _Can only be used if this is Loader_
|
3397
3462
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type Online documentation}
|
@@ -3484,7 +3549,9 @@ interface LuaEntity extends LuaControl {
|
|
3484
3549
|
*/
|
3485
3550
|
readonly electric_emissions?: double
|
3486
3551
|
/**
|
3487
|
-
* A
|
3552
|
+
* A unique number identifying this entity for the lifetime of the save. These are allocated sequentially, and not re-used (until overflow).
|
3553
|
+
*
|
3554
|
+
* Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} are assigned a unit number. Returns `nil` otherwise.
|
3488
3555
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number Online documentation}
|
3489
3556
|
*/
|
3490
3557
|
readonly unit_number?: UnitNumber
|
@@ -3703,6 +3770,11 @@ interface LuaEntity extends LuaControl {
|
|
3703
3770
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effects Online documentation}
|
3704
3771
|
*/
|
3705
3772
|
readonly effects?: ModuleEffects
|
3773
|
+
/**
|
3774
|
+
* Number of beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
3775
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.beacons_count Online documentation}
|
3776
|
+
*/
|
3777
|
+
readonly beacons_count?: uint
|
3706
3778
|
/**
|
3707
3779
|
* The filters for this infinity container.
|
3708
3780
|
*
|
@@ -3981,7 +4053,7 @@ interface LuaEntity extends LuaControl {
|
|
3981
4053
|
*/
|
3982
4054
|
time_to_next_effect: uint
|
3983
4055
|
/**
|
3984
|
-
* Destination of this spidertron's autopilot, if any.
|
4056
|
+
* Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
|
3985
4057
|
*
|
3986
4058
|
* _Can only be used if this is SpiderVehicle_
|
3987
4059
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination Online documentation}
|
@@ -4646,6 +4718,11 @@ interface BaseEntity extends LuaControl {
|
|
4646
4718
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.is_registered_for_repair Online documentation}
|
4647
4719
|
*/
|
4648
4720
|
is_registered_for_repair(): boolean
|
4721
|
+
/**
|
4722
|
+
* Returns a table with all beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
4723
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beacons Online documentation}
|
4724
|
+
*/
|
4725
|
+
get_beacons(): LuaEntity[] | nil
|
4649
4726
|
/**
|
4650
4727
|
* Name of the entity prototype. E.g. "inserter" or "filter-inserter".
|
4651
4728
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.name Online documentation}
|
@@ -4790,7 +4867,7 @@ interface BaseEntity extends LuaControl {
|
|
4790
4867
|
*/
|
4791
4868
|
backer_name?: string
|
4792
4869
|
/**
|
4793
|
-
* The label on this entity, if any. `nil` if this is not a spider-
|
4870
|
+
* The label on this spider-vehicle entity, if any. `nil` if this is not a spider-vehicle.
|
4794
4871
|
*
|
4795
4872
|
* **Raised events:**
|
4796
4873
|
* - {@link OnEntityRenamedEvent on_entity_renamed} _instantly_
|
@@ -4876,7 +4953,9 @@ interface BaseEntity extends LuaControl {
|
|
4876
4953
|
*/
|
4877
4954
|
readonly electric_emissions?: double
|
4878
4955
|
/**
|
4879
|
-
* A
|
4956
|
+
* A unique number identifying this entity for the lifetime of the save. These are allocated sequentially, and not re-used (until overflow).
|
4957
|
+
*
|
4958
|
+
* Only entities inheriting from {@linkplain https://wiki.factorio.com/Prototype/EntityWithOwner EntityWithOwner}, as well as {@linkplain https://wiki.factorio.com/Prototype/ItemRequestProxy ItemRequestProxy} and {@linkplain https://wiki.factorio.com/Prototype/EntityGhost EntityGhost} are assigned a unit number. Returns `nil` otherwise.
|
4880
4959
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.unit_number Online documentation}
|
4881
4960
|
*/
|
4882
4961
|
readonly unit_number?: UnitNumber
|
@@ -5036,6 +5115,11 @@ interface BaseEntity extends LuaControl {
|
|
5036
5115
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.effects Online documentation}
|
5037
5116
|
*/
|
5038
5117
|
readonly effects?: ModuleEffects
|
5118
|
+
/**
|
5119
|
+
* Number of beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
5120
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.beacons_count Online documentation}
|
5121
|
+
*/
|
5122
|
+
readonly beacons_count?: uint
|
5039
5123
|
/**
|
5040
5124
|
* The status of this entity, if any.
|
5041
5125
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.status Online documentation}
|
@@ -5326,7 +5410,7 @@ interface CraftingMachineEntity extends BaseEntity {
|
|
5326
5410
|
*/
|
5327
5411
|
is_crafting(): boolean
|
5328
5412
|
/**
|
5329
|
-
* Current recipe being assembled by this machine
|
5413
|
+
* Current recipe being assembled by this machine, if any.
|
5330
5414
|
*
|
5331
5415
|
* _Can only be used if this is CraftingMachine_
|
5332
5416
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_recipe Online documentation}
|
@@ -5737,14 +5821,14 @@ interface ProgrammableSpeakerEntity extends BaseEntity {
|
|
5737
5821
|
*/
|
5738
5822
|
interface AssemblingMachineEntity extends BaseEntity {
|
5739
5823
|
/**
|
5740
|
-
* Sets the
|
5824
|
+
* Sets the given recipe in this assembly machine.
|
5741
5825
|
*
|
5742
5826
|
* _Can only be used if this is AssemblingMachine_
|
5743
|
-
* @param recipe The new recipe
|
5827
|
+
* @param recipe The new recipe. Writing `nil` clears the recipe, if any.
|
5744
5828
|
* @returns Any items removed from this entity as a result of setting the recipe.
|
5745
5829
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_recipe Online documentation}
|
5746
5830
|
*/
|
5747
|
-
set_recipe(recipe
|
5831
|
+
set_recipe(recipe?: string | LuaRecipe): Record<string, uint>
|
5748
5832
|
/**
|
5749
5833
|
* When locked; the recipe in this assembling machine can't be changed by the player.
|
5750
5834
|
*
|
@@ -5773,11 +5857,11 @@ interface VehicleEntity extends BaseEntity {
|
|
5773
5857
|
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
5774
5858
|
*
|
5775
5859
|
* _Can only be used if this is Vehicle_
|
5776
|
-
* @param driver The new driver
|
5777
|
-
* @remarks This differs
|
5860
|
+
* @param driver The new driver. Writing `nil` ejects the current driver, if any.
|
5861
|
+
* @remarks This differs from {@link LuaEntity#set_passenger LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
|
5778
5862
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_driver Online documentation}
|
5779
5863
|
*/
|
5780
|
-
set_driver(driver
|
5864
|
+
set_driver(driver?: LuaEntity | PlayerIdentification): void
|
5781
5865
|
/**
|
5782
5866
|
* Whether equipment grid logistics are enabled while this vehicle is moving.
|
5783
5867
|
*
|
@@ -5807,10 +5891,11 @@ interface CarEntity extends BaseEntity {
|
|
5807
5891
|
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
5808
5892
|
*
|
5809
5893
|
* _Can only be used if this is Car or SpiderVehicle_
|
5810
|
-
* @
|
5894
|
+
* @param passenger The new passenger. Writing `nil` ejects the current passenger, if any.
|
5895
|
+
* @remarks This differs from {@link LuaEntity#get_driver LuaEntity::get_driver} in that the passenger can't drive the car.
|
5811
5896
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger Online documentation}
|
5812
5897
|
*/
|
5813
|
-
set_passenger(passenger
|
5898
|
+
set_passenger(passenger?: LuaEntity | PlayerIdentification): void
|
5814
5899
|
/**
|
5815
5900
|
* Multiplies the acceleration the vehicle can create for one unit of energy. Defaults to `1`.
|
5816
5901
|
*
|
@@ -5873,10 +5958,11 @@ interface SpiderVehicleEntity extends BaseEntity {
|
|
5873
5958
|
* - {@link OnPlayerDrivingChangedStateEvent on_player_driving_changed_state}? _instantly_
|
5874
5959
|
*
|
5875
5960
|
* _Can only be used if this is Car or SpiderVehicle_
|
5876
|
-
* @
|
5961
|
+
* @param passenger The new passenger. Writing `nil` ejects the current passenger, if any.
|
5962
|
+
* @remarks This differs from {@link LuaEntity#get_driver LuaEntity::get_driver} in that the passenger can't drive the car.
|
5877
5963
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.set_passenger Online documentation}
|
5878
5964
|
*/
|
5879
|
-
set_passenger(passenger
|
5965
|
+
set_passenger(passenger?: LuaEntity | PlayerIdentification): void
|
5880
5966
|
/**
|
5881
5967
|
* Adds the given position to this spidertron's autopilot's queue of destinations.
|
5882
5968
|
*
|
@@ -5928,7 +6014,7 @@ interface SpiderVehicleEntity extends BaseEntity {
|
|
5928
6014
|
*/
|
5929
6015
|
selected_gun_index?: uint
|
5930
6016
|
/**
|
5931
|
-
* Destination of this spidertron's autopilot, if any.
|
6017
|
+
* Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
|
5932
6018
|
*
|
5933
6019
|
* _Can only be used if this is SpiderVehicle_
|
5934
6020
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.autopilot_destination Online documentation}
|
@@ -6114,6 +6200,19 @@ interface LinkedBeltEntity extends BaseEntity {
|
|
6114
6200
|
readonly linked_belt_neighbour?: LuaEntity
|
6115
6201
|
}
|
6116
6202
|
|
6203
|
+
/**
|
6204
|
+
* @noSelf
|
6205
|
+
*/
|
6206
|
+
interface BeaconEntity extends BaseEntity {
|
6207
|
+
/**
|
6208
|
+
* Returns a table with all entities affected by this beacon
|
6209
|
+
*
|
6210
|
+
* _Can only be used if this is Beacon_
|
6211
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.get_beacon_effect_receivers Online documentation}
|
6212
|
+
*/
|
6213
|
+
get_beacon_effect_receivers(): LuaEntity[]
|
6214
|
+
}
|
6215
|
+
|
6117
6216
|
interface GhostEntity extends BaseEntity {
|
6118
6217
|
/**
|
6119
6218
|
* Name of the entity or tile contained in this ghost
|
@@ -6278,7 +6377,7 @@ interface FlyingTextEntity extends BaseEntity {
|
|
6278
6377
|
|
6279
6378
|
interface TransportBeltToGroundEntity extends BaseEntity {
|
6280
6379
|
/**
|
6281
|
-
*
|
6380
|
+
* Whether this underground belt goes into or out of the ground.
|
6282
6381
|
*
|
6283
6382
|
* _Can only be used if this is TransportBeltToGround_
|
6284
6383
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.belt_to_ground_type Online documentation}
|
@@ -6288,7 +6387,7 @@ interface TransportBeltToGroundEntity extends BaseEntity {
|
|
6288
6387
|
|
6289
6388
|
interface LoaderEntity extends BaseEntity {
|
6290
6389
|
/**
|
6291
|
-
*
|
6390
|
+
* Whether this loader gets items from or puts item into a container.
|
6292
6391
|
*
|
6293
6392
|
* _Can only be used if this is Loader_
|
6294
6393
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.loader_type Online documentation}
|
@@ -6609,10 +6708,10 @@ interface LuaEntityPrototype {
|
|
6609
6708
|
readonly mining_trigger?: TriggerItem[]
|
6610
6709
|
}
|
6611
6710
|
/**
|
6612
|
-
* Items that when placed will produce this entity, if any. Construction bots will
|
6711
|
+
* Items that when placed will produce this entity, if any. Construction bots will choose the first item in the list to build this entity.
|
6613
6712
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.items_to_place_this Online documentation}
|
6614
6713
|
*/
|
6615
|
-
readonly items_to_place_this?:
|
6714
|
+
readonly items_to_place_this?: ItemStackDefinition[]
|
6616
6715
|
/**
|
6617
6716
|
* The bounding box used for collision checking.
|
6618
6717
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_box Online documentation}
|
@@ -7028,7 +7127,7 @@ interface LuaEntityPrototype {
|
|
7028
7127
|
*/
|
7029
7128
|
readonly guns?: Record<string, LuaItemPrototype>
|
7030
7129
|
/**
|
7031
|
-
* A vector of the gun prototypes of this car, spider
|
7130
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
7032
7131
|
*
|
7033
7132
|
* _Can only be used if this is Car, SpiderVehicle, ArtilleryTurret or ArtilleryWagon_
|
7034
7133
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns Online documentation}
|
@@ -7170,7 +7269,7 @@ interface LuaEntityPrototype {
|
|
7170
7269
|
/**
|
7171
7270
|
* The default maximum power output of this generator prototype.
|
7172
7271
|
*
|
7173
|
-
* _Can only be used if this is Generator_
|
7272
|
+
* _Can only be used if this is BurnerGenerator or Generator_
|
7174
7273
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_power_output Online documentation}
|
7175
7274
|
*/
|
7176
7275
|
readonly max_power_output?: double
|
@@ -7190,7 +7289,7 @@ interface LuaEntityPrototype {
|
|
7190
7289
|
readonly fluid?: LuaFluidPrototype
|
7191
7290
|
/**
|
7192
7291
|
* The fluid capacity of this entity or 0 if this entity doesn't support fluids.
|
7193
|
-
* @remarks Crafting machines will report 0 due to their fluid capacity being
|
7292
|
+
* @remarks Crafting machines will report 0 due to their fluid capacity being whatever a given recipe needs.
|
7194
7293
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid_capacity Online documentation}
|
7195
7294
|
*/
|
7196
7295
|
readonly fluid_capacity: double
|
@@ -8144,10 +8243,10 @@ interface BaseEntityPrototype {
|
|
8144
8243
|
readonly mining_trigger?: TriggerItem[]
|
8145
8244
|
}
|
8146
8245
|
/**
|
8147
|
-
* Items that when placed will produce this entity, if any. Construction bots will
|
8246
|
+
* Items that when placed will produce this entity, if any. Construction bots will choose the first item in the list to build this entity.
|
8148
8247
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.items_to_place_this Online documentation}
|
8149
8248
|
*/
|
8150
|
-
readonly items_to_place_this?:
|
8249
|
+
readonly items_to_place_this?: ItemStackDefinition[]
|
8151
8250
|
/**
|
8152
8251
|
* The bounding box used for collision checking.
|
8153
8252
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.collision_box Online documentation}
|
@@ -8391,7 +8490,7 @@ interface BaseEntityPrototype {
|
|
8391
8490
|
readonly building_grid_bit_shift: uint
|
8392
8491
|
/**
|
8393
8492
|
* The fluid capacity of this entity or 0 if this entity doesn't support fluids.
|
8394
|
-
* @remarks Crafting machines will report 0 due to their fluid capacity being
|
8493
|
+
* @remarks Crafting machines will report 0 due to their fluid capacity being whatever a given recipe needs.
|
8395
8494
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.fluid_capacity Online documentation}
|
8396
8495
|
*/
|
8397
8496
|
readonly fluid_capacity: double
|
@@ -9078,7 +9177,7 @@ interface CarEntityPrototype extends BaseEntityPrototype {
|
|
9078
9177
|
*/
|
9079
9178
|
readonly turret_rotation_speed?: double
|
9080
9179
|
/**
|
9081
|
-
* A vector of the gun prototypes of this car, spider
|
9180
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
9082
9181
|
*
|
9083
9182
|
* _Can only be used if this is Car, SpiderVehicle, ArtilleryTurret or ArtilleryWagon_
|
9084
9183
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns Online documentation}
|
@@ -9139,7 +9238,7 @@ interface GeneratorEntityPrototype extends BaseEntityPrototype {
|
|
9139
9238
|
/**
|
9140
9239
|
* The default maximum power output of this generator prototype.
|
9141
9240
|
*
|
9142
|
-
* _Can only be used if this is Generator_
|
9241
|
+
* _Can only be used if this is BurnerGenerator or Generator_
|
9143
9242
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_power_output Online documentation}
|
9144
9243
|
*/
|
9145
9244
|
readonly max_power_output?: double
|
@@ -9164,7 +9263,7 @@ interface RollingStockEntityPrototype extends BaseEntityPrototype {
|
|
9164
9263
|
|
9165
9264
|
interface SpiderVehicleEntityPrototype extends BaseEntityPrototype {
|
9166
9265
|
/**
|
9167
|
-
* A vector of the gun prototypes of this car, spider
|
9266
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
9168
9267
|
*
|
9169
9268
|
* _Can only be used if this is Car, SpiderVehicle, ArtilleryTurret or ArtilleryWagon_
|
9170
9269
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns Online documentation}
|
@@ -9216,7 +9315,7 @@ interface SpiderVehicleEntityPrototype extends BaseEntityPrototype {
|
|
9216
9315
|
|
9217
9316
|
interface ArtilleryTurretEntityPrototype extends BaseEntityPrototype {
|
9218
9317
|
/**
|
9219
|
-
* A vector of the gun prototypes of this car, spider
|
9318
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
9220
9319
|
*
|
9221
9320
|
* _Can only be used if this is Car, SpiderVehicle, ArtilleryTurret or ArtilleryWagon_
|
9222
9321
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns Online documentation}
|
@@ -9233,7 +9332,7 @@ interface ArtilleryTurretEntityPrototype extends BaseEntityPrototype {
|
|
9233
9332
|
|
9234
9333
|
interface ArtilleryWagonEntityPrototype extends BaseEntityPrototype {
|
9235
9334
|
/**
|
9236
|
-
* A vector of the gun prototypes of this car, spider
|
9335
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
9237
9336
|
*
|
9238
9337
|
* _Can only be used if this is Car, SpiderVehicle, ArtilleryTurret or ArtilleryWagon_
|
9239
9338
|
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.indexed_guns Online documentation}
|
@@ -9404,6 +9503,16 @@ interface RobotWithLogisticsInterfaceEntityPrototype extends BaseEntityPrototype
|
|
9404
9503
|
readonly draw_cargo?: boolean
|
9405
9504
|
}
|
9406
9505
|
|
9506
|
+
interface BurnerGeneratorEntityPrototype extends BaseEntityPrototype {
|
9507
|
+
/**
|
9508
|
+
* The default maximum power output of this generator prototype.
|
9509
|
+
*
|
9510
|
+
* _Can only be used if this is BurnerGenerator or Generator_
|
9511
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaEntityPrototype.html#LuaEntityPrototype.max_power_output Online documentation}
|
9512
|
+
*/
|
9513
|
+
readonly max_power_output?: double
|
9514
|
+
}
|
9515
|
+
|
9407
9516
|
interface BoilerEntityPrototype extends BaseEntityPrototype {
|
9408
9517
|
/**
|
9409
9518
|
* The target temperature of this boiler prototype.
|
@@ -10222,7 +10331,7 @@ interface LuaEquipmentGrid {
|
|
10222
10331
|
*/
|
10223
10332
|
readonly max_shield: float
|
10224
10333
|
/**
|
10225
|
-
*
|
10334
|
+
* Whether this grid's equipment movement bonus is active.
|
10226
10335
|
* @see {@link https://lua-api.factorio.com/latest/LuaEquipmentGrid.html#LuaEquipmentGrid.inhibit_movement_bonus Online documentation}
|
10227
10336
|
*/
|
10228
10337
|
inhibit_movement_bonus: boolean
|
@@ -10692,10 +10801,10 @@ interface LuaFlowStatistics {
|
|
10692
10801
|
*/
|
10693
10802
|
interface LuaFluidBox extends Array<Fluid | nil> {
|
10694
10803
|
/**
|
10695
|
-
* The prototype of this fluidbox index.
|
10804
|
+
* 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
|
10696
10805
|
* @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_prototype Online documentation}
|
10697
10806
|
*/
|
10698
|
-
get_prototype(index: uint): LuaFluidBoxPrototype
|
10807
|
+
get_prototype(index: uint): LuaFluidBoxPrototype | LuaFluidBoxPrototype[]
|
10699
10808
|
/**
|
10700
10809
|
* The capacity of the given fluidbox index.
|
10701
10810
|
* @see {@link https://lua-api.factorio.com/latest/LuaFluidBox.html#LuaFluidBox.get_capacity Online documentation}
|
@@ -11101,9 +11210,10 @@ interface LuaForce {
|
|
11101
11210
|
clear_chart(surface?: SurfaceIdentification): void
|
11102
11211
|
/**
|
11103
11212
|
* Force a rechart of the whole chart.
|
11213
|
+
* @param surface Which surface to rechart or all if not given.
|
11104
11214
|
* @see {@link https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.rechart Online documentation}
|
11105
11215
|
*/
|
11106
|
-
rechart(): void
|
11216
|
+
rechart(surface?: SurfaceIdentification): void
|
11107
11217
|
/**
|
11108
11218
|
* Chart all generated chunks.
|
11109
11219
|
* @param surface Which surface to chart or all if not given.
|
@@ -11585,10 +11695,10 @@ interface LuaForce {
|
|
11585
11695
|
*/
|
11586
11696
|
research_queue_enabled: boolean
|
11587
11697
|
/**
|
11588
|
-
*
|
11698
|
+
* This force's index in {@link LuaGameScript#forces LuaGameScript::forces} (unique ID). It is assigned when a force is created, and remains so until it is {@link OnForcesMergedEvent merged} (ie. deleted). Indexes of merged forces can be reused.
|
11589
11699
|
* @see {@link https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.index Online documentation}
|
11590
11700
|
*/
|
11591
|
-
readonly index:
|
11701
|
+
readonly index: ForceIndex
|
11592
11702
|
/**
|
11593
11703
|
* The research queue of this force. The first technology in the array is the currently active one. Reading this attribute gives an array of {@link LuaTechnology}.
|
11594
11704
|
*
|
@@ -11890,7 +12000,7 @@ interface LuaGameScript {
|
|
11890
12000
|
*/
|
11891
12001
|
remove_offline_players(players?: readonly (LuaPlayer | string)[]): void
|
11892
12002
|
/**
|
11893
|
-
* Force a CRC check. Tells all peers to calculate their current
|
12003
|
+
* Force a CRC check. Tells all peers to calculate their current CRC, which are then compared to each other. If a mismatch is detected, the game desyncs and some peers are forced to reconnect.
|
11894
12004
|
* @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.force_crc Online documentation}
|
11895
12005
|
*/
|
11896
12006
|
force_crc(): void
|
@@ -12086,7 +12196,7 @@ interface LuaGameScript {
|
|
12086
12196
|
*/
|
12087
12197
|
count_pipe_groups(): void
|
12088
12198
|
/**
|
12089
|
-
*
|
12199
|
+
* Whether the save is loaded as a multiplayer map.
|
12090
12200
|
* @see {@link https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.is_multiplayer Online documentation}
|
12091
12201
|
*/
|
12092
12202
|
is_multiplayer(): boolean
|
@@ -12875,6 +12985,14 @@ interface ButtonGuiSpec extends BaseGuiSpec {
|
|
12875
12985
|
* Which mouse buttons the button responds to. Defaults to `"left-and-right"`.
|
12876
12986
|
*/
|
12877
12987
|
readonly mouse_button_filter?: MouseButtonFlagsWrite
|
12988
|
+
/**
|
12989
|
+
* Whether the button will automatically toggle when clicked. Defaults to `false`.
|
12990
|
+
*/
|
12991
|
+
readonly auto_toggle?: boolean
|
12992
|
+
/**
|
12993
|
+
* The initial toggled state of the button. Defaults to `false`.
|
12994
|
+
*/
|
12995
|
+
readonly toggled?: boolean
|
12878
12996
|
}
|
12879
12997
|
|
12880
12998
|
/**
|
@@ -13023,6 +13141,14 @@ interface SpriteButtonGuiSpec extends BaseGuiSpec {
|
|
13023
13141
|
* The mouse buttons that the button responds to. Defaults to `"left-and-right"`.
|
13024
13142
|
*/
|
13025
13143
|
readonly mouse_button_filter?: MouseButtonFlagsWrite
|
13144
|
+
/**
|
13145
|
+
* Whether the button will automatically toggle when clicked. Defaults to `false`.
|
13146
|
+
*/
|
13147
|
+
readonly auto_toggle?: boolean
|
13148
|
+
/**
|
13149
|
+
* The initial toggled state of the button. Defaults to `false`.
|
13150
|
+
*/
|
13151
|
+
readonly toggled?: boolean
|
13026
13152
|
}
|
13027
13153
|
|
13028
13154
|
/**
|
@@ -13568,6 +13694,11 @@ interface BaseGuiElement {
|
|
13568
13694
|
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tags Online documentation}
|
13569
13695
|
*/
|
13570
13696
|
tags: Tags
|
13697
|
+
/**
|
13698
|
+
* Whether this element will raise {@link OnGuiHoverEvent on_gui_hover} and {@link OnGuiLeaveEvent on_gui_leave}.
|
13699
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.raise_hover_events Online documentation}
|
13700
|
+
*/
|
13701
|
+
raise_hover_events: boolean
|
13571
13702
|
/**
|
13572
13703
|
* 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.
|
13573
13704
|
*/
|
@@ -13935,6 +14066,20 @@ interface SpriteButtonGuiElementMembers extends BaseGuiElement {
|
|
13935
14066
|
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.show_percent_for_small_numbers Online documentation}
|
13936
14067
|
*/
|
13937
14068
|
show_percent_for_small_numbers: boolean
|
14069
|
+
/**
|
14070
|
+
* Whether this button will automatically toggle when clicked.
|
14071
|
+
*
|
14072
|
+
* _Can only be used if this is button or sprite-button_
|
14073
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.auto_toggle Online documentation}
|
14074
|
+
*/
|
14075
|
+
auto_toggle: boolean
|
14076
|
+
/**
|
14077
|
+
* Whether this button is currently toggled.
|
14078
|
+
*
|
14079
|
+
* _Can only be used if this is button or sprite-button_
|
14080
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
|
14081
|
+
*/
|
14082
|
+
toggled: boolean
|
13938
14083
|
/**
|
13939
14084
|
* The mouse button filters for this button or sprite-button.
|
13940
14085
|
*
|
@@ -14100,6 +14245,20 @@ interface ButtonGuiElementMembers extends BaseGuiElement {
|
|
14100
14245
|
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.type Online documentation}
|
14101
14246
|
*/
|
14102
14247
|
readonly type: "button"
|
14248
|
+
/**
|
14249
|
+
* Whether this button will automatically toggle when clicked.
|
14250
|
+
*
|
14251
|
+
* _Can only be used if this is button or sprite-button_
|
14252
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.auto_toggle Online documentation}
|
14253
|
+
*/
|
14254
|
+
auto_toggle: boolean
|
14255
|
+
/**
|
14256
|
+
* Whether this button is currently toggled.
|
14257
|
+
*
|
14258
|
+
* _Can only be used if this is button or sprite-button_
|
14259
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.toggled Online documentation}
|
14260
|
+
*/
|
14261
|
+
toggled: boolean
|
14103
14262
|
/**
|
14104
14263
|
* The mouse button filters for this button or sprite-button.
|
14105
14264
|
*
|
@@ -14737,7 +14896,7 @@ type GuiElementMembers =
|
|
14737
14896
|
* - `"progressbar"`: A partially filled bar that can be used to indicate progress.
|
14738
14897
|
* - `"table"`: An invisible container that lays out its children in a specific number of columns. The width of each column is determined by the widest element it contains.
|
14739
14898
|
* - `"textfield"`: A single-line box the user can type into. Relevant events: {@link OnGuiTextChangedEvent on_gui_text_changed}, {@link OnGuiConfirmedEvent on_gui_confirmed}
|
14740
|
-
* - `"radiobutton"`:
|
14899
|
+
* - `"radiobutton"`: An element that is similar to a `checkbox`, but with a circular appearance. Clicking a selected radio button will not unselect it. Radio buttons are not linked to each other in any way. Relevant event: {@link OnGuiCheckedStateChangedEvent on_gui_checked_state_changed}
|
14741
14900
|
* - `"sprite"`: An element that shows an image.
|
14742
14901
|
* - `"scroll-pane"`: An invisible element that is similar to a `flow`, but has the ability to show and use scroll bars.
|
14743
14902
|
* - `"drop-down"`: A drop-down containing strings of text. Relevant event: {@link OnGuiSelectionStateChangedEvent on_gui_selection_state_changed}
|
@@ -16378,6 +16537,14 @@ interface LuaItemStack {
|
|
16378
16537
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.drain_durability Online documentation}
|
16379
16538
|
*/
|
16380
16539
|
drain_durability(amount: double): void
|
16540
|
+
/**
|
16541
|
+
* Use the capsule item with the entity as the source, targeting the given position.
|
16542
|
+
* @param entity The entity to use the capsule item with.
|
16543
|
+
* @param target_position The position to use the capsule item with.
|
16544
|
+
* @returns Array of the entities that were created by the capsule action.
|
16545
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.use_capsule Online documentation}
|
16546
|
+
*/
|
16547
|
+
use_capsule(entity: LuaEntity, target_position: MapPosition | MapPositionArray): LuaEntity[]
|
16381
16548
|
/**
|
16382
16549
|
* Would a call to {@link LuaItemStack#set_stack LuaItemStack::set_stack} succeed?
|
16383
16550
|
* @param stack Stack that would be set, possibly `nil`.
|
@@ -16847,7 +17014,7 @@ interface LuaItemStack {
|
|
16847
17014
|
* _Can only be used if this is BlueprintItem_
|
16848
17015
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.default_icons Online documentation}
|
16849
17016
|
*/
|
16850
|
-
readonly default_icons:
|
17017
|
+
readonly default_icons: BlueprintSignalIcon[]
|
16851
17018
|
/**
|
16852
17019
|
* _Can only be used if this is ItemWithTags_
|
16853
17020
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.tags Online documentation}
|
@@ -16942,6 +17109,21 @@ interface LuaItemStack {
|
|
16942
17109
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.connected_entity Online documentation}
|
16943
17110
|
*/
|
16944
17111
|
connected_entity?: LuaEntity
|
17112
|
+
/**
|
17113
|
+
* If this is an item with entity data, get the stored entity label.
|
17114
|
+
*
|
17115
|
+
* _Can only be used if this is ItemWithEntityData_
|
17116
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_label Online documentation}
|
17117
|
+
*/
|
17118
|
+
entity_label?: string
|
17119
|
+
/**
|
17120
|
+
* If this is an item with entity data, get the stored entity color.
|
17121
|
+
*
|
17122
|
+
* _Can only be used if this is ItemWithEntityData_
|
17123
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_color Online documentation}
|
17124
|
+
*/
|
17125
|
+
get entity_color(): Color | nil
|
17126
|
+
set entity_color(value: Color | ColorArray | nil)
|
16945
17127
|
/**
|
16946
17128
|
* If this is a blueprint item.
|
16947
17129
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_blueprint Online documentation}
|
@@ -17035,6 +17217,14 @@ interface BaseItemStack {
|
|
17035
17217
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.is_blueprint_setup Online documentation}
|
17036
17218
|
*/
|
17037
17219
|
is_blueprint_setup(): boolean
|
17220
|
+
/**
|
17221
|
+
* Use the capsule item with the entity as the source, targeting the given position.
|
17222
|
+
* @param entity The entity to use the capsule item with.
|
17223
|
+
* @param target_position The position to use the capsule item with.
|
17224
|
+
* @returns Array of the entities that were created by the capsule action.
|
17225
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.use_capsule Online documentation}
|
17226
|
+
*/
|
17227
|
+
use_capsule(entity: LuaEntity, target_position: MapPosition | MapPositionArray): LuaEntity[]
|
17038
17228
|
/**
|
17039
17229
|
* Would a call to {@link LuaItemStack#set_stack LuaItemStack::set_stack} succeed?
|
17040
17230
|
* @param stack Stack that would be set, possibly `nil`.
|
@@ -17496,7 +17686,7 @@ interface BlueprintItemStack extends BaseItemStack {
|
|
17496
17686
|
* _Can only be used if this is BlueprintItem_
|
17497
17687
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.default_icons Online documentation}
|
17498
17688
|
*/
|
17499
|
-
readonly default_icons:
|
17689
|
+
readonly default_icons: BlueprintSignalIcon[]
|
17500
17690
|
}
|
17501
17691
|
|
17502
17692
|
/**
|
@@ -17720,6 +17910,21 @@ interface ItemWithEntityDataItemStack extends BaseItemStack {
|
|
17720
17910
|
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.create_grid Online documentation}
|
17721
17911
|
*/
|
17722
17912
|
create_grid(): LuaEquipmentGrid
|
17913
|
+
/**
|
17914
|
+
* If this is an item with entity data, get the stored entity label.
|
17915
|
+
*
|
17916
|
+
* _Can only be used if this is ItemWithEntityData_
|
17917
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_label Online documentation}
|
17918
|
+
*/
|
17919
|
+
entity_label?: string
|
17920
|
+
/**
|
17921
|
+
* If this is an item with entity data, get the stored entity color.
|
17922
|
+
*
|
17923
|
+
* _Can only be used if this is ItemWithEntityData_
|
17924
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaItemStack.html#LuaItemStack.entity_color Online documentation}
|
17925
|
+
*/
|
17926
|
+
get entity_color(): Color | nil
|
17927
|
+
set entity_color(value: Color | ColorArray | nil)
|
17723
17928
|
}
|
17724
17929
|
|
17725
17930
|
interface ItemWithLabelItemStack extends BaseItemStack {
|
@@ -18906,7 +19111,7 @@ interface LuaPlayer extends LuaControl {
|
|
18906
19111
|
readonly skip_fog_of_war?: boolean
|
18907
19112
|
}): boolean
|
18908
19113
|
/**
|
18909
|
-
* Builds
|
19114
|
+
* Builds whatever is in the cursor on the surface the player is on. The cursor stack will automatically be reduced as if the player built normally.
|
18910
19115
|
*
|
18911
19116
|
* **Raised events:**
|
18912
19117
|
* - {@link OnPreBuildEvent on_pre_build}? _instantly_ Raised if the cursor was successfully built.
|
@@ -19121,22 +19326,22 @@ interface LuaPlayer extends LuaControl {
|
|
19121
19326
|
*/
|
19122
19327
|
toggle_map_editor(): void
|
19123
19328
|
/**
|
19124
|
-
* Requests a translation for the given localised string. If the request is successful the {@link OnStringTranslatedEvent on_string_translated} event will be fired
|
19329
|
+
* Requests a translation for the given localised string. If the request is successful, the {@link OnStringTranslatedEvent on_string_translated} event will be fired with the results.
|
19125
19330
|
*
|
19126
19331
|
* **Raised events:**
|
19127
19332
|
* - {@link OnStringTranslatedEvent on_string_translated}? _future_tick_ Raised if the request was successfully sent.
|
19128
|
-
* @returns The unique
|
19129
|
-
* @remarks Does nothing if this player is not connected
|
19333
|
+
* @returns The unique ID for the requested translation.
|
19334
|
+
* @remarks Does nothing if this player is not connected (see {@link LuaPlayer#connected LuaPlayer::connected}).
|
19130
19335
|
* @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translation Online documentation}
|
19131
19336
|
*/
|
19132
19337
|
request_translation(localised_string: LocalisedString): uint | nil
|
19133
19338
|
/**
|
19134
|
-
* Requests
|
19339
|
+
* Requests translation for the given set of localised strings. If the request is successful, a {@link OnStringTranslatedEvent on_string_translated} event will be fired for each string with the results.
|
19135
19340
|
*
|
19136
19341
|
* **Raised events:**
|
19137
19342
|
* - {@link OnStringTranslatedEvent on_string_translated}? _future_tick_ Raised if the request was successfully sent.
|
19138
|
-
* @returns The unique
|
19139
|
-
* @remarks Does nothing if this player is not connected
|
19343
|
+
* @returns The unique IDs for the requested translations.
|
19344
|
+
* @remarks Does nothing if this player is not connected (see {@link LuaPlayer#connected LuaPlayer::connected}).
|
19140
19345
|
* @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translations Online documentation}
|
19141
19346
|
*/
|
19142
19347
|
request_translations(localised_strings: readonly LocalisedString[]): uint[] | nil
|
@@ -19198,7 +19403,7 @@ interface LuaPlayer extends LuaControl {
|
|
19198
19403
|
*/
|
19199
19404
|
readonly cutscene_character: LuaEntity | nil
|
19200
19405
|
/**
|
19201
|
-
* This player's
|
19406
|
+
* This player's index in {@link LuaGameScript#players LuaGameScript::players} (unique ID). It is assigned when a player is created, and remains so (even when the player is not {@link LuaPlayer#connected connected}) until the player is irreversably {@link OnPlayerRemovedEvent removed}. Indexes of removed players can be reused.
|
19202
19407
|
* @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index Online documentation}
|
19203
19408
|
*/
|
19204
19409
|
readonly index: PlayerIndex
|
@@ -19284,8 +19489,15 @@ interface LuaPlayer extends LuaControl {
|
|
19284
19489
|
*/
|
19285
19490
|
permission_group?: LuaPermissionGroup
|
19286
19491
|
/**
|
19287
|
-
* The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings#get_player_settings LuaSettings::get_player_settings}.
|
19288
|
-
*
|
19492
|
+
* The current per-player settings for the this player, indexed by prototype name. Returns the same structure as {@link LuaSettings#get_player_settings LuaSettings::get_player_settings}. This table becomes invalid if its associated player does.
|
19493
|
+
*
|
19494
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
19495
|
+
* @example
|
19496
|
+
*
|
19497
|
+
* ```
|
19498
|
+
* -- Change the value of the "active_lifestyle" setting
|
19499
|
+
* player.mod_settings["active_lifestyle"] = {value = true}
|
19500
|
+
* ```
|
19289
19501
|
* @see {@link https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mod_settings Online documentation}
|
19290
19502
|
*/
|
19291
19503
|
readonly mod_settings: LuaCustomTable<string, ModSetting>
|
@@ -19457,7 +19669,7 @@ interface LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior {
|
|
19457
19669
|
}
|
19458
19670
|
|
19459
19671
|
/**
|
19460
|
-
* An interface to send messages to the calling RCON interface
|
19672
|
+
* An interface to send messages to the calling RCON interface through the global object named `rcon`.
|
19461
19673
|
* @see {@link https://lua-api.factorio.com/latest/LuaRCON.html Online documentation}
|
19462
19674
|
* @noSelf
|
19463
19675
|
*/
|
@@ -19663,22 +19875,22 @@ interface LuaRecipe {
|
|
19663
19875
|
*/
|
19664
19876
|
readonly category: string
|
19665
19877
|
/**
|
19666
|
-
*
|
19667
|
-
* @example
|
19878
|
+
* The ingredients to this recipe.
|
19879
|
+
* @example The ingredients of `"advanced-oil-processing"` would look like this:
|
19668
19880
|
*
|
19669
19881
|
* ```
|
19670
|
-
* {{type="
|
19671
|
-
* ```
|
19672
|
-
* @example What the "advanced-oil-processing" recipe would return
|
19673
|
-
*
|
19674
|
-
* ```
|
19675
|
-
* {{type="fluid", name="crude-oil", amount=10}, {type="fluid", name="water", amount=5}}
|
19882
|
+
* {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
|
19676
19883
|
* ```
|
19677
19884
|
* @see {@link https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.ingredients Online documentation}
|
19678
19885
|
*/
|
19679
19886
|
readonly ingredients: Ingredient[]
|
19680
19887
|
/**
|
19681
|
-
* The results of this recipe.
|
19888
|
+
* The results/products of this recipe.
|
19889
|
+
* @example The products of `"advanced-oil-processing"` would look like this:
|
19890
|
+
*
|
19891
|
+
* ```
|
19892
|
+
* {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
|
19893
|
+
* ```
|
19682
19894
|
* @see {@link https://lua-api.factorio.com/latest/LuaRecipe.html#LuaRecipe.products Online documentation}
|
19683
19895
|
*/
|
19684
19896
|
readonly products: Product[]
|
@@ -19791,12 +20003,22 @@ interface LuaRecipePrototype {
|
|
19791
20003
|
*/
|
19792
20004
|
readonly category: string
|
19793
20005
|
/**
|
19794
|
-
*
|
20006
|
+
* The ingredients to this recipe.
|
20007
|
+
* @example The ingredients of `"advanced-oil-processing"` would look like this:
|
20008
|
+
*
|
20009
|
+
* ```
|
20010
|
+
* {{type="fluid", name="crude-oil", amount=100}, {type="fluid", name="water", amount=50}}
|
20011
|
+
* ```
|
19795
20012
|
* @see {@link https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.ingredients Online documentation}
|
19796
20013
|
*/
|
19797
20014
|
readonly ingredients: Ingredient[]
|
19798
20015
|
/**
|
19799
|
-
* The results of this recipe.
|
20016
|
+
* The results/products of this recipe.
|
20017
|
+
* @example The products of `"advanced-oil-processing"` would look like this:
|
20018
|
+
*
|
20019
|
+
* ```
|
20020
|
+
* {{type="fluid", name="heavy-oil", amount=25}, {type="fluid", name="light-oil", amount=45}, {type="fluid", name="petroleum-gas", amount=55}}
|
20021
|
+
* ```
|
19800
20022
|
* @see {@link https://lua-api.factorio.com/latest/LuaRecipePrototype.html#LuaRecipePrototype.products Online documentation}
|
19801
20023
|
*/
|
19802
20024
|
readonly products: Product[]
|
@@ -19966,7 +20188,7 @@ interface LuaRemote {
|
|
19966
20188
|
}
|
19967
20189
|
|
19968
20190
|
/**
|
19969
|
-
* Allows rendering of geometric shapes, text and sprites in the game world
|
20191
|
+
* Allows rendering of geometric shapes, text and sprites in the game world through the global object named `rendering`. Each render object is identified by an id that is universally unique for the lifetime of a whole game.
|
19970
20192
|
* @remarks If an entity target of an object is destroyed or changes surface, then the object is also destroyed.
|
19971
20193
|
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html Online documentation}
|
19972
20194
|
* @noSelf
|
@@ -20077,7 +20299,7 @@ interface LuaRendering {
|
|
20077
20299
|
*/
|
20078
20300
|
readonly visible?: boolean
|
20079
20301
|
/**
|
20080
|
-
* If this should be drawn below sprites and entities.
|
20302
|
+
* If this should be drawn below sprites and entities. Rich text does not support this option.
|
20081
20303
|
*/
|
20082
20304
|
readonly draw_on_ground?: boolean
|
20083
20305
|
/**
|
@@ -20100,6 +20322,10 @@ interface LuaRendering {
|
|
20100
20322
|
* If this should only be rendered in alt mode. Defaults to false.
|
20101
20323
|
*/
|
20102
20324
|
readonly only_in_alt_mode?: boolean
|
20325
|
+
/**
|
20326
|
+
* If rich text rendering is enabled. Defaults to false.
|
20327
|
+
*/
|
20328
|
+
readonly use_rich_text?: boolean
|
20103
20329
|
}): uint64
|
20104
20330
|
/**
|
20105
20331
|
* Create a circle.
|
@@ -20284,6 +20510,10 @@ interface LuaRendering {
|
|
20284
20510
|
* Only used if `orientation_target` is a LuaEntity.
|
20285
20511
|
*/
|
20286
20512
|
readonly orientation_target_offset?: Vector
|
20513
|
+
/**
|
20514
|
+
* Only used if `orientation_target` is a LuaEntity.
|
20515
|
+
*/
|
20516
|
+
readonly use_target_orientation?: boolean
|
20287
20517
|
readonly surface: SurfaceIdentification
|
20288
20518
|
/**
|
20289
20519
|
* In ticks. Defaults to living forever.
|
@@ -20349,6 +20579,10 @@ interface LuaRendering {
|
|
20349
20579
|
* Only used if `orientation_target` is a LuaEntity.
|
20350
20580
|
*/
|
20351
20581
|
readonly orientation_target_offset?: Vector
|
20582
|
+
/**
|
20583
|
+
* Only used if `orientation_target` is a LuaEntity.
|
20584
|
+
*/
|
20585
|
+
readonly use_target_orientation?: boolean
|
20352
20586
|
/**
|
20353
20587
|
* Offsets the center of the sprite if `orientation_target` is given. This offset will rotate together with the sprite.
|
20354
20588
|
*/
|
@@ -20485,6 +20719,10 @@ interface LuaRendering {
|
|
20485
20719
|
* Only used if `orientation_target` is a LuaEntity.
|
20486
20720
|
*/
|
20487
20721
|
readonly orientation_target_offset?: Vector
|
20722
|
+
/**
|
20723
|
+
* Only used if `orientation_target` is a LuaEntity.
|
20724
|
+
*/
|
20725
|
+
readonly use_target_orientation?: boolean
|
20488
20726
|
/**
|
20489
20727
|
* Offsets the center of the animation if `orientation_target` is given. This offset will rotate together with the animation.
|
20490
20728
|
*/
|
@@ -20536,13 +20774,13 @@ interface LuaRendering {
|
|
20536
20774
|
is_valid(id: uint64): boolean
|
20537
20775
|
/**
|
20538
20776
|
* Gets an array of all valid object ids.
|
20539
|
-
* @param mod_name If provided, get only the render objects created by this mod.
|
20777
|
+
* @param mod_name If provided, get only the render objects created by this mod. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
|
20540
20778
|
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_all_ids Online documentation}
|
20541
20779
|
*/
|
20542
20780
|
get_all_ids(mod_name?: string): uint64[]
|
20543
20781
|
/**
|
20544
|
-
* Destroys all render objects.
|
20545
|
-
* @param mod_name If provided, only the render objects created by this mod are destroyed.
|
20782
|
+
* Destroys all render objects. Passing an empty string (`""`)
|
20783
|
+
* @param mod_name If provided, only the render objects created by this mod are destroyed. An empty string (`""`) refers to all objects not belonging to a mod, such as those created using console commands.
|
20546
20784
|
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.clear Online documentation}
|
20547
20785
|
*/
|
20548
20786
|
clear(mod_name?: string): void
|
@@ -20627,6 +20865,17 @@ interface LuaRendering {
|
|
20627
20865
|
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_only_in_alt_mode Online documentation}
|
20628
20866
|
*/
|
20629
20867
|
set_only_in_alt_mode(id: uint64, only_in_alt_mode: boolean): void
|
20868
|
+
/**
|
20869
|
+
* Get whether this uses the target orientation.
|
20870
|
+
* @returns `nil` if the object is not a sprite, polygon, or animation.
|
20871
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_use_target_orientation Online documentation}
|
20872
|
+
*/
|
20873
|
+
get_use_target_orientation(id: uint64): boolean | nil
|
20874
|
+
/**
|
20875
|
+
* Set whether this uses the target orientation.
|
20876
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_use_target_orientation Online documentation}
|
20877
|
+
*/
|
20878
|
+
set_use_target_orientation(id: uint64, use_target_orientation: boolean): void
|
20630
20879
|
/**
|
20631
20880
|
* Get the color or tint of the object with this id.
|
20632
20881
|
*
|
@@ -20850,6 +21099,21 @@ interface LuaRendering {
|
|
20850
21099
|
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_scale_with_zoom Online documentation}
|
20851
21100
|
*/
|
20852
21101
|
set_scale_with_zoom(id: uint64, scale_with_zoom: boolean): void
|
21102
|
+
/**
|
21103
|
+
* Get if the text with this id parses rich text tags.
|
21104
|
+
*
|
21105
|
+
* _Can only be used if this is Text_
|
21106
|
+
* @returns `nil` if the object is not a text.
|
21107
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.get_use_rich_text Online documentation}
|
21108
|
+
*/
|
21109
|
+
get_use_rich_text(id: uint64): boolean | nil
|
21110
|
+
/**
|
21111
|
+
* Set if the text with this id parses rich text tags.
|
21112
|
+
*
|
21113
|
+
* _Can only be used if this is Text_
|
21114
|
+
* @see {@link https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.set_use_rich_text Online documentation}
|
21115
|
+
*/
|
21116
|
+
set_use_rich_text(id: uint64, use_rich_text: boolean): void
|
20853
21117
|
/**
|
20854
21118
|
* Get if the circle or rectangle with this id is filled.
|
20855
21119
|
*
|
@@ -21271,8 +21535,15 @@ interface LuaRoboportControlBehavior extends LuaControlBehavior {
|
|
21271
21535
|
*/
|
21272
21536
|
interface LuaSettings {
|
21273
21537
|
/**
|
21274
|
-
* Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer#mod_settings LuaPlayer::mod_settings}.
|
21275
|
-
*
|
21538
|
+
* Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as {@link LuaPlayer#mod_settings LuaPlayer::mod_settings}. This table becomes invalid if its associated player does.
|
21539
|
+
*
|
21540
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
21541
|
+
* @example
|
21542
|
+
*
|
21543
|
+
* ```
|
21544
|
+
* -- Change the value of the "active_lifestyle" setting
|
21545
|
+
* settings.get_player_settings(player_index)["active_lifestyle"] = {value = true}
|
21546
|
+
* ```
|
21276
21547
|
* @see {@link https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.get_player_settings Online documentation}
|
21277
21548
|
*/
|
21278
21549
|
get_player_settings(player: PlayerIdentification): LuaCustomTable<string, ModSetting>
|
@@ -21284,14 +21555,14 @@ interface LuaSettings {
|
|
21284
21555
|
/**
|
21285
21556
|
* The current global mod settings, indexed by prototype name.
|
21286
21557
|
*
|
21287
|
-
* Even though
|
21558
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
21288
21559
|
* @see {@link https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.global Online documentation}
|
21289
21560
|
*/
|
21290
21561
|
readonly global: LuaCustomTable<string, ModSetting>
|
21291
21562
|
/**
|
21292
21563
|
* The default player mod settings for this map, indexed by prototype name.
|
21293
21564
|
*
|
21294
|
-
* Even though
|
21565
|
+
* Even though this attribute is marked as read-only, individual settings can be changed by overwriting their {@link ModSetting} table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
|
21295
21566
|
* @see {@link https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.player Online documentation}
|
21296
21567
|
*/
|
21297
21568
|
readonly player: LuaCustomTable<string, ModSetting>
|
@@ -22188,7 +22459,7 @@ interface BaseSurfaceCreateEntity {
|
|
22188
22459
|
*/
|
22189
22460
|
readonly target?: LuaEntity | (MapPosition | MapPositionArray)
|
22190
22461
|
/**
|
22191
|
-
* Source entity. Used for beams and highlight-boxes.
|
22462
|
+
* Source entity. Used for beams, projectiles, and highlight-boxes.
|
22192
22463
|
*/
|
22193
22464
|
readonly source?: LuaEntity | (MapPosition | MapPositionArray)
|
22194
22465
|
/**
|
@@ -22199,6 +22470,10 @@ interface BaseSurfaceCreateEntity {
|
|
22199
22470
|
* If given set the last_user to this player. If fast_replace is true simulate fast replace using this player.
|
22200
22471
|
*/
|
22201
22472
|
readonly player?: PlayerIdentification
|
22473
|
+
/**
|
22474
|
+
* If fast_replace is true simulate fast replace using this character.
|
22475
|
+
*/
|
22476
|
+
readonly character?: LuaEntity
|
22202
22477
|
/**
|
22203
22478
|
* If false while fast_replace is true and player is nil any items from fast-replacing will be deleted instead of dropped on the ground.
|
22204
22479
|
*/
|
@@ -22692,6 +22967,7 @@ interface LuaSurface {
|
|
22692
22967
|
readonly to_be_upgraded?: boolean
|
22693
22968
|
readonly limit?: uint
|
22694
22969
|
readonly is_military_target?: boolean
|
22970
|
+
readonly has_item_inside?: LuaItemPrototype
|
22695
22971
|
/**
|
22696
22972
|
* Whether the filters should be inverted.
|
22697
22973
|
*/
|
@@ -23597,7 +23873,7 @@ interface LuaSurface {
|
|
23597
23873
|
*/
|
23598
23874
|
readonly can_open_gates?: boolean
|
23599
23875
|
/**
|
23600
|
-
* Defines how coarse the pathfinder's grid is
|
23876
|
+
* Defines how coarse the pathfinder's grid is, where smaller values mean a coarser grid. Defaults to `0`, which equals a resolution of `1x1` tiles, centered on tile centers. Values range from `-8` to `8` inclusive, where each integer increment doubles/halves the resolution. So, a resolution of `-8` equals a grid of `256x256` tiles, and a resolution of `8` equals `1/256` of a tile.
|
23601
23877
|
*/
|
23602
23878
|
readonly path_resolution_modifier?: int
|
23603
23879
|
/**
|
@@ -23751,12 +24027,12 @@ interface LuaSurface {
|
|
23751
24027
|
*/
|
23752
24028
|
name: string
|
23753
24029
|
/**
|
23754
|
-
*
|
24030
|
+
* This surface's index in {@link LuaGameScript#surfaces LuaGameScript::surfaces} (unique ID). It is assigned when a surface is created, and remains so until it is {@link OnSurfaceDeletedEvent deleted}. Indexes of deleted surfaces can be reused.
|
23755
24031
|
* @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.index Online documentation}
|
23756
24032
|
*/
|
23757
24033
|
readonly index: SurfaceIndex
|
23758
24034
|
/**
|
23759
|
-
* The generation settings for this surface. These can be modified
|
24035
|
+
* The generation settings for this surface. These can be modified after surface generation, but note that this will not retroactively update the surface. To manually regenerate it, {@link LuaSurface#regenerate_entity LuaSurface::regenerate_entity}, {@link LuaSurface#regenerate_decorative LuaSurface::regenerate_decorative}, and {@link LuaSurface#delete_chunk LuaSurface::delete_chunk} can be used.
|
23760
24036
|
* @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.map_gen_settings Online documentation}
|
23761
24037
|
*/
|
23762
24038
|
get map_gen_settings(): MapGenSettings
|
@@ -23782,7 +24058,7 @@ interface LuaSurface {
|
|
23782
24058
|
*/
|
23783
24059
|
readonly darkness: float
|
23784
24060
|
/**
|
23785
|
-
* Current wind speed.
|
24061
|
+
* Current wind speed in tiles per tick.
|
23786
24062
|
* @see {@link https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.wind_speed Online documentation}
|
23787
24063
|
*/
|
23788
24064
|
wind_speed: double
|
@@ -23966,7 +24242,7 @@ interface LuaTechnology {
|
|
23966
24242
|
*/
|
23967
24243
|
level: uint
|
23968
24244
|
/**
|
23969
|
-
* The count formula
|
24245
|
+
* The count formula, if this research has any. See the {@linkplain https://wiki.factorio.com/Prototype/Technology#Technology_data wiki} for details.
|
23970
24246
|
* @see {@link https://lua-api.factorio.com/latest/LuaTechnology.html#LuaTechnology.research_unit_count_formula Online documentation}
|
23971
24247
|
*/
|
23972
24248
|
readonly research_unit_count_formula?: string
|
@@ -24069,7 +24345,7 @@ interface LuaTechnologyPrototype {
|
|
24069
24345
|
*/
|
24070
24346
|
readonly max_level: uint
|
24071
24347
|
/**
|
24072
|
-
* The count formula
|
24348
|
+
* The count formula, if this research has any. See the {@linkplain https://wiki.factorio.com/Prototype/Technology#Technology_data wiki} for details.
|
24073
24349
|
* @see {@link https://lua-api.factorio.com/latest/LuaTechnologyPrototype.html#LuaTechnologyPrototype.research_unit_count_formula Online documentation}
|
24074
24350
|
*/
|
24075
24351
|
readonly research_unit_count_formula?: string
|
@@ -24246,10 +24522,10 @@ interface LuaTilePrototype {
|
|
24246
24522
|
*/
|
24247
24523
|
readonly next_direction?: LuaTilePrototype
|
24248
24524
|
/**
|
24249
|
-
* Items that when placed will produce this tile
|
24525
|
+
* Items that when placed will produce this tile, if any. Construction bots will choose the first item in the list to build this tile.
|
24250
24526
|
* @see {@link https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.items_to_place_this Online documentation}
|
24251
24527
|
*/
|
24252
|
-
readonly items_to_place_this
|
24528
|
+
readonly items_to_place_this?: ItemStackDefinition[]
|
24253
24529
|
/**
|
24254
24530
|
* False if this tile is not allowed in blueprints regardless of the ability to build it.
|
24255
24531
|
* @see {@link https://lua-api.factorio.com/latest/LuaTilePrototype.html#LuaTilePrototype.can_be_part_of_blueprint Online documentation}
|