factorio-types 0.0.16 → 0.0.20

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,7 +2,7 @@
2
2
  // Factorio API reference https://lua-api.factorio.com/latest/index.html
3
3
  // Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
4
4
  // Definition source https://github.com/sguest/factorio-types
5
- // Factorio version 1.1.46
5
+ // Factorio version 1.1.51
6
6
  // API version 1
7
7
 
8
8
  /**
@@ -299,10 +299,12 @@ interface LuaBootstrap {
299
299
 
300
300
  /**
301
301
  * 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. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript | LuaGameScript} and {@link LuaRendering | LuaRendering} is not available. The `global` table can be accessed and is safe to read from, but not write to.
302
+ *
302
303
  * The only legitimate uses of this event are these three:
303
304
  * - Re-setup {@link metatables | https://www.lua.org/pil/13.html} as they are not persisted through save-load.
304
305
  * - Re-setup conditional event handlers.
305
306
  * - Create local references to data stored in the {@link global | Global.html} table.
307
+ *
306
308
  * For all other purposes, {@link LuaBootstrap::on_init | LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | LuaBootstrap::on_configuration_changed} or migration scripts should be used instead.
307
309
  * @param f - The handler for this event. Passing `nil` will unregister it.
308
310
  */
@@ -340,6 +342,7 @@ interface LuaBootstrap {
340
342
 
341
343
  /**
342
344
  * Raise an event. Only events generated with {@link LuaBootstrap::generate_event_name | LuaBootstrap::generate_event_name} and the following can be raised:
345
+ *
343
346
  * - {@link on_console_chat | on_console_chat}
344
347
  * - {@link on_player_crafted_item | on_player_crafted_item}
345
348
  * - {@link on_player_fast_transferred | on_player_fast_transferred}
@@ -626,6 +629,7 @@ interface LuaBurnerPrototype {
626
629
 
627
630
  /**
628
631
  * A chunk iterator can be used for iterating chunks coordinates of a surface.
632
+ *
629
633
  * The returned type is a {@link ChunkPositionAndArea | ChunkPositionAndArea} containing the chunk coordinates and its area.
630
634
  * @example
631
635
  * ```
@@ -985,23 +989,19 @@ interface LuaControl {
985
989
 
986
990
  /**
987
991
  * Gets the parameters of a personal logistic request and auto-trash slot.
988
- * @remarks
989
- * This will silently return an empty value (`name` will be `nil`) if personal logistics are not researched yet.
990
- *
991
992
  * @param slot_index - The slot to get.
993
+ * @returns The logistic parameters. If personal logistics are not researched yet, their `name` will be `nil`.
992
994
  */
993
995
  get_personal_logistic_slot(this: void,
994
- slot_index: number): PersonalLogisticParameters
996
+ slot_index: number): LogisticParameters
995
997
 
996
998
  /**
997
999
  * Gets the parameters of a vehicle logistic request and auto-trash slot.
998
- * @remarks
999
- * This will silently return an empty value (`name` will be `nil`) if the vehicle does not use logistics.
1000
- *
1001
1000
  * @param slot_index - The slot to get.
1001
+ * @returns The logistic parameters. If the vehicle does not use logistics, their `name` will be `nil`.
1002
1002
  */
1003
1003
  get_vehicle_logistic_slot(this: void,
1004
- slot_index: number): PersonalLogisticParameters
1004
+ slot_index: number): LogisticParameters
1005
1005
 
1006
1006
  /**
1007
1007
  * Does this entity have any item inside it?
@@ -1080,29 +1080,23 @@ interface LuaControl {
1080
1080
 
1081
1081
  /**
1082
1082
  * Sets a personal logistic request and auto-trash slot to the given value.
1083
- * @remarks
1084
- * This will silently fail if personal logistics are not researched yet.
1085
- *
1086
1083
  * @param slot_index - The slot to set.
1087
1084
  * @param value - The logistic request parameters.
1088
- * @returns Whether the slot was set successfully.
1085
+ * @returns Whether the slot was set successfully. `false` if personal logistics are not researched yet.
1089
1086
  */
1090
1087
  set_personal_logistic_slot(this: void,
1091
1088
  slot_index: number,
1092
- value: PersonalLogisticParameters): boolean
1089
+ value: LogisticParameters): boolean
1093
1090
 
1094
1091
  /**
1095
1092
  * Sets a vehicle logistic request and auto-trash slot to the given value.
1096
- * @remarks
1097
- * This will silently fail if the vehicle does not use logistics.
1098
- *
1099
1093
  * @param slot_index - The slot to set.
1100
1094
  * @param value - The logistic request parameters.
1101
- * @returns Whether the slot was set successfully.
1095
+ * @returns Whether the slot was set successfully. `false` if the vehicle does not use logistics.
1102
1096
  */
1103
1097
  set_vehicle_logistic_slot(this: void,
1104
1098
  slot_index: number,
1105
- value: PersonalLogisticParameters): boolean
1099
+ value: LogisticParameters): boolean
1106
1100
 
1107
1101
  /**
1108
1102
  * Teleport the entity to a given position, possibly on another surface.
@@ -1115,7 +1109,7 @@ interface LuaControl {
1115
1109
  * @returns `true` when the entity was successfully teleported.
1116
1110
  */
1117
1111
  teleport(this: void,
1118
- position: Position,
1112
+ position: MapPosition,
1119
1113
  surface?: SurfaceIdentification): boolean
1120
1114
 
1121
1115
  /**
@@ -1123,7 +1117,7 @@ interface LuaControl {
1123
1117
  * @param position - Position of the entity to select
1124
1118
  */
1125
1119
  update_selected_entity(this: void,
1126
- position: Position): void
1120
+ position: MapPosition): void
1127
1121
 
1128
1122
  /**
1129
1123
  * The build distance of this character or max uint when not a character or player connected to a character.
@@ -1281,7 +1275,7 @@ interface LuaControl {
1281
1275
  * ```
1282
1276
  *
1283
1277
  */
1284
- readonly cursor_stack: LuaItemStack
1278
+ readonly cursor_stack?: LuaItemStack
1285
1279
 
1286
1280
  /**
1287
1281
  * `true` if the player is in a vehicle. Writing to this attribute puts the player in or out of a vehicle.
@@ -1331,17 +1325,18 @@ interface LuaControl {
1331
1325
 
1332
1326
  /**
1333
1327
  * The GUI the player currently has open, or `nil` if no GUI is open. Writing to it fires the {@link on_gui_opened | on_gui_opened} event.
1328
+ *
1334
1329
  * This is the GUI that will asked to close (by firing the {@link on_gui_closed | on_gui_closed} event) when the `Esc` or `E` keys are pressed. If this attribute is not `nil`, and a new GUI is written to it, the existing one will be asked to close.
1335
1330
  * @remarks
1336
1331
  * Write supports any of the types. Read will return the `entity`, `equipment`, `equipment-grid`, `player`, `element` or `nil`.
1337
1332
  *
1338
1333
  */
1339
- opened: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
1334
+ opened?: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
1340
1335
 
1341
1336
  /**
1342
1337
  * Returns the {@link defines.gui_type | defines.gui_type} or `nil`.
1343
1338
  */
1344
- readonly opened_gui_type: defines.gui_type
1339
+ readonly opened_gui_type?: defines.gui_type
1345
1340
 
1346
1341
  /**
1347
1342
  * Current item-picking state.
@@ -1351,7 +1346,7 @@ interface LuaControl {
1351
1346
  /**
1352
1347
  * Current position of the entity.
1353
1348
  */
1354
- readonly position: Position
1349
+ readonly position: MapPosition
1355
1350
 
1356
1351
  /**
1357
1352
  * The reach distance of this character or max uint when not a character or player connected to a character.
@@ -1544,7 +1539,7 @@ interface LuaCustomInputPrototype {
1544
1539
  /**
1545
1540
  * The item that gets spawned when this custom input is fired or `nil`.
1546
1541
  */
1547
- readonly item_to_spawn: LuaItemPrototype
1542
+ readonly item_to_spawn?: LuaItemPrototype
1548
1543
 
1549
1544
  /**
1550
1545
  * The default key sequence for this custom input.
@@ -1554,7 +1549,7 @@ interface LuaCustomInputPrototype {
1554
1549
  /**
1555
1550
  * The linked game control name or `nil`.
1556
1551
  */
1557
- readonly linked_game_control: string
1552
+ readonly linked_game_control?: string
1558
1553
 
1559
1554
  readonly localised_description: LocalisedString
1560
1555
 
@@ -1584,6 +1579,7 @@ interface LuaCustomInputPrototype {
1584
1579
 
1585
1580
  /**
1586
1581
  * Lazily evaluated table. For performance reasons, we sometimes return a custom table-like type instead of a native Lua table. This custom type lazily constructs the necessary Lua wrappers of the corresponding C++ objects, therefore preventing their unnecessary construction in some cases.
1582
+ *
1587
1583
  * There are some notable consequences to the usage of a custom table type rather than the native Lua table type: Iterating a custom table is only possible using the `pairs` Lua function; `ipairs` won't work. Another key difference is that custom tables cannot be serialised into a game save file -- if saving the game would require serialisation of a custom table, an error will be displayed and the game will not be saved.
1588
1584
  * @example
1589
1585
  * In previous versions of Factorio, this would create a [LuaPlayer](LuaPlayer) instance for every player in the game, even though only one such wrapper is needed. In the current version, accessing [game.players](LuaGameScript::players) by itself does not create any [LuaPlayer](LuaPlayer) instances; they are created lazily when accessed. Therefore, this example only constructs one [LuaPlayer](LuaPlayer) instance, no matter how many elements there are in `game.players`.
@@ -1801,6 +1797,7 @@ interface LuaElectricEnergySourcePrototype {
1801
1797
 
1802
1798
  /**
1803
1799
  * 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 | LuaTile}).
1800
+ *
1804
1801
  * Most functions on LuaEntity also work when the entity is contained in a ghost.
1805
1802
  */
1806
1803
  interface LuaEntity extends LuaControl {
@@ -1812,7 +1809,7 @@ interface LuaEntity extends LuaControl {
1812
1809
  * @param position - The position the spidertron should move to.
1813
1810
  */
1814
1811
  add_autopilot_destination(this: void,
1815
- position: Position): void
1812
+ position: MapPosition): void
1816
1813
 
1817
1814
  /**
1818
1815
  * Offer a thing on the market.
@@ -1846,7 +1843,7 @@ interface LuaEntity extends LuaControl {
1846
1843
  */
1847
1844
  can_shoot(this: void,
1848
1845
  target: LuaEntity,
1849
- position: Position): boolean
1846
+ position: MapPosition): boolean
1850
1847
 
1851
1848
  /**
1852
1849
  * Can wires reach between these entities.
@@ -1908,7 +1905,7 @@ interface LuaEntity extends LuaControl {
1908
1905
  */
1909
1906
  clone(this: void,
1910
1907
  table: {
1911
- position: Position,
1908
+ position: MapPosition,
1912
1909
  surface?: LuaSurface,
1913
1910
  force?: ForceIdentification,
1914
1911
  create_build_effect_smoke?: boolean
@@ -1916,6 +1913,7 @@ interface LuaEntity extends LuaControl {
1916
1913
 
1917
1914
  /**
1918
1915
  * Connects current linked belt with another one.
1916
+ *
1919
1917
  * Neighbours have to be of different type. If given linked belt is connected to something else it will be disconnected first. If provided neighbour is connected to something else it will also be disconnected first. Automatically updates neighbour to be connected back to this one.
1920
1918
  * @remarks
1921
1919
  * Can also be used on entity ghost if it contains linked-belt
@@ -1928,6 +1926,7 @@ interface LuaEntity extends LuaControl {
1928
1926
 
1929
1927
  /**
1930
1928
  * Connect two devices with a circuit wire or copper cable. Depending on which type of connection should be made, there are different procedures:
1929
+ *
1931
1930
  * - To connect two electric poles, `target` must be a {@link LuaEntity | LuaEntity} that specifies another electric pole. This will connect them with copper cable.
1932
1931
  * - To connect two devices with circuit wire, `target` must be a table of type {@link WireConnectionDefinition | WireConnectionDefinition}.
1933
1932
  * @param target - The target with which to establish a connection.
@@ -1999,6 +1998,7 @@ interface LuaEntity extends LuaControl {
1999
1998
 
2000
1999
  /**
2001
2000
  * Immediately kills the entity. Does nothing if the entity doesn't have health.
2001
+ *
2002
2002
  * Unlike {@link LuaEntity::destroy | LuaEntity::destroy}, `die` will trigger the {@link on_entity_died | on_entity_died} event and the entity will produce a corpse and drop loot if it has any.
2003
2003
  * @remarks
2004
2004
  * If `force` is not specified, `on_entity_died` will blame the `"neutral"` force.
@@ -2028,6 +2028,7 @@ interface LuaEntity extends LuaControl {
2028
2028
 
2029
2029
  /**
2030
2030
  * Disconnect circuit wires or copper cables between devices. Depending on which type of connection should be cut, there are different procedures:
2031
+ *
2031
2032
  * - To remove all copper cables, leave the `target` parameter blank: `pole.disconnect_neighbour()`.
2032
2033
  * - To remove all wires of a specific color, set `target` to {@link defines.wire_type.red | defines.wire_type.red} or {@link defines.wire_type.green | defines.wire_type.green}.
2033
2034
  * - To remove a specific copper cable between two electric poles, `target` must be a {@link LuaEntity | LuaEntity} that specifies the other pole: `pole1.disconnect_neighbour(pole2)`.
@@ -2327,6 +2328,14 @@ interface LuaEntity extends LuaControl {
2327
2328
  get_request_slot(this: void,
2328
2329
  slot: number): SimpleItemStack
2329
2330
 
2331
+ /**
2332
+ * Gets legs of given SpiderVehicle.
2333
+ * @remarks
2334
+ * Applies to subclasses: SpiderVehicle
2335
+ *
2336
+ */
2337
+ get_spider_legs(this: void): LuaEntity[]
2338
+
2330
2339
  /**
2331
2340
  * The train currently stopped at this train stop or `nil` if none.
2332
2341
  * @remarks
@@ -2459,7 +2468,7 @@ interface LuaEntity extends LuaControl {
2459
2468
  is_registered_for_construction(this: void): boolean
2460
2469
 
2461
2470
  /**
2462
- * Is this entity registered for deconstruction with this force? If false, it means a construction robot has been dispatched to deconstruct it, or it is not marked for deconstruction. This is worst-case O(N) complexity where N is the current number of things in the deconstruct queue.
2471
+ * Is this entity registered for deconstruction with this force? If false, it means a construction robot has been dispatched to deconstruct it, or it is not marked for deconstruction. The complexity is effectively O(1) - it depends on the number of objects targeting this entity which should be small enough.
2463
2472
  * @param force - The force construction manager to check.
2464
2473
  */
2465
2474
  is_registered_for_deconstruction(this: void,
@@ -2864,7 +2873,7 @@ interface LuaEntity extends LuaControl {
2864
2873
  * Applies to subclasses: Character
2865
2874
  *
2866
2875
  */
2867
- associated_player: LuaPlayer
2876
+ associated_player?: LuaPlayer
2868
2877
 
2869
2878
  /**
2870
2879
  * Whether this rocket silo automatically launches the rocket when cargo is inserted.
@@ -2880,7 +2889,7 @@ interface LuaEntity extends LuaControl {
2880
2889
  * Applies to subclasses: SpiderVehicle
2881
2890
  *
2882
2891
  */
2883
- autopilot_destination: Position
2892
+ autopilot_destination?: MapPosition
2884
2893
 
2885
2894
  /**
2886
2895
  * The queued destination positions of spidertron's autopilot.
@@ -2888,7 +2897,7 @@ interface LuaEntity extends LuaControl {
2888
2897
  * Applies to subclasses: SpiderVehicle
2889
2898
  *
2890
2899
  */
2891
- readonly autopilot_destinations: Position[]
2900
+ readonly autopilot_destinations: MapPosition[]
2892
2901
 
2893
2902
  /**
2894
2903
  * The backer name assigned to this entity, or `nil` if this entity doesn't support backer names. Entities that support backer names are labs, locomotives, radars, roboports, and train stops.
@@ -2896,7 +2905,7 @@ interface LuaEntity extends LuaControl {
2896
2905
  * While train stops get the name of a backer when placed down, players can rename them if they want to. In this case, `backer_name` returns the player-given name of the entity.
2897
2906
  *
2898
2907
  */
2899
- backer_name: string
2908
+ backer_name?: string
2900
2909
 
2901
2910
  /**
2902
2911
  * 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 | LuaEntity::neighbours} for that. This is a dictionary with `"inputs"`, `"outputs"` entries that are arrays of transport belt connectable entities, or empty tables if no entities.
@@ -2917,7 +2926,7 @@ interface LuaEntity extends LuaControl {
2917
2926
  /**
2918
2927
  * The bonus mining progress for this mining drill or `nil` if this isn't a mining drill. Read yields a number in range [0, mining_target.prototype.mineable_properties.mining_time]
2919
2928
  */
2920
- bonus_mining_progress: number
2929
+ bonus_mining_progress?: number
2921
2930
 
2922
2931
  /**
2923
2932
  * The current productivity bonus progress, as a number in range [0, 1].
@@ -2935,7 +2944,7 @@ interface LuaEntity extends LuaControl {
2935
2944
  /**
2936
2945
  * The burner energy source for this entity or `nil` if there isn't one.
2937
2946
  */
2938
- readonly burner: LuaBurner
2947
+ readonly burner?: LuaBurner
2939
2948
 
2940
2949
  /**
2941
2950
  * The state of this chain signal.
@@ -2991,7 +3000,7 @@ interface LuaEntity extends LuaControl {
2991
3000
  * Car color is overridden by the color of the current driver/passenger, if there is one.
2992
3001
  *
2993
3002
  */
2994
- color: Color
3003
+ color?: Color
2995
3004
 
2996
3005
  /**
2997
3006
  * The owner of this combat robot if any.
@@ -3004,7 +3013,7 @@ interface LuaEntity extends LuaControl {
3004
3013
  * Applies to subclasses: Unit
3005
3014
  *
3006
3015
  */
3007
- readonly command: Command
3016
+ readonly command?: Command
3008
3017
 
3009
3018
  /**
3010
3019
  * The rail entity this train stop is connected to or `nil` if there is none.
@@ -3012,7 +3021,7 @@ interface LuaEntity extends LuaControl {
3012
3021
  * Applies to subclasses: TrainStop
3013
3022
  *
3014
3023
  */
3015
- readonly connected_rail: LuaEntity
3024
+ readonly connected_rail?: LuaEntity
3016
3025
 
3017
3026
  /**
3018
3027
  * Rail direction to which this train stop is binding. This returns a value even when no rails are present.
@@ -3095,7 +3104,7 @@ interface LuaEntity extends LuaControl {
3095
3104
  * Applies to subclasses: Unit
3096
3105
  *
3097
3106
  */
3098
- readonly distraction_command: Command
3107
+ readonly distraction_command?: Command
3099
3108
 
3100
3109
  /**
3101
3110
  * Whether the driver of this car or spidertron is the gunner, if false, the passenger is the gunner.
@@ -3116,7 +3125,7 @@ interface LuaEntity extends LuaControl {
3116
3125
  * Meaningful only for entities that put items somewhere, such as mining drills or inserters. Returns `nil` for any other entity.
3117
3126
  *
3118
3127
  */
3119
- drop_target: LuaEntity
3128
+ drop_target?: LuaEntity
3120
3129
 
3121
3130
  /**
3122
3131
  * The current speed of this unit in tiles per tick, taking into account any walking speed modifier given by the tile the unit is standing on.
@@ -3137,7 +3146,7 @@ interface LuaEntity extends LuaControl {
3137
3146
  /**
3138
3147
  * The effects being applied to this entity or `nil`. For beacons this is the effect the beacon is broadcasting.
3139
3148
  */
3140
- readonly effects: ModuleEffects
3149
+ readonly effects?: ModuleEffects
3141
3150
 
3142
3151
  /**
3143
3152
  * The buffer size for the electric energy source or nil if the entity doesn't have an electric energy source.
@@ -3165,7 +3174,7 @@ interface LuaEntity extends LuaControl {
3165
3174
  /**
3166
3175
  * Returns the id of the electric network that this entity is connected to or `nil`.
3167
3176
  */
3168
- readonly electric_network_id: number
3177
+ readonly electric_network_id?: number
3169
3178
 
3170
3179
  /**
3171
3180
  * The electric network statistics for this electric pole.
@@ -3213,7 +3222,7 @@ interface LuaEntity extends LuaControl {
3213
3222
  * only usable on entities that have labels (currently only spider-vehicles).
3214
3223
  *
3215
3224
  */
3216
- entity_label: string
3225
+ entity_label?: string
3217
3226
 
3218
3227
  /**
3219
3228
  * The number of filter slots this inserter, loader, or logistic storage container has. 0 if not one of those entities.
@@ -3305,12 +3314,12 @@ interface LuaEntity extends LuaControl {
3305
3314
  /**
3306
3315
  * The graphics variation for this entity or `nil` if this entity doesn't use graphics variations.
3307
3316
  */
3308
- graphics_variation: number
3317
+ graphics_variation?: number
3309
3318
 
3310
3319
  /**
3311
3320
  * The equipment grid or `nil` if this entity doesn't have an equipment grid.
3312
3321
  */
3313
- readonly grid: LuaEquipmentGrid
3322
+ readonly grid?: LuaEquipmentGrid
3314
3323
 
3315
3324
  /**
3316
3325
  * The current health of the entity, or `nil` if it doesn't have health. Health is automatically clamped to be between `0` and max health (inclusive). Entities with a health of `0` can not be attacked.
@@ -3318,7 +3327,7 @@ interface LuaEntity extends LuaControl {
3318
3327
  * To get the maximum possible health of this entity, see {@link LuaEntityPrototype::max_health | LuaEntityPrototype::max_health} on its prototype.
3319
3328
  *
3320
3329
  */
3321
- health: number
3330
+ health?: number
3322
3331
 
3323
3332
  /**
3324
3333
  * The item stack currently held in an inserter's hand.
@@ -3375,7 +3384,7 @@ interface LuaEntity extends LuaControl {
3375
3384
  * Applies to subclasses: Inserter
3376
3385
  *
3377
3386
  */
3378
- inserter_filter_mode: string
3387
+ inserter_filter_mode?: string
3379
3388
 
3380
3389
  /**
3381
3390
  * Sets the stack size limit on this inserter. If the stack size is > than the force stack size limit the value is ignored.
@@ -3386,7 +3395,7 @@ interface LuaEntity extends LuaControl {
3386
3395
  inserter_stack_size_override: number
3387
3396
 
3388
3397
  /**
3389
- * If this entity is EntityWithForce
3398
+ * (deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
3390
3399
  */
3391
3400
  readonly is_entity_with_force: boolean
3392
3401
 
@@ -3400,6 +3409,11 @@ interface LuaEntity extends LuaControl {
3400
3409
  */
3401
3410
  readonly is_entity_with_owner: boolean
3402
3411
 
3412
+ /**
3413
+ * If this entity is a MilitaryTarget. Can be written to if LuaEntityPrototype::allow_run_time_change_of_is_military_target returns true
3414
+ */
3415
+ is_military_target: boolean
3416
+
3403
3417
  /**
3404
3418
  * Items this ghost will request when revived or items this item request proxy is requesting. Result is a dictionary mapping each item prototype name to the required count.
3405
3419
  */
@@ -3490,7 +3504,7 @@ interface LuaEntity extends LuaControl {
3490
3504
  /**
3491
3505
  * The mining progress for this mining drill or `nil` if this isn't a mining drill. Is a number in range [0, mining_target.prototype.mineable_properties.mining_time]
3492
3506
  */
3493
- mining_progress: number
3507
+ mining_progress?: number
3494
3508
 
3495
3509
  /**
3496
3510
  * The mining target or `nil` if none
@@ -3498,7 +3512,7 @@ interface LuaEntity extends LuaControl {
3498
3512
  * Applies to subclasses: MiningDrill
3499
3513
  *
3500
3514
  */
3501
- readonly mining_target: LuaEntity
3515
+ readonly mining_target?: LuaEntity
3502
3516
 
3503
3517
  /**
3504
3518
  * Returns true if this unit is moving.
@@ -3526,8 +3540,9 @@ interface LuaEntity extends LuaControl {
3526
3540
  * - When called on a pipe-connectable entity, this is an array of entity arrays of all entities a given fluidbox is connected to.
3527
3541
  * - When called on an underground transport belt, this is the other end of the underground belt connection, or `nil` if none.
3528
3542
  * - When called on a wall-connectable entity or reactor, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
3543
+ * - When called on a cliff entity, this is a dictionary of all connections indexed by the connection direction "north", "south", "east", and "west".
3529
3544
  */
3530
- readonly neighbours: {[key: string]: LuaEntity[]} | Array<LuaEntity[]> | LuaEntity
3545
+ readonly neighbours?: {[key: string]: LuaEntity[]} | Array<LuaEntity[]> | LuaEntity
3531
3546
 
3532
3547
  /**
3533
3548
  * 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.
@@ -3566,7 +3581,7 @@ interface LuaEntity extends LuaControl {
3566
3581
  * Applies to subclasses: Inserter
3567
3582
  *
3568
3583
  */
3569
- pickup_target: LuaEntity
3584
+ pickup_target?: LuaEntity
3570
3585
 
3571
3586
  /**
3572
3587
  * The player connected to this character or `nil` if none.
@@ -3574,7 +3589,7 @@ interface LuaEntity extends LuaControl {
3574
3589
  * Applies to subclasses: Character
3575
3590
  *
3576
3591
  */
3577
- readonly player: LuaPlayer
3592
+ readonly player?: LuaPlayer
3578
3593
 
3579
3594
  /**
3580
3595
  * The pollution bonus of this entity.
@@ -3634,7 +3649,7 @@ interface LuaEntity extends LuaControl {
3634
3649
  /**
3635
3650
  * The target entity for this item-request-proxy or `nil`
3636
3651
  */
3637
- readonly proxy_target: LuaEntity
3652
+ readonly proxy_target?: LuaEntity
3638
3653
 
3639
3654
  /**
3640
3655
  * The rail target of this pump or `nil`.
@@ -3642,7 +3657,7 @@ interface LuaEntity extends LuaControl {
3642
3657
  * Applies to subclasses: Pump
3643
3658
  *
3644
3659
  */
3645
- readonly pump_rail_target: LuaEntity
3660
+ readonly pump_rail_target?: LuaEntity
3646
3661
 
3647
3662
  /**
3648
3663
  * When locked; the recipe in this assembling machine can't be changed by the player.
@@ -3658,7 +3673,7 @@ interface LuaEntity extends LuaControl {
3658
3673
  * Writing does nothing if the vehicle doesn't have a turret.
3659
3674
  *
3660
3675
  */
3661
- relative_turret_orientation: RealOrientation
3676
+ relative_turret_orientation?: RealOrientation
3662
3677
 
3663
3678
  /**
3664
3679
  * If items not included in this infinity container filters should be removed from the container.
@@ -3713,12 +3728,12 @@ interface LuaEntity extends LuaControl {
3713
3728
  /**
3714
3729
  * The secondary bounding box of this entity or `nil` if it doesn't have one.
3715
3730
  */
3716
- readonly secondary_bounding_box: BoundingBox
3731
+ readonly secondary_bounding_box?: BoundingBox
3717
3732
 
3718
3733
  /**
3719
3734
  * The secondary selection box of this entity or `nil` if it doesn't have one.
3720
3735
  */
3721
- readonly secondary_selection_box: BoundingBox
3736
+ readonly secondary_selection_box?: BoundingBox
3722
3737
 
3723
3738
  /**
3724
3739
  * Index of the currently selected weapon slot of this character, car, or spidertron, or `nil` if the car/spidertron doesn't have guns.
@@ -3726,7 +3741,7 @@ interface LuaEntity extends LuaControl {
3726
3741
  * Applies to subclasses: Character,Car
3727
3742
  *
3728
3743
  */
3729
- selected_gun_index: number
3744
+ selected_gun_index?: number
3730
3745
 
3731
3746
  /**
3732
3747
  * {@link LuaEntityPrototype::selection_box | LuaEntityPrototype::selection_box} around entity's given position and respecting the current entity orientation.
@@ -3736,7 +3751,7 @@ interface LuaEntity extends LuaControl {
3736
3751
  /**
3737
3752
  * The shooting target for this turret or `nil`.
3738
3753
  */
3739
- shooting_target: LuaEntity
3754
+ shooting_target?: LuaEntity
3740
3755
 
3741
3756
  /**
3742
3757
  * The state of this rail signal.
@@ -3749,7 +3764,7 @@ interface LuaEntity extends LuaControl {
3749
3764
  /**
3750
3765
  * The spawner associated with this unit entity or `nil` if the unit has no associated spawner.
3751
3766
  */
3752
- readonly spawner: LuaEntity
3767
+ readonly spawner?: LuaEntity
3753
3768
 
3754
3769
  /**
3755
3770
  * The current speed of this car in tiles per tick, rolling stock, projectile or spider vehicle, or current max speed of the unit. Only the speed of units, cars, and projectiles are writable.
@@ -3770,7 +3785,7 @@ interface LuaEntity extends LuaControl {
3770
3785
  * Applies to subclasses: Splitter
3771
3786
  *
3772
3787
  */
3773
- splitter_filter: LuaItemPrototype
3788
+ splitter_filter?: LuaItemPrototype
3774
3789
 
3775
3790
  /**
3776
3791
  * The input priority for this splitter : "left", "none", or "right".
@@ -3798,7 +3813,7 @@ interface LuaEntity extends LuaControl {
3798
3813
  /**
3799
3814
  * The status of this entity or `nil` if no status.
3800
3815
  */
3801
- readonly status: defines.entity_status
3816
+ readonly status?: defines.entity_status
3802
3817
 
3803
3818
  /**
3804
3819
  * The entity this sticker is sticked to.
@@ -3808,7 +3823,7 @@ interface LuaEntity extends LuaControl {
3808
3823
  /**
3809
3824
  * The sticker entities attached to this entity or `nil` if none.
3810
3825
  */
3811
- readonly stickers: LuaEntity[]
3826
+ readonly stickers?: LuaEntity[]
3812
3827
 
3813
3828
  /**
3814
3829
  * The storage filter for this logistic storage container.
@@ -3823,12 +3838,12 @@ interface LuaEntity extends LuaControl {
3823
3838
  /**
3824
3839
  * The tags associated with this entity ghost or `nil` if not an entity ghost.
3825
3840
  */
3826
- tags: Tags
3841
+ tags?: Tags
3827
3842
 
3828
3843
  /**
3829
3844
  * The temperature of this entities heat energy source if this entity uses a heat energy source or `nil`.
3830
3845
  */
3831
- temperature: number
3846
+ temperature?: number
3832
3847
 
3833
3848
  /**
3834
3849
  * The text of this flying-text entity.
@@ -3856,6 +3871,7 @@ interface LuaEntity extends LuaControl {
3856
3871
 
3857
3872
  /**
3858
3873
  * The ticks left before a ghost, combat robot, highlight box or smoke with trigger is destroyed.
3874
+ *
3859
3875
  * - for ghosts set to uint32 max (4,294,967,295) to never expire.
3860
3876
  * - for ghosts Cannot be set higher than {@link LuaForce::ghost_time_to_live | LuaForce::ghost_time_to_live} of the entity's force.
3861
3877
  */
@@ -3966,7 +3982,7 @@ interface LuaEntity extends LuaControl {
3966
3982
  * Applies to subclasses: Unit
3967
3983
  *
3968
3984
  */
3969
- readonly unit_group: LuaUnitGroup
3985
+ readonly unit_group?: LuaUnitGroup
3970
3986
 
3971
3987
  /**
3972
3988
  * The unit number or nil if the entity doesn't have one. This is universally unique for every entity that has one, for the lifetime of a whole game.
@@ -4048,12 +4064,12 @@ interface LuaEntityPrototype {
4048
4064
  /**
4049
4065
  * Whether this unit prototype is affected by tile walking speed modifiers or `nil`.
4050
4066
  */
4051
- readonly affected_by_tiles: boolean
4067
+ readonly affected_by_tiles?: boolean
4052
4068
 
4053
4069
  /**
4054
4070
  * The air resistance of this rolling stock prototype or `nil` if not a rolling stock prototype.
4055
4071
  */
4056
- readonly air_resistance: number
4072
+ readonly air_resistance?: number
4057
4073
 
4058
4074
  /**
4059
4075
  * The alert icon shift of this entity prototype.
@@ -4063,12 +4079,12 @@ interface LuaEntityPrototype {
4063
4079
  /**
4064
4080
  * Does this turret prototype alert when attacking? or `nil` if not turret prototype.
4065
4081
  */
4066
- readonly alert_when_attacking: boolean
4082
+ readonly alert_when_attacking?: boolean
4067
4083
 
4068
4084
  /**
4069
4085
  * Does this entity with health prototype alert when damaged? or `nil` if not entity with health prototype.
4070
4086
  */
4071
- readonly alert_when_damaged: boolean
4087
+ readonly alert_when_damaged?: boolean
4072
4088
 
4073
4089
  /**
4074
4090
  * If this market allows access to all forces or just friendly ones.
@@ -4095,20 +4111,28 @@ interface LuaEntityPrototype {
4095
4111
  */
4096
4112
  readonly allow_passengers: boolean
4097
4113
 
4114
+ /**
4115
+ * True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)
4116
+ * @remarks
4117
+ * Applies to subclasses: EntityWithOwnerPrototype
4118
+ *
4119
+ */
4120
+ readonly allow_run_time_change_of_is_military_target: boolean
4121
+
4098
4122
  /**
4099
4123
  * The allowed module effects for this entity or `nil`.
4100
4124
  */
4101
- readonly allowed_effects: {[key: string]: boolean}
4125
+ readonly allowed_effects?: {[key: string]: boolean}
4102
4126
 
4103
4127
  /**
4104
4128
  * Whether the lamp is always on (except when out of power or turned off by the circuit network) or `nil`.
4105
4129
  */
4106
- readonly always_on: boolean
4130
+ readonly always_on?: boolean
4107
4131
 
4108
4132
  /**
4109
4133
  * The attack parameters for this entity or `nil` if the entity doesn't use attack parameters.
4110
4134
  */
4111
- readonly attack_parameters: AttackParameters
4135
+ readonly attack_parameters?: AttackParameters
4112
4136
 
4113
4137
  /**
4114
4138
  * The attack result of this entity if the entity has one, else `nil`.
@@ -4118,7 +4142,7 @@ interface LuaEntityPrototype {
4118
4142
  /**
4119
4143
  * The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret or `nil`.
4120
4144
  */
4121
- readonly automated_ammo_count: number
4145
+ readonly automated_ammo_count?: number
4122
4146
 
4123
4147
  /**
4124
4148
  * Autoplace specification for this entity prototype. `nil` if none.
@@ -4128,7 +4152,7 @@ interface LuaEntityPrototype {
4128
4152
  /**
4129
4153
  * The base productivity of this crafting machine, lab, or mining drill, or `nil`.
4130
4154
  */
4131
- readonly base_productivity: number
4155
+ readonly base_productivity?: number
4132
4156
 
4133
4157
  /**
4134
4158
  * @remarks
@@ -4147,12 +4171,12 @@ interface LuaEntityPrototype {
4147
4171
  /**
4148
4172
  * The speed of this transport belt or `nil` if this isn't a transport belt related prototype.
4149
4173
  */
4150
- readonly belt_speed: number
4174
+ readonly belt_speed?: number
4151
4175
 
4152
4176
  /**
4153
4177
  * The braking force of this vehicle prototype or `nil` if not a vehicle prototype.
4154
4178
  */
4155
- readonly braking_force: number
4179
+ readonly braking_force?: number
4156
4180
 
4157
4181
  /**
4158
4182
  * The evolution requirement to build this entity as a base when expanding enemy bases.
@@ -4174,14 +4198,14 @@ interface LuaEntityPrototype {
4174
4198
  /**
4175
4199
  * The burner energy source prototype this entity uses or `nil`.
4176
4200
  */
4177
- readonly burner_prototype: LuaBurnerPrototype
4201
+ readonly burner_prototype?: LuaBurnerPrototype
4178
4202
 
4179
4203
  readonly call_for_help_radius: number
4180
4204
 
4181
4205
  /**
4182
4206
  * Whether this unit prototype can open gates or `nil`.
4183
4207
  */
4184
- readonly can_open_gates: boolean
4208
+ readonly can_open_gates?: boolean
4185
4209
 
4186
4210
  /**
4187
4211
  * The collision mask used only for collision test with tile directly at offshore pump position.
@@ -4201,7 +4225,7 @@ interface LuaEntityPrototype {
4201
4225
  /**
4202
4226
  * The item prototype name used to destroy this cliff or `nil`.
4203
4227
  */
4204
- readonly cliff_explosive_prototype: string
4228
+ readonly cliff_explosive_prototype?: string
4205
4229
 
4206
4230
  /**
4207
4231
  * The bounding box used for collision checking.
@@ -4233,17 +4257,17 @@ interface LuaEntityPrototype {
4233
4257
  /**
4234
4258
  * The color of the prototype, or `nil` if the prototype doesn't have color.
4235
4259
  */
4236
- readonly color: Color
4260
+ readonly color?: Color
4237
4261
 
4238
4262
  /**
4239
4263
  * The construction radius for this roboport prototype or `nil`.
4240
4264
  */
4241
- readonly construction_radius: number
4265
+ readonly construction_radius?: number
4242
4266
 
4243
4267
  /**
4244
4268
  * The energy consumption of this car prototype or `nil` if not a car prototype.
4245
4269
  */
4246
- readonly consumption: number
4270
+ readonly consumption?: number
4247
4271
 
4248
4272
  /**
4249
4273
  * @remarks
@@ -4273,7 +4297,7 @@ interface LuaEntityPrototype {
4273
4297
  /**
4274
4298
  * The crafting speed of this crafting-machine or `nil`.
4275
4299
  */
4276
- readonly crafting_speed: number
4300
+ readonly crafting_speed?: number
4277
4301
 
4278
4302
  /**
4279
4303
  * If this prototype will attempt to create a ghost of itself on death.
@@ -4286,12 +4310,12 @@ interface LuaEntityPrototype {
4286
4310
  /**
4287
4311
  * The trigger run when this entity is created or `nil`.
4288
4312
  */
4289
- readonly created_effect: TriggerItem[]
4313
+ readonly created_effect?: TriggerItem[]
4290
4314
 
4291
4315
  /**
4292
4316
  * The smoke trigger run when this entity is built or `nil`.
4293
4317
  */
4294
- readonly created_smoke: { initial_height: number, max_radius?: number, offset_deviation: BoundingBox, offsets: Vector[], smoke_name: string, speed: Vector, speed_from_center: number, speed_from_center_deviation: number, speed_multiplier: number, speed_multiplier_deviation: number, starting_frame: number, starting_frame_deviation: number, starting_frame_speed: number, starting_frame_speed_deviation: number }
4318
+ readonly created_smoke?: { initial_height: number, max_radius?: number, offset_deviation: BoundingBox, offsets: Vector[], smoke_name: string, speed: Vector, speed_from_center: number, speed_from_center_deviation: number, speed_multiplier: number, speed_multiplier_deviation: number, starting_frame: number, starting_frame_deviation: number, starting_frame_speed: number, starting_frame_speed_deviation: number }
4295
4319
 
4296
4320
  /**
4297
4321
  * @remarks
@@ -4303,12 +4327,12 @@ interface LuaEntityPrototype {
4303
4327
  /**
4304
4328
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are off or `nil`.
4305
4329
  */
4306
- readonly darkness_for_all_lamps_off: number
4330
+ readonly darkness_for_all_lamps_off?: number
4307
4331
 
4308
4332
  /**
4309
4333
  * Value between 0 and 1 darkness where all lamps of this lamp prototype are on or `nil`.
4310
4334
  */
4311
- readonly darkness_for_all_lamps_on: number
4335
+ readonly darkness_for_all_lamps_on?: number
4312
4336
 
4313
4337
  /**
4314
4338
  * The hardcoded default collision mask (with flags) for this entity prototype type.
@@ -4318,22 +4342,22 @@ interface LuaEntityPrototype {
4318
4342
  /**
4319
4343
  * The distraction cooldown of this unit prototype or `nil`.
4320
4344
  */
4321
- readonly distraction_cooldown: number
4345
+ readonly distraction_cooldown?: number
4322
4346
 
4323
4347
  /**
4324
4348
  * The distribution effectivity for this beacon prototype or `nil` if not a beacon prototype.
4325
4349
  */
4326
- readonly distribution_effectivity: number
4350
+ readonly distribution_effectivity?: number
4327
4351
 
4328
4352
  /**
4329
4353
  * The door opening speed for this rocket silo prototype or `nil`.
4330
4354
  */
4331
- readonly door_opening_speed: number
4355
+ readonly door_opening_speed?: number
4332
4356
 
4333
4357
  /**
4334
4358
  * Whether this logistics or construction robot renders its cargo when flying or `nil`.
4335
4359
  */
4336
- readonly draw_cargo: boolean
4360
+ readonly draw_cargo?: boolean
4337
4361
 
4338
4362
  /**
4339
4363
  * The bounding box used for drawing the entity icon.
@@ -4350,12 +4374,12 @@ interface LuaEntityPrototype {
4350
4374
  /**
4351
4375
  * The effectivity of this car prototype, generator prototype or `nil`.
4352
4376
  */
4353
- readonly effectivity: number
4377
+ readonly effectivity?: number
4354
4378
 
4355
4379
  /**
4356
4380
  * The electric energy source prototype this entity uses or `nil`.
4357
4381
  */
4358
- readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype
4382
+ readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
4359
4383
 
4360
4384
  /**
4361
4385
  * Amount of pollution emissions per second this entity will create.
@@ -4370,27 +4394,27 @@ interface LuaEntityPrototype {
4370
4394
  /**
4371
4395
  * The energy used per hitpoint taken for this vehicle during collisions or `nil`.
4372
4396
  */
4373
- readonly energy_per_hit_point: number
4397
+ readonly energy_per_hit_point?: number
4374
4398
 
4375
4399
  /**
4376
4400
  * The energy consumed per tile moved for this flying robot or `nil`.
4377
4401
  */
4378
- readonly energy_per_move: number
4402
+ readonly energy_per_move?: number
4379
4403
 
4380
4404
  /**
4381
4405
  * The energy consumed per tick for this flying robot or `nil`.
4382
4406
  */
4383
- readonly energy_per_tick: number
4407
+ readonly energy_per_tick?: number
4384
4408
 
4385
4409
  /**
4386
4410
  * The direct energy usage of this entity or `nil` if this entity doesn't have a direct energy usage.
4387
4411
  */
4388
- readonly energy_usage: number
4412
+ readonly energy_usage?: number
4389
4413
 
4390
4414
  /**
4391
4415
  * The engine starting speed for this rocket silo rocket prototype or `nil`.
4392
4416
  */
4393
- readonly engine_starting_speed: number
4417
+ readonly engine_starting_speed?: number
4394
4418
 
4395
4419
  /**
4396
4420
  * @remarks
@@ -4402,12 +4426,12 @@ interface LuaEntityPrototype {
4402
4426
  /**
4403
4427
  * Does this explosion have a beam or `nil` if not an explosion prototype.
4404
4428
  */
4405
- readonly explosion_beam: number
4429
+ readonly explosion_beam?: number
4406
4430
 
4407
4431
  /**
4408
4432
  * Does this explosion rotate or `nil` if not an explosion prototype.
4409
4433
  */
4410
- readonly explosion_rotate: number
4434
+ readonly explosion_rotate?: number
4411
4435
 
4412
4436
  /**
4413
4437
  * The group of mutually fast-replaceable entities. Possibly `nil`.
@@ -4417,7 +4441,7 @@ interface LuaEntityPrototype {
4417
4441
  /**
4418
4442
  * The filter count of this inserter, loader, or logistic chest or `nil`. For logistic containers, `nil` means no limit.
4419
4443
  */
4420
- readonly filter_count: number
4444
+ readonly filter_count?: number
4421
4445
 
4422
4446
  /**
4423
4447
  * The final attack result for projectiles `nil` if not a projectile
@@ -4427,7 +4451,7 @@ interface LuaEntityPrototype {
4427
4451
  /**
4428
4452
  * The fixed recipe name for this assembling machine prototype or `nil`.
4429
4453
  */
4430
- readonly fixed_recipe: string
4454
+ readonly fixed_recipe?: string
4431
4455
 
4432
4456
  /**
4433
4457
  * The flags for this entity prototype.
@@ -4437,7 +4461,7 @@ interface LuaEntityPrototype {
4437
4461
  /**
4438
4462
  * The fluid this offshore pump produces or `nil`.
4439
4463
  */
4440
- readonly fluid: LuaFluidPrototype
4464
+ readonly fluid?: LuaFluidPrototype
4441
4465
 
4442
4466
  /**
4443
4467
  * The fluid capacity of this entity or 0 if this entity doesn't support fluids.
@@ -4450,12 +4474,12 @@ interface LuaEntityPrototype {
4450
4474
  /**
4451
4475
  * The fluid energy source prototype this entity uses or `nil`.
4452
4476
  */
4453
- readonly fluid_energy_source_prototype: LuaFluidEnergySourcePrototype
4477
+ readonly fluid_energy_source_prototype?: LuaFluidEnergySourcePrototype
4454
4478
 
4455
4479
  /**
4456
4480
  * The fluid usage of this generator prototype or `nil`.
4457
4481
  */
4458
- readonly fluid_usage_per_tick: number
4482
+ readonly fluid_usage_per_tick?: number
4459
4483
 
4460
4484
  /**
4461
4485
  * The fluidbox prototypes for this entity.
@@ -4465,17 +4489,17 @@ interface LuaEntityPrototype {
4465
4489
  /**
4466
4490
  * The flying acceleration for this rocket silo rocket prototype or `nil`.
4467
4491
  */
4468
- readonly flying_acceleration: number
4492
+ readonly flying_acceleration?: number
4469
4493
 
4470
4494
  /**
4471
4495
  * The flying speed for this rocket silo rocket prototype or `nil`.
4472
4496
  */
4473
- readonly flying_speed: number
4497
+ readonly flying_speed?: number
4474
4498
 
4475
4499
  /**
4476
4500
  * The friction of this vehicle prototype or `nil` if not a vehicle prototype.
4477
4501
  */
4478
- readonly friction_force: number
4502
+ readonly friction_force?: number
4479
4503
 
4480
4504
  /**
4481
4505
  * The friendly map color used when charting this entity.
@@ -4485,7 +4509,7 @@ interface LuaEntityPrototype {
4485
4509
  /**
4486
4510
  * The equipment grid prototype for this entity or `nil`.
4487
4511
  */
4488
- readonly grid_prototype: LuaEquipmentGridPrototype
4512
+ readonly grid_prototype?: LuaEquipmentGridPrototype
4489
4513
 
4490
4514
  /**
4491
4515
  * Group of this entity.
@@ -4495,7 +4519,7 @@ interface LuaEntityPrototype {
4495
4519
  /**
4496
4520
  * The guns this prototype uses or `nil`.
4497
4521
  */
4498
- readonly guns: {[key: string]: LuaItemPrototype}
4522
+ readonly guns?: {[key: string]: LuaItemPrototype}
4499
4523
 
4500
4524
  /**
4501
4525
  * Whether this unit, car, or character prototype has belt immunity, `nil` if not car, unit, or character prototype.
@@ -4510,7 +4534,7 @@ interface LuaEntityPrototype {
4510
4534
  /**
4511
4535
  * The heat energy source prototype this entity uses or `nil`.
4512
4536
  */
4513
- readonly heat_energy_source_prototype: LuaHeatEnergySourcePrototype
4537
+ readonly heat_energy_source_prototype?: LuaHeatEnergySourcePrototype
4514
4538
 
4515
4539
  /**
4516
4540
  * Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. Meaningless if this isn't an infinite type resource.
@@ -4525,40 +4549,58 @@ interface LuaEntityPrototype {
4525
4549
  /**
4526
4550
  * The max number of ingredients this crafting-machine prototype supports or `nil` if this isn't a crafting-machine prototype.
4527
4551
  */
4528
- readonly ingredient_count: number
4552
+ readonly ingredient_count?: number
4529
4553
 
4530
4554
  /**
4531
4555
  * True if this inserter chases items on belts for pickup or `nil`.
4532
4556
  */
4533
- readonly inserter_chases_belt_items: boolean
4557
+ readonly inserter_chases_belt_items?: boolean
4534
4558
 
4535
4559
  /**
4536
4560
  * The drop position for this inserter or `nil`.
4537
4561
  */
4538
- readonly inserter_drop_position: Vector
4562
+ readonly inserter_drop_position?: Vector
4539
4563
 
4540
4564
  /**
4541
4565
  * The extension speed of this inserter or `nil`.
4542
4566
  */
4543
- readonly inserter_extension_speed: number
4567
+ readonly inserter_extension_speed?: number
4544
4568
 
4545
4569
  /**
4546
4570
  * The pickup position for this inserter or `nil`.
4547
4571
  */
4548
- readonly inserter_pickup_position: Vector
4572
+ readonly inserter_pickup_position?: Vector
4549
4573
 
4550
4574
  /**
4551
4575
  * The rotation speed of this inserter or `nil`.
4552
4576
  */
4553
- readonly inserter_rotation_speed: number
4577
+ readonly inserter_rotation_speed?: number
4578
+
4579
+ /**
4580
+ * Gets the built-in stack size bonus of this inserter prototype. `nil` if this is not an inserter.
4581
+ */
4582
+ readonly inserter_stack_size_bonus: number
4554
4583
 
4555
4584
  /**
4556
4585
  * The instruments for this programmable speaker or `nil`.
4557
4586
  */
4558
- readonly instruments: ProgrammableSpeakerInstrument[]
4587
+ readonly instruments?: ProgrammableSpeakerInstrument[]
4559
4588
 
4560
4589
  readonly is_building: boolean
4561
4590
 
4591
+ /**
4592
+ * True if this is entity-with-owner
4593
+ */
4594
+ readonly is_entity_with_owner: boolean
4595
+
4596
+ /**
4597
+ * True if this entity-with-owner is military target
4598
+ * @remarks
4599
+ * Applies to subclasses: EntityWithOwnerPrototype
4600
+ *
4601
+ */
4602
+ readonly is_military_target: boolean
4603
+
4562
4604
  /**
4563
4605
  * @remarks
4564
4606
  * Applies to subclasses: Character
@@ -4569,27 +4611,27 @@ interface LuaEntityPrototype {
4569
4611
  /**
4570
4612
  * The item slot count of this constant combinator prototype or `nil`.
4571
4613
  */
4572
- readonly item_slot_count: number
4614
+ readonly item_slot_count?: number
4573
4615
 
4574
4616
  /**
4575
4617
  * Items that, when placed, will produce this entity. It is an array of items, or `nil` if no items place this entity. Construction bots will always choose the first item in this list to build this entity.
4576
4618
  */
4577
- readonly items_to_place_this: SimpleItemStack[]
4619
+ readonly items_to_place_this?: SimpleItemStack[]
4578
4620
 
4579
4621
  /**
4580
4622
  * The item prototype names that are the inputs of this lab prototype or `nil`.
4581
4623
  */
4582
- readonly lab_inputs: string[]
4624
+ readonly lab_inputs?: string[]
4583
4625
 
4584
4626
  /**
4585
4627
  * The rocket launch delay for this rocket silo prototype or `nil`.
4586
4628
  */
4587
- readonly launch_wait_time: number
4629
+ readonly launch_wait_time?: number
4588
4630
 
4589
4631
  /**
4590
4632
  * The light blinking speed for this rocket silo prototype or `nil`.
4591
4633
  */
4592
- readonly light_blinking_speed: number
4634
+ readonly light_blinking_speed?: number
4593
4635
 
4594
4636
  readonly localised_description: LocalisedString
4595
4637
 
@@ -4598,12 +4640,12 @@ interface LuaEntityPrototype {
4598
4640
  /**
4599
4641
  * The logistic mode of this logistic container or `nil` if this isn't a logistic container prototype. One of `"requester"`, `"active-provider"`, `"passive-provider"`, `"buffer"`, `"storage"`, `"none"`.
4600
4642
  */
4601
- readonly logistic_mode: string
4643
+ readonly logistic_mode?: string
4602
4644
 
4603
4645
  /**
4604
4646
  * The logistic radius for this roboport prototype or `nil`.
4605
4647
  */
4606
- readonly logistic_radius: number
4648
+ readonly logistic_radius?: number
4607
4649
 
4608
4650
  /**
4609
4651
  * Loot that will be dropped when this entity is killed. `nil` if there is no loot.
@@ -4620,7 +4662,7 @@ interface LuaEntityPrototype {
4620
4662
  /**
4621
4663
  * The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`.
4622
4664
  */
4623
- readonly map_color: Color
4665
+ readonly map_color?: Color
4624
4666
 
4625
4667
  /**
4626
4668
  * The bounding box used for map generator collision checking.
@@ -4655,7 +4697,7 @@ interface LuaEntityPrototype {
4655
4697
  /**
4656
4698
  * The max energy for this flying robot or `nil`.
4657
4699
  */
4658
- readonly max_energy: number
4700
+ readonly max_energy?: number
4659
4701
 
4660
4702
  /**
4661
4703
  * The theoretical maximum energy production for this this entity.
@@ -4680,32 +4722,32 @@ interface LuaEntityPrototype {
4680
4722
  /**
4681
4723
  * The max payload size of this logistics or construction robot or `nil`.
4682
4724
  */
4683
- readonly max_payload_size: number
4725
+ readonly max_payload_size?: number
4684
4726
 
4685
4727
  /**
4686
4728
  * The maximum polyphony for this programmable speaker or `nil`.
4687
4729
  */
4688
- readonly max_polyphony: number
4730
+ readonly max_polyphony?: number
4689
4731
 
4690
4732
  /**
4691
4733
  * The maximum pursue distance of this unit prototype or `nil`.
4692
4734
  */
4693
- readonly max_pursue_distance: number
4735
+ readonly max_pursue_distance?: number
4694
4736
 
4695
4737
  /**
4696
4738
  * The max speed of this projectile prototype or flying robot prototype or `nil`.
4697
4739
  */
4698
- readonly max_speed: number
4740
+ readonly max_speed?: number
4699
4741
 
4700
4742
  /**
4701
4743
  * The maximum energy for this flying robot above which it won't try to recharge when stationing or `nil`.
4702
4744
  */
4703
- readonly max_to_charge: number
4745
+ readonly max_to_charge?: number
4704
4746
 
4705
4747
  /**
4706
4748
  * The max underground distance for underground belts and underground pipes or `nil` if this isn't one of those prototypes.
4707
4749
  */
4708
- readonly max_underground_distance: number
4750
+ readonly max_underground_distance?: number
4709
4751
 
4710
4752
  /**
4711
4753
  * The maximum wire distance for this entity. 0 when the entity doesn't support wires.
@@ -4722,7 +4764,7 @@ interface LuaEntityPrototype {
4722
4764
  /**
4723
4765
  * The maximum fluid temperature of this generator prototype or `nil`.
4724
4766
  */
4725
- readonly maximum_temperature: number
4767
+ readonly maximum_temperature?: number
4726
4768
 
4727
4769
  /**
4728
4770
  * The minimum darkness at which this unit spawner can spawn entities.
@@ -4732,12 +4774,12 @@ interface LuaEntityPrototype {
4732
4774
  /**
4733
4775
  * The minimum pursue time of this unit prototype or `nil`.
4734
4776
  */
4735
- readonly min_pursue_time: number
4777
+ readonly min_pursue_time?: number
4736
4778
 
4737
4779
  /**
4738
4780
  * The minimum energy for this flying robot before it tries to recharge or `nil`.
4739
4781
  */
4740
- readonly min_to_charge: number
4782
+ readonly min_to_charge?: number
4741
4783
 
4742
4784
  /**
4743
4785
  * Whether this entity is minable and what can be obtained by mining it.
@@ -4752,22 +4794,22 @@ interface LuaEntityPrototype {
4752
4794
  /**
4753
4795
  * The mining radius of this mining drill prototype or `nil` if this isn't a mining drill prototype.
4754
4796
  */
4755
- readonly mining_drill_radius: number
4797
+ readonly mining_drill_radius?: number
4756
4798
 
4757
4799
  /**
4758
4800
  * The mining speed of this mining drill/character prototype or `nil`.
4759
4801
  */
4760
- readonly mining_speed: number
4802
+ readonly mining_speed?: number
4761
4803
 
4762
4804
  /**
4763
4805
  * The module inventory size or `nil` if this entity doesn't support modules.
4764
4806
  */
4765
- readonly module_inventory_size: number
4807
+ readonly module_inventory_size?: number
4766
4808
 
4767
4809
  /**
4768
4810
  * Whether this unit prototype can move while shooting or `nil`.
4769
4811
  */
4770
- readonly move_while_shooting: boolean
4812
+ readonly move_while_shooting?: boolean
4771
4813
 
4772
4814
  /**
4773
4815
  * Name of this prototype.
@@ -4781,18 +4823,10 @@ interface LuaEntityPrototype {
4781
4823
  */
4782
4824
  readonly neighbour_bonus: number
4783
4825
 
4784
- /**
4785
- * Controls how much a reactor extends when connected to other reactors.
4786
- * @remarks
4787
- * Applies to subclasses: Reactor
4788
- *
4789
- */
4790
- readonly neighbour_collision_increase: number
4791
-
4792
4826
  /**
4793
4827
  * The next upgrade for this entity or `nil`.
4794
4828
  */
4795
- readonly next_upgrade: LuaEntityPrototype
4829
+ readonly next_upgrade?: LuaEntityPrototype
4796
4830
 
4797
4831
  /**
4798
4832
  * The normal amount for this resource. `nil` when not a resource.
@@ -4814,15 +4848,20 @@ interface LuaEntityPrototype {
4814
4848
  */
4815
4849
  readonly pollution_to_join_attack: number
4816
4850
 
4851
+ /**
4852
+ * True if this entity prototype should be included during tile collision checks with {@link LuaTilePrototype::check_collision_with_entities | LuaTilePrototype::check_collision_with_entities} enabled.
4853
+ */
4854
+ readonly protected_from_tile_building: boolean
4855
+
4817
4856
  /**
4818
4857
  * The pumping speed of this offshore pump, normal pump, or `nil`.
4819
4858
  */
4820
- readonly pumping_speed: number
4859
+ readonly pumping_speed?: number
4821
4860
 
4822
4861
  /**
4823
4862
  * The radar range of this unit prototype or `nil`.
4824
4863
  */
4825
- readonly radar_range: number
4864
+ readonly radar_range?: number
4826
4865
 
4827
4866
  /**
4828
4867
  * The radius of this entity prototype.
@@ -4865,7 +4904,7 @@ interface LuaEntityPrototype {
4865
4904
  /**
4866
4905
  * The base researching speed of this lab prototype or `nil`.
4867
4906
  */
4868
- readonly researching_speed: number
4907
+ readonly researching_speed?: number
4869
4908
 
4870
4909
  /**
4871
4910
  * List of resistances towards each damage type. It is a dictionary indexed by damage type names (see `data/base/prototypes/damage-type.lua`).
@@ -4878,7 +4917,7 @@ interface LuaEntityPrototype {
4878
4917
  * The value in the dictionary is meaningless and exists just to allow the dictionary type for easy lookup.
4879
4918
  *
4880
4919
  */
4881
- readonly resource_categories: {[key: string]: boolean}
4920
+ readonly resource_categories?: {[key: string]: boolean}
4882
4921
 
4883
4922
  /**
4884
4923
  * Name of the category of this resource or `nil` when not a resource.
@@ -4886,7 +4925,7 @@ interface LuaEntityPrototype {
4886
4925
  * During data stage this property is named "category".
4887
4926
  *
4888
4927
  */
4889
- readonly resource_category: string
4928
+ readonly resource_category?: string
4890
4929
 
4891
4930
  /**
4892
4931
  * @remarks
@@ -4903,27 +4942,27 @@ interface LuaEntityPrototype {
4903
4942
  /**
4904
4943
  * The rising speed for this rocket silo rocket prototype or `nil`.
4905
4944
  */
4906
- readonly rising_speed: number
4945
+ readonly rising_speed?: number
4907
4946
 
4908
4947
  /**
4909
4948
  * The rocket entity prototype associated with this rocket silo prototype or `nil`.
4910
4949
  */
4911
- readonly rocket_entity_prototype: LuaEntityPrototype
4950
+ readonly rocket_entity_prototype?: LuaEntityPrototype
4912
4951
 
4913
4952
  /**
4914
4953
  * The rocket parts required for this rocket silo prototype or `nil`.
4915
4954
  */
4916
- readonly rocket_parts_required: number
4955
+ readonly rocket_parts_required?: number
4917
4956
 
4918
4957
  /**
4919
4958
  * The rocket rising delay for this rocket silo prototype or `nil`.
4920
4959
  */
4921
- readonly rocket_rising_delay: number
4960
+ readonly rocket_rising_delay?: number
4922
4961
 
4923
4962
  /**
4924
4963
  * The rotation speed of this car prototype or `nil` if not a car prototype.
4925
4964
  */
4926
- readonly rotation_speed: number
4965
+ readonly rotation_speed?: number
4927
4966
 
4928
4967
  /**
4929
4968
  * Gets the current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.
@@ -4936,7 +4975,7 @@ interface LuaEntityPrototype {
4936
4975
  /**
4937
4976
  * The secondary bounding box used for collision checking, or `nil` if it doesn't have one. This is only used in rails and rail remnants.
4938
4977
  */
4939
- readonly secondary_collision_box: BoundingBox
4978
+ readonly secondary_collision_box?: BoundingBox
4940
4979
 
4941
4980
  /**
4942
4981
  * Is this entity selectable?
@@ -4961,7 +5000,7 @@ interface LuaEntityPrototype {
4961
5000
  /**
4962
5001
  * The spawning cooldown for this enemy spawner prototype or `nil`.
4963
5002
  */
4964
- readonly spawn_cooldown: { max: number, min: number }
5003
+ readonly spawn_cooldown?: { max: number, min: number }
4965
5004
 
4966
5005
  /**
4967
5006
  * How far from the spawner can the units be spawned.
@@ -4976,7 +5015,7 @@ interface LuaEntityPrototype {
4976
5015
  /**
4977
5016
  * The spawning time modifier of this unit prototype or `nil`.
4978
5017
  */
4979
- readonly spawning_time_modifier: number
5018
+ readonly spawning_time_modifier?: number
4980
5019
 
4981
5020
  /**
4982
5021
  * The default speed of this flying robot, rolling stock or unit, `nil` if not one of these.
@@ -4989,7 +5028,7 @@ interface LuaEntityPrototype {
4989
5028
  /**
4990
5029
  * The speed multiplier when this flying robot is out of energy or `nil`.
4991
5030
  */
4992
- readonly speed_multiplier_when_out_of_energy: number
5031
+ readonly speed_multiplier_when_out_of_energy?: number
4993
5032
 
4994
5033
  /**
4995
5034
  * If this inserter is a stack-type.
@@ -5009,7 +5048,7 @@ interface LuaEntityPrototype {
5009
5048
  /**
5010
5049
  * The supply area of this electric pole, beacon, or `nil` if this is neither.
5011
5050
  */
5012
- readonly supply_area_distance: number
5051
+ readonly supply_area_distance?: number
5013
5052
 
5014
5053
  /**
5015
5054
  * If this entity prototype could possibly ever be rotated.
@@ -5019,12 +5058,12 @@ interface LuaEntityPrototype {
5019
5058
  /**
5020
5059
  * If this car prototype uses tank controls to drive or `nil` if this is not a car prototype.
5021
5060
  */
5022
- readonly tank_driving: boolean
5061
+ readonly tank_driving?: boolean
5023
5062
 
5024
5063
  /**
5025
5064
  * The target temperature of this boiler prototype or `nil`.
5026
5065
  */
5027
- readonly target_temperature: number
5066
+ readonly target_temperature?: number
5028
5067
 
5029
5068
  /**
5030
5069
  * The terrain friction modifier for this vehicle.
@@ -5067,15 +5106,20 @@ interface LuaEntityPrototype {
5067
5106
  */
5068
5107
  readonly tree_color_count: number
5069
5108
 
5109
+ /**
5110
+ * Collision mask entity must collide with to make landmine blowup
5111
+ */
5112
+ readonly trigger_collision_mask: CollisionMask
5113
+
5070
5114
  /**
5071
5115
  * The range of this turret or `nil` if this isn't a turret related prototype.
5072
5116
  */
5073
- readonly turret_range: number
5117
+ readonly turret_range?: number
5074
5118
 
5075
5119
  /**
5076
5120
  * The turret rotation speed of this car prototype or `nil` if not a car prototype.
5077
5121
  */
5078
- readonly turret_rotation_speed: number
5122
+ readonly turret_rotation_speed?: number
5079
5123
 
5080
5124
  /**
5081
5125
  * Type of this prototype.
@@ -5090,17 +5134,17 @@ interface LuaEntityPrototype {
5090
5134
  /**
5091
5135
  * The vision distance of this unit prototype or `nil`.
5092
5136
  */
5093
- readonly vision_distance: number
5137
+ readonly vision_distance?: number
5094
5138
 
5095
5139
  /**
5096
5140
  * The void energy source prototype this entity uses or `nil`.
5097
5141
  */
5098
- readonly void_energy_source_prototype: LuaVoidEnergySourcePrototype
5142
+ readonly void_energy_source_prototype?: LuaVoidEnergySourcePrototype
5099
5143
 
5100
5144
  /**
5101
5145
  * The weight of this vehicle prototype or `nil` if not a vehicle prototype.
5102
5146
  */
5103
- readonly weight: number
5147
+ readonly weight?: number
5104
5148
 
5105
5149
  }
5106
5150
 
@@ -5119,7 +5163,7 @@ interface LuaEquipment {
5119
5163
  /**
5120
5164
  * The burner energy source for this equipment or `nil` if there isn't one.
5121
5165
  */
5122
- readonly burner: LuaBurner
5166
+ readonly burner?: LuaBurner
5123
5167
 
5124
5168
  /**
5125
5169
  * Current available energy.
@@ -5443,7 +5487,7 @@ interface LuaEquipmentPrototype {
5443
5487
  /**
5444
5488
  * The equipment attack parameters or `nil`.
5445
5489
  */
5446
- readonly attack_parameters: AttackParameters
5490
+ readonly attack_parameters?: AttackParameters
5447
5491
 
5448
5492
  /**
5449
5493
  * Is this active defense equipment automatic. Returns false if not active defense equipment.
@@ -5458,12 +5502,12 @@ interface LuaEquipmentPrototype {
5458
5502
  /**
5459
5503
  * The burner energy source prototype this equipment uses or `nil`.
5460
5504
  */
5461
- readonly burner_prototype: LuaBurnerPrototype
5505
+ readonly burner_prototype?: LuaBurnerPrototype
5462
5506
 
5463
5507
  /**
5464
5508
  * The electric energy source prototype this equipment uses or `nil`.
5465
5509
  */
5466
- readonly electric_energy_source_prototype: LuaElectricEnergySourcePrototype
5510
+ readonly electric_energy_source_prototype?: LuaElectricEnergySourcePrototype
5467
5511
 
5468
5512
  readonly energy_consumption: number
5469
5513
 
@@ -5551,6 +5595,7 @@ interface LuaEquipmentPrototype {
5551
5595
 
5552
5596
  /**
5553
5597
  * Encapsulates statistic data for different parts of the game. In the context of flow statistics, `input` and `output` describe on which side of the associated GUI the values are shown. Input values are shown on the left side, output values on the right side.
5598
+ *
5554
5599
  * Examples:
5555
5600
  * - The item production GUI shows "consumption" on the right, thus `output` describes the item consumption numbers. The same goes for fluid consumption.
5556
5601
  * - The kills gui shows "losses" on the right, so `output` describes how many of the force's entities were killed by enemies.
@@ -5626,7 +5671,7 @@ interface LuaFlowStatistics {
5626
5671
  /**
5627
5672
  * The force these statistics belong to or `nil` for pollution statistics.
5628
5673
  */
5629
- readonly force: LuaForce
5674
+ readonly force?: LuaForce
5630
5675
 
5631
5676
  /**
5632
5677
  * 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.
@@ -5652,7 +5697,9 @@ interface LuaFlowStatistics {
5652
5697
 
5653
5698
  /**
5654
5699
  * 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.
5700
+ *
5655
5701
  * See {@link Fluid | Fluid}
5702
+ *
5656
5703
  * Do note that reading from a {@link LuaFluidBox | 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.
5657
5704
  * @example
5658
5705
  * Double the temperature of the fluid in `entity`'s first fluid box.
@@ -5783,7 +5830,7 @@ interface LuaFluidBoxPrototype {
5783
5830
  /**
5784
5831
  * The filter or `nil` if no filter is set.
5785
5832
  */
5786
- readonly filter: LuaFluidPrototype
5833
+ readonly filter?: LuaFluidPrototype
5787
5834
 
5788
5835
  readonly height: number
5789
5836
 
@@ -5795,12 +5842,12 @@ interface LuaFluidBoxPrototype {
5795
5842
  /**
5796
5843
  * The maximum temperature or `nil` if none is set.
5797
5844
  */
5798
- readonly maximum_temperature: number
5845
+ readonly maximum_temperature?: number
5799
5846
 
5800
5847
  /**
5801
5848
  * The minimum temperature or `nil` if none is set.
5802
5849
  */
5803
- readonly minimum_temperature: number
5850
+ readonly minimum_temperature?: number
5804
5851
 
5805
5852
  /**
5806
5853
  * 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.
@@ -5847,6 +5894,8 @@ interface LuaFluidEnergySourcePrototype {
5847
5894
 
5848
5895
  readonly burns_fluid: boolean
5849
5896
 
5897
+ readonly destroy_non_fuel_fluid: boolean
5898
+
5850
5899
  readonly effectivity: number
5851
5900
 
5852
5901
  readonly emissions: number
@@ -5981,7 +6030,7 @@ interface LuaFontPrototype {
5981
6030
  /**
5982
6031
  * The border color or `nil` if not set.
5983
6032
  */
5984
- readonly border_color: Color
6033
+ readonly border_color?: Color
5985
6034
 
5986
6035
  readonly filtered: boolean
5987
6036
 
@@ -6431,6 +6480,7 @@ interface LuaForce {
6431
6480
 
6432
6481
  /**
6433
6482
  * The connected players belonging to this force.
6483
+ *
6434
6484
  * This is primarily useful when you want to do some action against all online players of this force.
6435
6485
  * @remarks
6436
6486
  * This does *not* index using player index. See {@link LuaPlayer::index | LuaPlayer::index} on each player instance for the player index.
@@ -6441,7 +6491,7 @@ interface LuaForce {
6441
6491
  /**
6442
6492
  * The current technology in research, or `nil` if no research is currently ongoing.
6443
6493
  */
6444
- readonly current_research: LuaTechnology
6494
+ readonly current_research?: LuaTechnology
6445
6495
 
6446
6496
  /**
6447
6497
  * The time, in ticks, before a deconstruction order is removed.
@@ -6600,12 +6650,13 @@ interface LuaForce {
6600
6650
 
6601
6651
  /**
6602
6652
  * 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 | LuaTechnology}.
6653
+ *
6603
6654
  * To write to this, the entire table must be written. Providing an empty table or `nil` will empty the research queue and cancel the current research. Writing to this when the research queue is disabled will simply set the last research in the table as the current research.
6604
6655
  * @remarks
6605
6656
  * This only allows mods to queue research that this force is able to research in the first place. As an example, an already researched technology or one whose prerequisites are not fulfilled will not be queued, but dropped silently instead.
6606
6657
  *
6607
6658
  */
6608
- research_queue: TechnologyIdentification[]
6659
+ research_queue?: TechnologyIdentification[]
6609
6660
 
6610
6661
  /**
6611
6662
  * Whether the research queue is available for this force.
@@ -7195,6 +7246,11 @@ interface LuaGameScript {
7195
7246
  remove_path(this: void,
7196
7247
  path: string): void
7197
7248
 
7249
+ /**
7250
+ * Reset scenario state (game_finished, player_won, etc.).
7251
+ */
7252
+ reset_game_state(this: void): void
7253
+
7198
7254
  /**
7199
7255
  * Resets the amount of time played for this map.
7200
7256
  */
@@ -7386,6 +7442,7 @@ interface LuaGameScript {
7386
7442
 
7387
7443
  /**
7388
7444
  * The players that are currently online.
7445
+ *
7389
7446
  * This is primarily useful when you want to do some action against all online players.
7390
7447
  * @remarks
7391
7448
  * This does *not* index using player index. See {@link LuaPlayer::index | LuaPlayer::index} on each player instance for the player index.
@@ -7460,10 +7517,15 @@ interface LuaGameScript {
7460
7517
  readonly equipment_prototypes: {[key: string]: LuaEquipmentPrototype}
7461
7518
 
7462
7519
  /**
7463
- * Is the scenario finished?
7520
+ * True while the victory screen is shown.
7464
7521
  */
7465
7522
  readonly finished: boolean
7466
7523
 
7524
+ /**
7525
+ * True after players finished the game and clicked "continue".
7526
+ */
7527
+ readonly finished_but_continuing: boolean
7528
+
7467
7529
  /**
7468
7530
  * A dictionary containing every LuaFluidPrototype indexed by `name`.
7469
7531
  */
@@ -7853,7 +7915,9 @@ interface LuaGui {
7853
7915
 
7854
7916
  /**
7855
7917
  * An element of a custom GUI. This type is used to represent any kind of a GUI element - labels, buttons and frames are all instances of this type. Just like {@link LuaEntity | LuaEntity}, different kinds of elements support different attributes; attempting to access an attribute on an element that doesn't support it (for instance, trying to access the `column_count` of a `textfield`) will result in a runtime error.
7918
+ *
7856
7919
  * The following types of GUI element are supported:
7920
+ *
7857
7921
  * - `"button"`: A clickable element. Relevant event: {@link on_gui_click | on_gui_click}
7858
7922
  * - `"sprite-button"`: A `button` that displays a sprite rather than text. Relevant event: {@link on_gui_click | on_gui_click}
7859
7923
  * - `"checkbox"`: A clickable element with a check mark that can be turned off or on. Relevant event: {@link on_gui_checked_state_changed | on_gui_checked_state_changed}
@@ -7879,6 +7943,7 @@ interface LuaGui {
7879
7943
  * - `"tabbed-pane"`: A collection of `tab`s and their contents. Relevant event: {@link on_gui_selected_tab_changed | on_gui_selected_tab_changed}
7880
7944
  * - `"tab"`: A tab for use in a `tabbed-pane`.
7881
7945
  * - `"switch"`: A switch with three possible states. Can have labels attached to either side. Relevant event: {@link on_gui_switch_state_changed | on_gui_switch_state_changed}
7946
+ *
7882
7947
  * Each GUI element allows access to its children by having them as attributes. Thus, one can use the `parent.child` syntax to refer to children. Lua also supports the `parent["child"]` syntax to refer to the same element. This can be used in cases where the child has a name that isn't a valid Lua identifier.
7883
7948
  * @example
7884
7949
  * This will add a label called `greeting` to the top flow. Immediately after, it will change its text to illustrate accessing child elements.
@@ -8317,6 +8382,7 @@ interface LuaGuiElement {
8317
8382
 
8318
8383
  /**
8319
8384
  * The elem filters of this choose-elem-button or `nil` if there are no filters.
8385
+ *
8320
8386
  * The compatible type of filter is determined by elem_type:
8321
8387
  * - Type `"item"` - {@link ItemPrototypeFilter | ItemPrototypeFilter}
8322
8388
  * - Type `"tile"` - {@link TilePrototypeFilter | TilePrototypeFilter}
@@ -8352,7 +8418,7 @@ interface LuaGuiElement {
8352
8418
  * ```
8353
8419
  *
8354
8420
  */
8355
- elem_filters: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
8421
+ elem_filters?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
8356
8422
 
8357
8423
  /**
8358
8424
  * The elem type of this choose-elem-button.
@@ -8369,7 +8435,7 @@ interface LuaGuiElement {
8369
8435
  * Applies to subclasses: choose-elem-button
8370
8436
  *
8371
8437
  */
8372
- elem_value: string | SignalID
8438
+ elem_value?: string | SignalID
8373
8439
 
8374
8440
  /**
8375
8441
  * Whether this GUI element is enabled. Disabled GUI elements don't trigger events when clicked.
@@ -8379,12 +8445,12 @@ interface LuaGuiElement {
8379
8445
  /**
8380
8446
  * The entity associated with this entity-preview, camera, minimap or `nil` if no entity is associated.
8381
8447
  */
8382
- entity: LuaEntity
8448
+ entity?: LuaEntity
8383
8449
 
8384
8450
  /**
8385
8451
  * The force this minimap is using or `nil` if no force is set.
8386
8452
  */
8387
- force: string
8453
+ force?: string
8388
8454
 
8389
8455
  /**
8390
8456
  * The GUI this element is a child of.
@@ -8449,7 +8515,7 @@ interface LuaGuiElement {
8449
8515
  /**
8450
8516
  * The location of this widget when stored in {@link LuaGui::screen | LuaGui::screen}, or `nil` if not set or not in {@link LuaGui::screen | LuaGui::screen}.
8451
8517
  */
8452
- location: GuiLocation
8518
+ location?: GuiLocation
8453
8519
 
8454
8520
  /**
8455
8521
  * Whether this choose-elem-button can be changed by the player.
@@ -8571,7 +8637,7 @@ interface LuaGuiElement {
8571
8637
  * Applies to subclasses: tabbed-pane
8572
8638
  *
8573
8639
  */
8574
- selected_tab_index: number
8640
+ selected_tab_index?: number
8575
8641
 
8576
8642
  /**
8577
8643
  * Related to the number to be shown in the bottom right corner of this sprite-button. When set to `true`, numbers that are non-zero and smaller than one are shown as a percentage rather than the value. For example, `0.5` will be shown as `50%` instead.
@@ -8979,22 +9045,22 @@ interface LuaInventory {
8979
9045
  /**
8980
9046
  * The entity that owns this inventory or `nil` if this isn't owned by an entity.
8981
9047
  */
8982
- readonly entity_owner: LuaEntity
9048
+ readonly entity_owner?: LuaEntity
8983
9049
 
8984
9050
  /**
8985
9051
  * The equipment that owns this inventory or `nil` if this isn't owned by an equipment.
8986
9052
  */
8987
- readonly equipment_owner: LuaEquipment
9053
+ readonly equipment_owner?: LuaEquipment
8988
9054
 
8989
9055
  /**
8990
9056
  * The inventory index this inventory uses, or `nil` if the inventory doesn't have an index.
8991
9057
  */
8992
- readonly index: defines.inventory
9058
+ readonly index?: defines.inventory
8993
9059
 
8994
9060
  /**
8995
9061
  * The mod that owns this inventory or `nil` if this isn't owned by a mod.
8996
9062
  */
8997
- readonly mod_owner: string
9063
+ readonly mod_owner?: string
8998
9064
 
8999
9065
  /**
9000
9066
  * 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.
@@ -9004,7 +9070,7 @@ interface LuaInventory {
9004
9070
  /**
9005
9071
  * The player that owns this inventory or `nil` if this isn't owned by a player.
9006
9072
  */
9007
- readonly player_owner: LuaPlayer
9073
+ readonly player_owner?: LuaPlayer
9008
9074
 
9009
9075
  /**
9010
9076
  * 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.
@@ -9142,12 +9208,12 @@ interface LuaItemPrototype {
9142
9208
  /**
9143
9209
  * The gun attack parameters or `nil` if not a gun item prototype.
9144
9210
  */
9145
- readonly attack_parameters: AttackParameters
9211
+ readonly attack_parameters?: AttackParameters
9146
9212
 
9147
9213
  /**
9148
9214
  * The result of burning this item as fuel or `nil`.
9149
9215
  */
9150
- readonly burnt_result: LuaItemPrototype
9216
+ readonly burnt_result?: LuaItemPrototype
9151
9217
 
9152
9218
  /**
9153
9219
  * If this item can be mod-opened.
@@ -9157,7 +9223,7 @@ interface LuaItemPrototype {
9157
9223
  /**
9158
9224
  * The capsule action for this capsule item prototype or `nil` if this isn't a capsule item prototype.
9159
9225
  */
9160
- readonly capsule_action: CapsuleAction
9226
+ readonly capsule_action?: CapsuleAction
9161
9227
 
9162
9228
  /**
9163
9229
  * The name of a {@link LuaModuleCategoryPrototype | LuaModuleCategoryPrototype}. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules of the same category with higher tier modules.
@@ -9202,7 +9268,7 @@ interface LuaItemPrototype {
9202
9268
  * Applies to subclasses: ToolItem
9203
9269
  *
9204
9270
  */
9205
- readonly durability: number
9271
+ readonly durability?: number
9206
9272
 
9207
9273
  /**
9208
9274
  * The durability message key used when displaying the durability of this tool.
@@ -9226,7 +9292,7 @@ interface LuaItemPrototype {
9226
9292
  * Applies to subclasses: DeconstructionItem
9227
9293
  *
9228
9294
  */
9229
- readonly entity_filter_slots: number
9295
+ readonly entity_filter_slots?: number
9230
9296
 
9231
9297
  /**
9232
9298
  * The entity filters used by this selection tool indexed by entity name.
@@ -9248,7 +9314,7 @@ interface LuaItemPrototype {
9248
9314
  /**
9249
9315
  * The prototype of this armor equipment grid or `nil` if none or this is not an armor item.
9250
9316
  */
9251
- readonly equipment_grid: LuaEquipmentGridPrototype
9317
+ readonly equipment_grid?: LuaEquipmentGridPrototype
9252
9318
 
9253
9319
  /**
9254
9320
  * If this item with inventory extends the inventory it resides in by default.
@@ -9279,7 +9345,7 @@ interface LuaItemPrototype {
9279
9345
  /**
9280
9346
  * The fuel category or `nil`.
9281
9347
  */
9282
- readonly fuel_category: string
9348
+ readonly fuel_category?: string
9283
9349
 
9284
9350
  /**
9285
9351
  * The emissions multiplier if this is used as fuel.
@@ -9421,7 +9487,7 @@ interface LuaItemPrototype {
9421
9487
  /**
9422
9488
  * Prototype of the equipment that will be created by placing this item in an equipment grid or `nil` if there is no equipment defined.
9423
9489
  */
9424
- readonly place_as_equipment_result: LuaEquipmentPrototype
9490
+ readonly place_as_equipment_result?: LuaEquipmentPrototype
9425
9491
 
9426
9492
  /**
9427
9493
  * The place-as-tile result if one is defined, else `nil`.
@@ -9431,12 +9497,12 @@ interface LuaItemPrototype {
9431
9497
  /**
9432
9498
  * Prototype of the entity that will be created by placing this item, or `nil` if there is no such entity.
9433
9499
  */
9434
- readonly place_result: LuaEntityPrototype
9500
+ readonly place_result?: LuaEntityPrototype
9435
9501
 
9436
9502
  /**
9437
9503
  * Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine or `nil` if this is not an ammo item.
9438
9504
  */
9439
- readonly reload_time: number
9505
+ readonly reload_time?: number
9440
9506
 
9441
9507
  /**
9442
9508
  * The repair result of this repair tool prototype or `nil` if this isn't a repair tool prototype.
@@ -9444,7 +9510,7 @@ interface LuaItemPrototype {
9444
9510
  * Applies to subclasses: RepairTool
9445
9511
  *
9446
9512
  */
9447
- readonly repair_result: TriggerItem[]
9513
+ readonly repair_result?: TriggerItem[]
9448
9514
 
9449
9515
  /**
9450
9516
  * Resistances of this armour item, indexed by damage type name. `nil` if not an armor or the armor has no resistances.
@@ -9529,7 +9595,7 @@ interface LuaItemPrototype {
9529
9595
  * Applies to subclasses: DeconstructionItem
9530
9596
  *
9531
9597
  */
9532
- readonly tile_filter_slots: number
9598
+ readonly tile_filter_slots?: number
9533
9599
 
9534
9600
  /**
9535
9601
  * The tile filters used by this selection tool indexed by tile name.
@@ -9585,7 +9651,6 @@ interface LuaItemStack {
9585
9651
  amount: number): void
9586
9652
 
9587
9653
  /**
9588
- * Build this blueprint
9589
9654
  * @remarks
9590
9655
  * Built entities can be come invalid between the building of the blueprint and the function returning if by_player or raise_built is used and one of those events invalidates the entity.
9591
9656
  *
@@ -9736,7 +9801,7 @@ interface LuaItemStack {
9736
9801
  amount: number): void
9737
9802
 
9738
9803
  /**
9739
- * Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string
9804
+ * Export a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) to a string.
9740
9805
  * @returns The exported string
9741
9806
  */
9742
9807
  export_stack(this: void): string
@@ -9839,7 +9904,7 @@ interface LuaItemStack {
9839
9904
  help(this: void): string
9840
9905
 
9841
9906
  /**
9842
- * Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string
9907
+ * Import a supported item (blueprint, blueprint-book, deconstruction-planner, upgrade-planner, item-with-tags) from a string.
9843
9908
  * @param data - The string to import
9844
9909
  * @returns 0 if the import succeeded with no errors. -1 if the import succeeded with errors. 1 if the import failed.
9845
9910
  */
@@ -10103,7 +10168,7 @@ interface LuaItemStack {
10103
10168
  /**
10104
10169
  * The equipment grid of this item or `nil` if this item doesn't have a grid.
10105
10170
  */
10106
- readonly grid: LuaEquipmentGrid
10171
+ readonly grid?: LuaEquipmentGrid
10107
10172
 
10108
10173
  /**
10109
10174
  * How much health the item has, as a number in range [0, 1].
@@ -10182,6 +10247,7 @@ interface LuaItemStack {
10182
10247
 
10183
10248
  /**
10184
10249
  * The unique identifier for this item if it has one, `nil` otherwise. Note that this ID stays the same no matter where the item is moved to.
10250
+ *
10185
10251
  * Only these types of items have unique IDs:
10186
10252
  * - `"armor"`
10187
10253
  * - `"spidertron-remote"`
@@ -10309,7 +10375,7 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
10309
10375
  /**
10310
10376
  * The color the lamp is showing or `nil` if not using any color.
10311
10377
  */
10312
- readonly color: Color
10378
+ readonly color?: Color
10313
10379
 
10314
10380
  /**
10315
10381
  * 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.
@@ -10330,6 +10396,7 @@ interface LuaLampControlBehavior extends LuaGenericOnOffControlBehavior {
10330
10396
 
10331
10397
  /**
10332
10398
  * 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 | LuaLazyLoadedValue::get} is called, therefore preventing its unnecessary construction in some cases.
10399
+ *
10333
10400
  * An instance of LuaLazyLoadedValue is only valid during the event it was created from and cannot be saved.
10334
10401
  */
10335
10402
  interface LuaLazyLoadedValue<T> {
@@ -10405,7 +10472,7 @@ interface LuaLogisticCell {
10405
10472
  /**
10406
10473
  * The network that owns this cell or `nil`.
10407
10474
  */
10408
- readonly logistic_network: LuaLogisticNetwork
10475
+ readonly logistic_network?: LuaLogisticNetwork
10409
10476
 
10410
10477
  /**
10411
10478
  * Logistic radius of this cell.
@@ -10712,7 +10779,7 @@ interface LuaLogisticPoint {
10712
10779
  * The returned array will always have an entry for each filter and will be indexed in sequence when not nil.
10713
10780
  *
10714
10781
  */
10715
- readonly filters: LogisticFilter[]
10782
+ readonly filters?: LogisticFilter[]
10716
10783
 
10717
10784
  /**
10718
10785
  * The force of this logistic point.
@@ -10814,17 +10881,17 @@ interface LuaModSettingPrototype {
10814
10881
  /**
10815
10882
  * If this string setting allows blank values or `nil` if not a string setting.
10816
10883
  */
10817
- readonly allow_blank: boolean
10884
+ readonly allow_blank?: boolean
10818
10885
 
10819
10886
  /**
10820
10887
  * The allowed values for this setting or `nil` if this setting doesn't use the a fixed set of values.
10821
10888
  */
10822
- readonly allowed_values: string[] | number[]
10889
+ readonly allowed_values?: string[] | number[]
10823
10890
 
10824
10891
  /**
10825
10892
  * If this string setting auto-trims values or `nil` if not a string setting.
10826
10893
  */
10827
- readonly auto_trim: boolean
10894
+ readonly auto_trim?: boolean
10828
10895
 
10829
10896
  /**
10830
10897
  * The default value of this setting.
@@ -10843,12 +10910,12 @@ interface LuaModSettingPrototype {
10843
10910
  /**
10844
10911
  * The maximum value for this setting or `nil` if this setting type doesn't support a maximum.
10845
10912
  */
10846
- readonly maximum_value: number
10913
+ readonly maximum_value?: number
10847
10914
 
10848
10915
  /**
10849
10916
  * The minimum value for this setting or `nil` if this setting type doesn't support a minimum.
10850
10917
  */
10851
- readonly minimum_value: number
10918
+ readonly minimum_value?: number
10852
10919
 
10853
10920
  /**
10854
10921
  * The mod that owns this setting.
@@ -11230,7 +11297,7 @@ interface LuaPlayer extends LuaControl {
11230
11297
  */
11231
11298
  build_from_cursor(this: void,
11232
11299
  table: {
11233
- position: Position,
11300
+ position: MapPosition,
11234
11301
  direction?: defines.direction,
11235
11302
  alt?: boolean,
11236
11303
  terrain_building_size?: number,
@@ -11247,7 +11314,7 @@ interface LuaPlayer extends LuaControl {
11247
11314
  */
11248
11315
  can_build_from_cursor(this: void,
11249
11316
  table: {
11250
- position: Position,
11317
+ position: MapPosition,
11251
11318
  direction?: defines.direction,
11252
11319
  alt?: boolean,
11253
11320
  terrain_building_size?: number,
@@ -11263,7 +11330,7 @@ interface LuaPlayer extends LuaControl {
11263
11330
  can_place_entity(this: void,
11264
11331
  table: {
11265
11332
  name: string,
11266
- position: Position,
11333
+ position: MapPosition,
11267
11334
  direction?: defines.direction
11268
11335
  }): boolean
11269
11336
 
@@ -11337,7 +11404,7 @@ interface LuaPlayer extends LuaControl {
11337
11404
  create_local_flying_text(this: void,
11338
11405
  table: {
11339
11406
  text: LocalisedString,
11340
- position?: Position,
11407
+ position?: MapPosition,
11341
11408
  create_at_cursor?: boolean,
11342
11409
  color?: Color,
11343
11410
  time_to_live?: number,
@@ -11378,7 +11445,7 @@ interface LuaPlayer extends LuaControl {
11378
11445
  */
11379
11446
  drag_wire(this: void,
11380
11447
  table: {
11381
- position: Position
11448
+ position: MapPosition
11382
11449
  }): boolean
11383
11450
 
11384
11451
  /**
@@ -11509,7 +11576,7 @@ interface LuaPlayer extends LuaControl {
11509
11576
  * Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
11510
11577
  */
11511
11578
  open_map(this: void,
11512
- position: Position,
11579
+ position: MapPosition,
11513
11580
  scale?: number): void
11514
11581
 
11515
11582
  /**
@@ -11680,7 +11747,7 @@ interface LuaPlayer extends LuaControl {
11680
11747
  * @param selection_mode - The type of selection to start. Can be `select`, `alternative-select`, `reverse-select`.
11681
11748
  */
11682
11749
  start_selection(this: void,
11683
- position: Position,
11750
+ position: MapPosition,
11684
11751
  selection_mode: string): void
11685
11752
 
11686
11753
  /**
@@ -11713,7 +11780,7 @@ interface LuaPlayer extends LuaControl {
11713
11780
  * Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
11714
11781
  */
11715
11782
  zoom_to_world(this: void,
11716
- position: Position,
11783
+ position: MapPosition,
11717
11784
  scale?: number): void
11718
11785
 
11719
11786
  /**
@@ -11745,7 +11812,7 @@ interface LuaPlayer extends LuaControl {
11745
11812
  * Will also return `nil` when the player is disconnected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
11746
11813
  *
11747
11814
  */
11748
- character: LuaEntity
11815
+ character?: LuaEntity
11749
11816
 
11750
11817
  /**
11751
11818
  * The color used when this player talks in game.
@@ -11790,6 +11857,7 @@ interface LuaPlayer extends LuaControl {
11790
11857
 
11791
11858
  /**
11792
11859
  * The source entity used during entity settings copy-paste if any.
11860
+ *
11793
11861
  * `nil` if there isn't currently a source entity.
11794
11862
  */
11795
11863
  readonly entity_copy_source: LuaEntity
@@ -11862,7 +11930,7 @@ interface LuaPlayer extends LuaControl {
11862
11930
  /**
11863
11931
  * The permission group this player is part of or `nil` if not part of any group.
11864
11932
  */
11865
- permission_group: LuaPermissionGroup
11933
+ permission_group?: LuaPermissionGroup
11866
11934
 
11867
11935
  /**
11868
11936
  * If items not included in this map editor infinity inventory filters should be removed.
@@ -11874,6 +11942,11 @@ interface LuaPlayer extends LuaControl {
11874
11942
  */
11875
11943
  readonly render_mode: defines.render_mode
11876
11944
 
11945
+ /**
11946
+ * If `true`, circle and name of given player is rendered on the map/chart.
11947
+ */
11948
+ show_on_map: boolean
11949
+
11877
11950
  /**
11878
11951
  * If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
11879
11952
  */
@@ -11885,7 +11958,7 @@ interface LuaPlayer extends LuaControl {
11885
11958
  * This is mainly useful when a player is in the map editor.
11886
11959
  *
11887
11960
  */
11888
- readonly stashed_controller_type: defines.controllers
11961
+ readonly stashed_controller_type?: defines.controllers
11889
11962
 
11890
11963
  /**
11891
11964
  * The tag that is shown after the player in chat and on the map.
@@ -11899,7 +11972,7 @@ interface LuaPlayer extends LuaControl {
11899
11972
  * Set to any positive value to trigger the respawn state for this player.
11900
11973
  *
11901
11974
  */
11902
- ticks_to_respawn: number
11975
+ ticks_to_respawn?: number
11903
11976
 
11904
11977
  /**
11905
11978
  * 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.
@@ -13835,6 +13908,7 @@ interface LuaSettings {
13835
13908
 
13836
13909
  /**
13837
13910
  * The current global mod settings, indexed by prototype name.
13911
+ *
13838
13912
  * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all global settings can be changed.
13839
13913
  */
13840
13914
  readonly global: {[key: string]: ModSetting}
@@ -13846,6 +13920,7 @@ interface LuaSettings {
13846
13920
 
13847
13921
  /**
13848
13922
  * The default player mod settings for this map, indexed by prototype name.
13923
+ *
13849
13924
  * Even though these are marked as read-only, they can be changed by overwriting individual {@link ModSetting | ModSetting} tables in the custom table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.
13850
13925
  */
13851
13926
  readonly player: {[key: string]: ModSetting}
@@ -13946,6 +14021,13 @@ interface LuaStyle {
13946
14021
  */
13947
14022
  badge_horizontal_spacing: number
13948
14023
 
14024
+ /**
14025
+ * @remarks
14026
+ * Applies to subclasses: LuaProgressBarStyle
14027
+ *
14028
+ */
14029
+ bar_width: number
14030
+
13949
14031
  /**
13950
14032
  * Space between the table cell contents bottom and border.
13951
14033
  * @remarks
@@ -14539,6 +14621,7 @@ interface LuaSurface {
14539
14621
 
14540
14622
  /**
14541
14623
  * Count entities of given type or name in a given area. Works just like {@link LuaSurface::find_entities_filtered | LuaSurface::find_entities_filtered}, except this only returns the count. As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of entities.
14624
+ *
14542
14625
  * If no `area` or `position` are given, the entire surface is searched. If `position` is given, this returns the entities colliding with that position (i.e the given position is within the entity's collision box). If `position` and `radius` are given, this returns entities in the radius of the position. If `area` is specified, this returns entities colliding with that area.
14543
14626
  * @param table.invert - If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force.
14544
14627
  * @param table.radius - If given with position, will count all entities within the radius of the position.
@@ -14563,6 +14646,7 @@ interface LuaSurface {
14563
14646
 
14564
14647
  /**
14565
14648
  * Count tiles of a given name in a given area. Works just like {@link LuaSurface::find_tiles_filtered | LuaSurface::find_tiles_filtered}, except this only returns the count. As it doesn't construct all the wrapper objects, this is more efficient if one is only interested in the number of tiles.
14649
+ *
14566
14650
  * If no `area` or `position` and `radius` is given, the entire surface is searched. If `position` and `radius` are given, only tiles within the radius of the position are included.
14567
14651
  * @param table.position - Ignored if not given with radius.
14568
14652
  * @param table.radius - If given with position, will return all entities within the radius of the position.
@@ -14748,6 +14832,7 @@ interface LuaSurface {
14748
14832
 
14749
14833
  /**
14750
14834
  * Find decoratives of a given name in a given area.
14835
+ *
14751
14836
  * If no filters are given, returns all decoratives in the search area. If multiple filters are specified, returns only decoratives matching every given filter. If no area and no position are given, the entire surface is searched.
14752
14837
  * @param table.invert - If the filters should be inverted.
14753
14838
  * @example
@@ -14788,6 +14873,7 @@ interface LuaSurface {
14788
14873
 
14789
14874
  /**
14790
14875
  * Find entities in a given area.
14876
+ *
14791
14877
  * If no area is given all entities on the surface are returned.
14792
14878
  * @example
14793
14879
  * Will evaluate to a list of all entities within given area.
@@ -14801,7 +14887,9 @@ interface LuaSurface {
14801
14887
 
14802
14888
  /**
14803
14889
  * Find all entities of the given type or name in the given area.
14890
+ *
14804
14891
  * If no filters (`name`, `type`, `force`, etc.) are given, this returns all entities in the search area. If multiple filters are specified, only entities matching all given filters are returned.
14892
+ *
14805
14893
  * If no `area` or `position` are given, the entire surface is searched. If `position` is given, this returns the entities colliding with that position (i.e the given position is within the entity's collision box). If `position` and `radius` are given, this returns the entities within the radius of the position. If `area` is specified, this returns the entities colliding with that area.
14806
14894
  * @param table.invert - If the filters should be inverted. These filters are: name, type, ghost_name, ghost_type, direction, collision_mask, force.
14807
14895
  * @param table.position - Has precedence over area field.
@@ -14868,11 +14956,11 @@ interface LuaSurface {
14868
14956
  force: ForceIdentification): LuaLogisticNetwork[]
14869
14957
 
14870
14958
  /**
14871
- * Find the enemy entity-with-force ({@link military entity | https://wiki.factorio.com/Military_units_and_structures}) closest to the given position.
14959
+ * Find the enemy military target ({@link military entity | https://wiki.factorio.com/Military_units_and_structures}) closest to the given position.
14872
14960
  * @param table.force - The force the result will be an enemy of. Uses the player force if not specified.
14873
14961
  * @param table.max_distance - Radius of the circular search area.
14874
14962
  * @param table.position - Center of the search area.
14875
- * @returns The nearest enemy entity-with-force or `nil` if no enemy could be found within the given area.
14963
+ * @returns The nearest enemy military target or `nil` if no enemy could be found within the given area.
14876
14964
  */
14877
14965
  find_nearest_enemy(this: void,
14878
14966
  table: {
@@ -14930,7 +15018,9 @@ interface LuaSurface {
14930
15018
 
14931
15019
  /**
14932
15020
  * Find all tiles of the given name in the given area.
15021
+ *
14933
15022
  * If no filters are given, this returns all tiles in the search area.
15023
+ *
14934
15024
  * If no `area` or `position` and `radius` is given, the entire surface is searched. If `position` and `radius` are given, only tiles within the radius of the position are included.
14935
15025
  * @param table.position - Ignored if not given with radius.
14936
15026
  * @param table.radius - If given with position, will return all entities within the radius of the position.
@@ -15006,7 +15096,7 @@ interface LuaSurface {
15006
15096
  tiles: string[]): Position[]
15007
15097
 
15008
15098
  /**
15009
- * Returns all the entities with force on this chunk for the given force.
15099
+ * Returns all the military targets (entities with force) on this chunk for the given force.
15010
15100
  * @param force - Entities of this force will be returned.
15011
15101
  * @param position - The chunk's position.
15012
15102
  */
@@ -15197,6 +15287,7 @@ interface LuaSurface {
15197
15287
 
15198
15288
  /**
15199
15289
  * Generates a path with the specified constraints (as an array of {@link PathfinderWaypoints | PathfinderWaypoint}) using the unit pathfinding algorithm. This path can be used to emulate pathing behavior by script for non-unit entities. If you want to command actual units to move, use the {@link LuaEntity::set_command | LuaEntity::set_command} functionality instead.
15290
+ *
15200
15291
  * The resulting path is ultimately returned asynchronously via {@link on_script_path_request_finished | on_script_path_request_finished}.
15201
15292
  * @param table.bounding_box - The dimensions of the object that's supposed to travel the path.
15202
15293
  * @param table.can_open_gates - Whether the path request can open gates. Defaults to `false`.
@@ -15268,6 +15359,7 @@ interface LuaSurface {
15268
15359
 
15269
15360
  /**
15270
15361
  * Set tiles at specified locations. Can automatically correct the edges around modified tiles.
15362
+ *
15271
15363
  * Placing a {@link mineable | LuaTilePrototype::mineable_properties} tile on top of a non-mineable one will turn the latter into the {@link LuaTile::hidden_tile | LuaTile::hidden_tile} for that tile. Placing a mineable tile on a mineable one or a non-mineable tile on a non-mineable one will not modify the hidden tile. This restriction can however be circumvented by using {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
15272
15364
  * @remarks
15273
15365
  * It is recommended to call this method once for all the tiles you want to change rather than calling it individually for every tile. As the tile correction is used after every step, calling it one by one could cause the tile correction logic to redo some of the changes. Also, many small API calls are generally more performance intensive than one big one.
@@ -15324,7 +15416,9 @@ interface LuaSurface {
15324
15416
 
15325
15417
  /**
15326
15418
  * Defines how surface daytime brightness influences each color channel of the current color lookup table (LUT).
15419
+ *
15327
15420
  * The LUT is multiplied by `((1 - weight) + brightness * weight)` and result is clamped to range [0, 1].
15421
+ *
15328
15422
  * Default is `{0, 0, 0}`, which means no influence.
15329
15423
  * @example
15330
15424
  * Makes night on the surface pitch black, assuming [LuaSurface::min_brightness](LuaSurface::min_brightness) being set to default value `0.15`.
@@ -15725,7 +15819,7 @@ interface LuaTile {
15725
15819
  /**
15726
15820
  * The name of the {@link LuaTilePrototype | LuaTilePrototype} hidden under this tile or `nil` if there is no hidden tile. During normal gameplay, only {@link non-mineable | LuaTilePrototype::mineable_properties} tiles can become hidden. This can however be circumvented with {@link LuaSurface::set_hidden_tile | LuaSurface::set_hidden_tile}.
15727
15821
  */
15728
- readonly hidden_tile: string
15822
+ readonly hidden_tile?: string
15729
15823
 
15730
15824
  /**
15731
15825
  * Prototype name of this tile. E.g. `"sand-3"` or `"grass-2"`.
@@ -15779,6 +15873,11 @@ interface LuaTilePrototype {
15779
15873
  */
15780
15874
  readonly can_be_part_of_blueprint: boolean
15781
15875
 
15876
+ /**
15877
+ * True if building this tile should check for colliding entities above and prevent building if such are found. Also during mining tiles above this tile checks for entities colliding with this tile and prevents mining if such are found.
15878
+ */
15879
+ readonly check_collision_with_entities: boolean
15880
+
15782
15881
  /**
15783
15882
  * The collision mask this tile uses
15784
15883
  */
@@ -15824,7 +15923,7 @@ interface LuaTilePrototype {
15824
15923
  /**
15825
15924
  * The next direction of this tile or `nil` - used when a tile has multiple directions (such as hazard concrete)
15826
15925
  */
15827
- readonly next_direction: LuaTilePrototype
15926
+ readonly next_direction?: LuaTilePrototype
15828
15927
 
15829
15928
  /**
15830
15929
  * 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.
@@ -15947,7 +16046,7 @@ interface LuaTrain {
15947
16046
  /**
15948
16047
  * The back stock of this train or `nil`.
15949
16048
  */
15950
- readonly back_stock: LuaEntity
16049
+ readonly back_stock?: LuaEntity
15951
16050
 
15952
16051
  /**
15953
16052
  * The cargo carriages the train contains.
@@ -15972,7 +16071,7 @@ interface LuaTrain {
15972
16071
  /**
15973
16072
  * The front stock of this train or `nil`.
15974
16073
  */
15975
- readonly front_stock: LuaEntity
16074
+ readonly front_stock?: LuaEntity
15976
16075
 
15977
16076
  /**
15978
16077
  * If this train has a path.
@@ -15991,6 +16090,7 @@ interface LuaTrain {
15991
16090
 
15992
16091
  /**
15993
16092
  * The players killed by this train.
16093
+ *
15994
16094
  * The keys are the player indices, the values are how often this train killed that player.
15995
16095
  */
15996
16096
  readonly killed_players: {[key: number]: number}
@@ -16031,17 +16131,17 @@ interface LuaTrain {
16031
16131
  /**
16032
16132
  * The path this train is using or `nil` if none.
16033
16133
  */
16034
- readonly path: LuaRailPath
16134
+ readonly path?: LuaRailPath
16035
16135
 
16036
16136
  /**
16037
16137
  * The destination rail this train is currently pathing to or `nil`.
16038
16138
  */
16039
- readonly path_end_rail: LuaEntity
16139
+ readonly path_end_rail?: LuaEntity
16040
16140
 
16041
16141
  /**
16042
16142
  * The destination train stop this train is currently pathing to or `nil`.
16043
16143
  */
16044
- readonly path_end_stop: LuaEntity
16144
+ readonly path_end_stop?: LuaEntity
16045
16145
 
16046
16146
  readonly rail_direction_from_back_rail: defines.rail_direction
16047
16147
 
@@ -16058,12 +16158,12 @@ interface LuaTrain {
16058
16158
  * The schedule can't be changed by modifying the returned table. Instead, changes must be made by assigning a new table to this attribute.
16059
16159
  *
16060
16160
  */
16061
- schedule: TrainSchedule
16161
+ schedule?: TrainSchedule
16062
16162
 
16063
16163
  /**
16064
16164
  * The signal this train is arriving or waiting at or `nil` if none.
16065
16165
  */
16066
- readonly signal: LuaEntity
16166
+ readonly signal?: LuaEntity
16067
16167
 
16068
16168
  /**
16069
16169
  * Current speed.
@@ -16081,7 +16181,7 @@ interface LuaTrain {
16081
16181
  /**
16082
16182
  * The train stop this train is stopped at or `nil`.
16083
16183
  */
16084
- readonly station: LuaEntity
16184
+ readonly station?: LuaEntity
16085
16185
 
16086
16186
  /**
16087
16187
  * 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.
@@ -16426,12 +16526,12 @@ interface LuaUnitGroup {
16426
16526
  /**
16427
16527
  * The command given to this group or `nil` is the group has no command.
16428
16528
  */
16429
- readonly command: Command
16529
+ readonly command?: Command
16430
16530
 
16431
16531
  /**
16432
16532
  * The distraction command given to this group or `nil` is the group currently isn't distracted.
16433
16533
  */
16434
- readonly distraction_command: Command
16534
+ readonly distraction_command?: Command
16435
16535
 
16436
16536
  /**
16437
16537
  * The force of this unit group.