factorio-types 1.2.24 → 1.2.25

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 2.0.33
5
+ // Factorio version 2.0.37
6
6
  // API version 6
7
7
 
8
8
  declare namespace runtime {
@@ -563,6 +563,24 @@ interface LuaBootstrap {
563
563
  script.on_event(defines.events.on_built_entity,
564
564
  function(event) game.print("Gotta go fast!") end,
565
565
  {{filter = "name", name = "fast-inserter"}})
566
+ ```
567
+ */
568
+ on_event(this: void, event: defines.events.on_cargo_pod_delivered_cargo, handler: ((this: void, arg0: runtime.on_cargo_pod_delivered_cargo) => any) | nil, filters?: EventFilter): void;
569
+ /**
570
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
571
+ * @param event The event(s) or custom-input to invoke the handler on.
572
+ * @param handler The handler for this event. Passing `nil` will unregister it.
573
+ * @param filters The filters for this event. Can only be used when registering for individual events.
574
+ * @example ```
575
+ -- Register for the on_tick event to print the current tick to console each tick
576
+ script.on_event(defines.events.on_tick,
577
+ function(event) game.print(event.tick) end)
578
+ ```
579
+ * @example ```
580
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
581
+ script.on_event(defines.events.on_built_entity,
582
+ function(event) game.print("Gotta go fast!") end,
583
+ {{filter = "name", name = "fast-inserter"}})
566
584
  ```
567
585
  */
568
586
  on_event(this: void, event: defines.events.on_cargo_pod_finished_ascending, handler: ((this: void, arg0: runtime.on_cargo_pod_finished_ascending) => any) | nil, filters?: EventFilter): void;
@@ -581,6 +599,24 @@ interface LuaBootstrap {
581
599
  script.on_event(defines.events.on_built_entity,
582
600
  function(event) game.print("Gotta go fast!") end,
583
601
  {{filter = "name", name = "fast-inserter"}})
602
+ ```
603
+ */
604
+ on_event(this: void, event: defines.events.on_cargo_pod_finished_descending, handler: ((this: void, arg0: runtime.on_cargo_pod_finished_descending) => any) | nil, filters?: EventFilter): void;
605
+ /**
606
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
607
+ * @param event The event(s) or custom-input to invoke the handler on.
608
+ * @param handler The handler for this event. Passing `nil` will unregister it.
609
+ * @param filters The filters for this event. Can only be used when registering for individual events.
610
+ * @example ```
611
+ -- Register for the on_tick event to print the current tick to console each tick
612
+ script.on_event(defines.events.on_tick,
613
+ function(event) game.print(event.tick) end)
614
+ ```
615
+ * @example ```
616
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
617
+ script.on_event(defines.events.on_built_entity,
618
+ function(event) game.print("Gotta go fast!") end,
619
+ {{filter = "name", name = "fast-inserter"}})
584
620
  ```
585
621
  */
586
622
  on_event(this: void, event: defines.events.on_character_corpse_expired, handler: ((this: void, arg0: runtime.on_character_corpse_expired) => any) | nil, filters?: EventFilter): void;
@@ -1499,6 +1535,24 @@ interface LuaBootstrap {
1499
1535
  script.on_event(defines.events.on_built_entity,
1500
1536
  function(event) game.print("Gotta go fast!") end,
1501
1537
  {{filter = "name", name = "fast-inserter"}})
1538
+ ```
1539
+ */
1540
+ on_event(this: void, event: defines.events.on_multiplayer_init, handler: ((this: void, arg0: runtime.on_multiplayer_init) => any) | nil, filters?: EventFilter): void;
1541
+ /**
1542
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
1543
+ * @param event The event(s) or custom-input to invoke the handler on.
1544
+ * @param handler The handler for this event. Passing `nil` will unregister it.
1545
+ * @param filters The filters for this event. Can only be used when registering for individual events.
1546
+ * @example ```
1547
+ -- Register for the on_tick event to print the current tick to console each tick
1548
+ script.on_event(defines.events.on_tick,
1549
+ function(event) game.print(event.tick) end)
1550
+ ```
1551
+ * @example ```
1552
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
1553
+ script.on_event(defines.events.on_built_entity,
1554
+ function(event) game.print("Gotta go fast!") end,
1555
+ {{filter = "name", name = "fast-inserter"}})
1502
1556
  ```
1503
1557
  */
1504
1558
  on_event(this: void, event: defines.events.on_object_destroyed, handler: ((this: void, arg0: runtime.on_object_destroyed) => any) | nil, filters?: EventFilter): void;
@@ -3425,6 +3479,24 @@ interface LuaBootstrap {
3425
3479
  script.on_event(defines.events.on_built_entity,
3426
3480
  function(event) game.print("Gotta go fast!") end,
3427
3481
  {{filter = "name", name = "fast-inserter"}})
3482
+ ```
3483
+ */
3484
+ on_event(this: void, event: defines.events.on_singleplayer_init, handler: ((this: void, arg0: runtime.on_singleplayer_init) => any) | nil, filters?: EventFilter): void;
3485
+ /**
3486
+ * Register a handler to run on the specified event(s). Each mod can only register once for every event, as any additional registration will overwrite the previous one. This holds true even if different filters are used for subsequent registrations.
3487
+ * @param event The event(s) or custom-input to invoke the handler on.
3488
+ * @param handler The handler for this event. Passing `nil` will unregister it.
3489
+ * @param filters The filters for this event. Can only be used when registering for individual events.
3490
+ * @example ```
3491
+ -- Register for the on_tick event to print the current tick to console each tick
3492
+ script.on_event(defines.events.on_tick,
3493
+ function(event) game.print(event.tick) end)
3494
+ ```
3495
+ * @example ```
3496
+ -- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
3497
+ script.on_event(defines.events.on_built_entity,
3498
+ function(event) game.print("Gotta go fast!") end,
3499
+ {{filter = "name", name = "fast-inserter"}})
3428
3500
  ```
3429
3501
  */
3430
3502
  on_event(this: void, event: defines.events.on_space_platform_built_entity, handler: ((this: void, arg0: runtime.on_space_platform_built_entity) => any) | nil, filters?: EventFilter): void;
@@ -4163,7 +4235,8 @@ interface LuaBootstrap {
4163
4235
  * The metatable first needs to be defined in the mod's root scope, then registered using this method. From then on, it will be properly restored for tables in {@link storage | runtime:storage}.
4164
4236
  *
4165
4237
  * ```
4166
- * local metatable = {
4238
+ * local metatable =
4239
+ * {
4167
4240
  * __index = function(key)
4168
4241
  * return "no value for key " .. key
4169
4242
  * end
@@ -4393,6 +4466,28 @@ interface LuaBurnerUsagePrototype extends LuaPrototypeBase {
4393
4466
  */
4394
4467
  readonly valid: boolean;
4395
4468
  }
4469
+ /**
4470
+ * A cargo hatch.
4471
+ */
4472
+ interface LuaCargoHatch {
4473
+ /**
4474
+ * Creates a cargo pod for output at the owning entity hatch location.
4475
+ */
4476
+ create_cargo_pod(this: void): LuaEntity;
4477
+ readonly busy: boolean;
4478
+ readonly is_input_compatible: boolean;
4479
+ readonly is_output_compatible: boolean;
4480
+ /**
4481
+ * 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.
4482
+ */
4483
+ readonly object_name: string;
4484
+ readonly owner: LuaEntity;
4485
+ readonly reserved: boolean;
4486
+ /**
4487
+ * 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.
4488
+ */
4489
+ readonly valid: boolean;
4490
+ }
4396
4491
  /**
4397
4492
  * Control behavior for cargo landing pad.
4398
4493
  */
@@ -5664,6 +5759,13 @@ interface LuaEntity extends LuaControl {
5664
5759
  * You can play the building sound to go with it by using {@link LuaSurface::play_sound | runtime:LuaSurface::play_sound}, eg: `entity.surface.play_sound{path="entity-build/"..entity.prototype.name, position=entity.position}`
5665
5760
  */
5666
5761
  create_build_effect_smoke(this: void): void;
5762
+ /**
5763
+ * Creates a cargo pod if possible.
5764
+ *
5765
+ * Cargo pod will be created with {@link invalid | runtime:defines.cargo_destination.invalid} destination type. Setting {@link cargo_pod_destination | runtime:LuaEntity::cargo_pod_destination} will cause it to launch.
5766
+ * @param cargo_hatch The hatch to create the pod at. A random (available) one is picked if not provided.
5767
+ */
5768
+ create_cargo_pod(this: void, cargo_hatch?: LuaCargoHatch): LuaEntity | null;
5667
5769
  /**
5668
5770
  * Damages the entity.
5669
5771
  * @param damage The amount of damage to be done.
@@ -6159,7 +6261,7 @@ interface LuaEntity extends LuaControl {
6159
6261
  * Plays a note with the given instrument and note.
6160
6262
  * @returns Whether the request is valid. The sound may or may not be played depending on polyphony settings.
6161
6263
  */
6162
- play_note(this: void, instrument: uint, note: uint): boolean;
6264
+ play_note(this: void, instrument: uint, note: uint, stop_playing_sounds?: boolean): boolean;
6163
6265
  /**
6164
6266
  * Release the unit from the spawner which spawned it. This allows the spawner to continue spawning additional units.
6165
6267
  */
@@ -6381,6 +6483,10 @@ interface LuaEntity extends LuaControl {
6381
6483
  * A character associated with a player is not directly controlled by any player.
6382
6484
  */
6383
6485
  associated_player?: LuaPlayer | PlayerIdentification;
6486
+ /**
6487
+ * The cargo pod attached to this rocket silo rocket if any.
6488
+ */
6489
+ readonly attached_cargo_pod?: LuaEntity;
6384
6490
  /**
6385
6491
  * Destination of this spidertron's autopilot, if any. Writing `nil` clears all destinations.
6386
6492
  */
@@ -6438,6 +6544,20 @@ interface LuaEntity extends LuaControl {
6438
6544
  * The burner energy source for this entity, if any.
6439
6545
  */
6440
6546
  readonly burner?: LuaBurner;
6547
+ /**
6548
+ * The cargo hatches owned by this entity if any.
6549
+ */
6550
+ readonly cargo_hatches: LuaCargoHatch[];
6551
+ /**
6552
+ * The destination of this cargo pod entity.
6553
+ *
6554
+ * Use {@link force_finish_ascending | runtime:LuaEntity::force_finish_ascending} if you want it to only descend from orbit.
6555
+ */
6556
+ cargo_pod_destination: CargoDestination;
6557
+ /**
6558
+ * The state of this cargo pod entity.
6559
+ */
6560
+ readonly cargo_pod_state: 'awaiting_launch' | 'ascending' | 'surface_transition' | 'descending' | 'parking';
6441
6561
  /**
6442
6562
  * The state of this chain signal.
6443
6563
  */
@@ -6826,6 +6946,10 @@ interface LuaEntity extends LuaControl {
6826
6946
  * Can also be used on entity ghost if it contains linked-belt.
6827
6947
  */
6828
6948
  linked_belt_type: 'input' | 'output';
6949
+ /**
6950
+ * The belt stack size override for this loader. Set to `0` to disable. Writing this value requires {@link LoaderPrototype::adjustable_belt_stack_size | prototype:LoaderPrototype::adjustable_belt_stack_size} to be `true`.
6951
+ */
6952
+ loader_belt_stack_size_override: uint8;
6829
6953
  /**
6830
6954
  * The container entity this loader is pointing at/pulling from depending on the {@link LuaEntity::loader_type | runtime:LuaEntity::loader_type}, if any.
6831
6955
  */
@@ -7045,6 +7169,10 @@ interface LuaEntity extends LuaControl {
7045
7169
  * Get the current queue of robot orders.
7046
7170
  */
7047
7171
  readonly robot_order_queue: WorkerRobotOrder[];
7172
+ /**
7173
+ * The rocket silo rocket this cargo pod is attached to, or rocket silo rocket attached to this rocket silo - if any.
7174
+ */
7175
+ readonly rocket?: LuaEntity;
7048
7176
  /**
7049
7177
  * Number of rocket parts in the silo.
7050
7178
  */
@@ -7150,7 +7278,7 @@ interface LuaEntity extends LuaControl {
7150
7278
  */
7151
7279
  readonly supports_direction: boolean;
7152
7280
  /**
7153
- * The tags associated with this entity ghost. `nil` if this is not an entity ghost.
7281
+ * The tags associated with this entity ghost. `nil` if this is not an entity ghost or when the ghost has no tags.
7154
7282
  */
7155
7283
  tags?: Tags;
7156
7284
  /**
@@ -7887,6 +8015,14 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7887
8015
  * The light blinking speed for this rocket silo prototype.
7888
8016
  */
7889
8017
  readonly light_blinking_speed?: double;
8018
+ /**
8019
+ * True if this loader supports a runtime-adjustable belt stack size.
8020
+ */
8021
+ readonly loader_adjustable_belt_stack_size?: boolean;
8022
+ /**
8023
+ * The max belt stack size for this loader.
8024
+ */
8025
+ readonly loader_max_belt_stack_size?: uint8;
7890
8026
  /**
7891
8027
  * The logistic mode of this logistic container.
7892
8028
  */
@@ -7953,6 +8089,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
7953
8089
  * How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.
7954
8090
  */
7955
8091
  readonly max_friends_around_to_spawn?: double;
8092
+ /**
8093
+ * The max number of item products this crafting machine prototype supports.
8094
+ */
8095
+ readonly max_item_product_count?: uint;
7956
8096
  /**
7957
8097
  * The max payload size of this logistics or construction robot.
7958
8098
  */
@@ -9282,7 +9422,7 @@ interface LuaForce {
9282
9422
  *
9283
9423
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this force.
9284
9424
  * @param table.path The sound to play.
9285
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
9425
+ * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
9286
9426
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
9287
9427
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
9288
9428
  */
@@ -9624,6 +9764,51 @@ interface LuaFuelCategoryPrototype extends LuaPrototypeBase {
9624
9764
  */
9625
9765
  readonly valid: boolean;
9626
9766
  }
9767
+ /**
9768
+ * Control behavior for furnaces.
9769
+ */
9770
+ interface LuaFurnaceControlBehavior extends LuaGenericOnOffControlBehavior {
9771
+ /**
9772
+ * `true` if the furnace reads its ingredients contents, product contents and materials in crafting.
9773
+ */
9774
+ circuit_read_contents: boolean;
9775
+ /**
9776
+ * `true` if the furnace outputs ingredients of current recipe as a signals to circuit network.
9777
+ */
9778
+ circuit_read_ingredients: boolean;
9779
+ /**
9780
+ * `true` if the the furnace sends a signal when the recipe finishes.
9781
+ */
9782
+ circuit_read_recipe_finished: boolean;
9783
+ /**
9784
+ * `true` if the the furnace sends a signal when it is working.
9785
+ */
9786
+ circuit_read_working: boolean;
9787
+ /**
9788
+ * The signal sent when the furnace finishes a recipe.
9789
+ */
9790
+ circuit_recipe_finished_signal?: SignalID;
9791
+ /**
9792
+ * The signal sent when the furnace is working.
9793
+ */
9794
+ circuit_working_signal?: SignalID;
9795
+ /**
9796
+ * `true` if the read contents should include fuel (content of energy source)
9797
+ */
9798
+ include_fuel: boolean;
9799
+ /**
9800
+ * `true` if the read contents should include items in crafting.
9801
+ */
9802
+ include_in_crafting: boolean;
9803
+ /**
9804
+ * 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.
9805
+ */
9806
+ readonly object_name: string;
9807
+ /**
9808
+ * 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.
9809
+ */
9810
+ readonly valid: boolean;
9811
+ }
9627
9812
  /**
9628
9813
  * Main toplevel type, provides access to most of the API though its members. An instance of LuaGameScript is available as the global object named `game`.
9629
9814
  */
@@ -9783,7 +9968,7 @@ interface LuaGameScript {
9783
9968
  *
9784
9969
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
9785
9970
  * @param table.path The sound to play.
9786
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
9971
+ * @param table.position Where the sound should be played. If not given, it's played globally on each player's controller's surface.
9787
9972
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
9788
9973
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
9789
9974
  */
@@ -12352,7 +12537,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
12352
12537
  */
12353
12538
  readonly valid: boolean;
12354
12539
  /**
12355
- * Weight of this item
12540
+ * Weight of this item. More information on how item weight is determined can be found on its {@link auxiliary page | runtime:item-weight}.
12356
12541
  */
12357
12542
  readonly weight: double;
12358
12543
  }
@@ -13590,7 +13775,7 @@ interface LuaPlayer extends LuaControl {
13590
13775
  *
13591
13776
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for this player.
13592
13777
  * @param table.path The sound to play.
13593
- * @param table.position Where the sound should be played. If not given, it's played at the current position of the player.
13778
+ * @param table.position Where the sound should be played. If not given, it's played globally on the player's controller's surface.
13594
13779
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
13595
13780
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
13596
13781
  */
@@ -15027,9 +15212,13 @@ interface LuaRecord {
15027
15212
  */
15028
15213
  blueprint_snap_to_grid?: TilePosition;
15029
15214
  /**
15030
- * The contents of this BlueprintBookRecord.
15215
+ * The contents of this BlueprintBookRecord. This is sparse array - it may have gaps, so using `#` will not be reliable. Use {@link LuaRecord::contents_size | runtime:LuaRecord::contents_size} or `pairs()` to iterate this table.
15216
+ */
15217
+ readonly contents: LuaTable<ItemStackIndex, LuaRecord>;
15218
+ /**
15219
+ * The highest populated index in the contents of this BlueprintBookRecord.
15031
15220
  */
15032
- readonly contents: LuaRecord[];
15221
+ readonly contents_size: ItemStackIndex;
15033
15222
  /**
15034
15223
  * List of raw materials required to build this blueprint.
15035
15224
  */
@@ -15062,6 +15251,10 @@ interface LuaRecord {
15062
15251
  * 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.
15063
15252
  */
15064
15253
  readonly object_name: string;
15254
+ /**
15255
+ * The preview icons for this record.
15256
+ */
15257
+ preview_icons: BlueprintSignalIcon[];
15065
15258
  /**
15066
15259
  * The number of tile filters this deconstruction planner supports.
15067
15260
  */
@@ -15752,6 +15945,122 @@ interface LuaRocketSiloControlBehavior extends LuaControlBehavior {
15752
15945
  */
15753
15946
  readonly valid: boolean;
15754
15947
  }
15948
+ /**
15949
+ * The schedule of a particular {@link LuaTrain | runtime:LuaTrain} or {@link LuaSpacePlatform | runtime:LuaSpacePlatform}.
15950
+ */
15951
+ interface LuaSchedule {
15952
+ /**
15953
+ * Activates the interrupt at the given index, if the index is valid.
15954
+ */
15955
+ activate_interrupt(this: void, index: uint): void;
15956
+ /**
15957
+ * Adds the given interrupt to the schedule if an interrupt with the given name does not already exist.
15958
+ */
15959
+ add_interrupt(this: void, interrupt: ScheduleInterrupt): void;
15960
+ /**
15961
+ * Adds a record to the end of the current schedule using the provided data.
15962
+ */
15963
+ add_record(this: void, data: AddRecordData): void;
15964
+ /**
15965
+ * Adds the given wait condition to the given record.
15966
+ */
15967
+ add_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint, type: WaitCondition): void;
15968
+ /**
15969
+ * Changes the interrupt at the given index to the provided values. Note, the names must match.
15970
+ */
15971
+ change_interrupt(this: void, index: uint, interrupt: ScheduleInterrupt): void;
15972
+ /**
15973
+ * Changes the wait condition on the given record to the new values.
15974
+ */
15975
+ change_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint, wait_condition: WaitCondition): void;
15976
+ /**
15977
+ * Copies the record from the given schedule at the given index into this schedule at the given index.
15978
+ */
15979
+ copy_record(this: void, source_schedule: LuaSchedule, source_index: uint, destination_index: uint): void;
15980
+ drag_interrupt(this: void, from: uint, to: uint): void;
15981
+ /**
15982
+ * @param interrupt_index The interrupt to operate on, if any.
15983
+ */
15984
+ drag_record(this: void, from: uint, to: uint, interrupt_index?: uint): void;
15985
+ /**
15986
+ * @param index The record to change.
15987
+ */
15988
+ drag_wait_condition(this: void, index: ScheduleRecordPosition, from: uint, to: uint): void;
15989
+ get_interrupt(this: void, index: uint): ScheduleInterrupt | null;
15990
+ get_record(this: void, index: ScheduleRecordPosition): ScheduleRecord | null;
15991
+ /**
15992
+ * If the given index is invalid, `nil` is returned.
15993
+ * @param interrupt_index If provided, the record count in this interrupt is read.
15994
+ */
15995
+ get_record_count(this: void, interrupt_index?: uint): uint | null;
15996
+ /**
15997
+ * Gets the wait condition at the given index if one exists.
15998
+ */
15999
+ get_wait_condition(this: void, schedule_index: ScheduleRecordPosition, condition_index: uint): WaitCondition | null;
16000
+ /**
16001
+ * The number of wait conditions in the given schedule record.
16002
+ */
16003
+ get_wait_condition_count(this: void, index: ScheduleRecordPosition): uint | null;
16004
+ /**
16005
+ * Gets the wait conditions at the given index if they exist.
16006
+ */
16007
+ get_wait_conditions(this: void, schedule_index: ScheduleRecordPosition): WaitCondition[] | null;
16008
+ /**
16009
+ * @param schedule_index The schedule index
16010
+ */
16011
+ go_to_station(this: void, schedule_index: uint): void;
16012
+ /**
16013
+ * Removes the interrupt at the given index, if the index is valid.
16014
+ */
16015
+ remove_interrupt(this: void, index: uint): void;
16016
+ /**
16017
+ * Removes the record at the given index, if the index is valid.
16018
+ */
16019
+ remove_record(this: void, index: ScheduleRecordPosition): void;
16020
+ /**
16021
+ * Removes the given wait condition from the given record.
16022
+ */
16023
+ remove_wait_condition(this: void, record_index: ScheduleRecordPosition, condition_index: uint): void;
16024
+ /**
16025
+ * @param old_name The interrupt to rename
16026
+ * @param new_name The new name - if it already exists, does nothing.
16027
+ */
16028
+ rename_interrupt(this: void, old_name: string, new_name: string): void;
16029
+ /**
16030
+ * Sets if unloading is allowed at the given schedule index.
16031
+ */
16032
+ set_allow_unloading(this: void, index: ScheduleRecordPosition, allow: boolean): void;
16033
+ set_stopped(this: void, stopped: boolean): void;
16034
+ /**
16035
+ * Sets the comparison on the given wait condition.
16036
+ * @param mode `"and"`, or `"or"`
16037
+ */
16038
+ set_wait_condition_mode(this: void, record_index: ScheduleRecordPosition, condition_index: uint, mode: string): void;
16039
+ readonly current: uint;
16040
+ /**
16041
+ * The group this schedule is part of, if any.
16042
+ */
16043
+ group?: string;
16044
+ readonly interrupt_count: uint;
16045
+ /**
16046
+ * 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.
16047
+ */
16048
+ readonly object_name: string;
16049
+ /**
16050
+ * The owner of this schedule.
16051
+ */
16052
+ readonly owner?: LuaTrain | LuaSpacePlatform;
16053
+ /**
16054
+ * Note: when writing, value must not be larger than LuaGameScript::tick
16055
+ */
16056
+ tick_of_last_activity: MapTick;
16057
+ readonly tick_of_last_schedule_change: MapTick;
16058
+ readonly ticks_in_station: MapTick;
16059
+ /**
16060
+ * 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.
16061
+ */
16062
+ readonly valid: boolean;
16063
+ }
15755
16064
  /**
15756
16065
  * Control behavior for selector combinators.
15757
16066
  */
@@ -16009,6 +16318,10 @@ interface LuaSpacePlatform {
16009
16318
  * @returns The platform hub.
16010
16319
  */
16011
16320
  apply_starter_pack(this: void): LuaEntity | null;
16321
+ /**
16322
+ * Returns `true` when the space platform isn't waiting on any delivery from the planet.
16323
+ */
16324
+ can_leave_current_location(this: void): boolean;
16012
16325
  /**
16013
16326
  * Cancels deletion of this space platform if it was scheduled for deletion.
16014
16327
  */
@@ -16058,6 +16371,7 @@ interface LuaSpacePlatform {
16058
16371
  limit?: uint;
16059
16372
  invert?: boolean;
16060
16373
  }): AsteroidChunk[];
16374
+ get_schedule(this: void): LuaSchedule;
16061
16375
  /**
16062
16376
  * Repairs the given tile if it's damaged.
16063
16377
  */
@@ -16069,6 +16383,12 @@ interface LuaSpacePlatform {
16069
16383
  position: TilePosition;
16070
16384
  damage: float;
16071
16385
  }[];
16386
+ /**
16387
+ * The point on space connection this platform is at or `nil`.
16388
+ *
16389
+ * It is represented as a number in range `[0, 1]`, with 0 being {@link LuaSpaceConnectionPrototype::from | runtime:LuaSpaceConnectionPrototype::from} and 1 being {@link LuaSpaceConnectionPrototype::to | runtime:LuaSpaceConnectionPrototype::to}.
16390
+ */
16391
+ distance?: double;
16072
16392
  /**
16073
16393
  * The force of this space platform.
16074
16394
  */
@@ -16111,10 +16431,18 @@ interface LuaSpacePlatform {
16111
16431
  * Returns how many ticks are left before the platform will be deleted. 0 if not scheduled for deletion.
16112
16432
  */
16113
16433
  readonly scheduled_for_deletion: uint;
16434
+ /**
16435
+ * The space connection this space platform is traveling through or `nil`.
16436
+ *
16437
+ * Write operation requires a valid space connection and it sets the distance to 0.5.
16438
+ */
16439
+ space_connection?: LuaSpaceConnectionPrototype;
16114
16440
  /**
16115
16441
  * The space location this space platform is stopped at or `nil`.
16442
+ *
16443
+ * Write operation requires a valid space location and will cancel pending item requests.
16116
16444
  */
16117
- readonly space_location?: LuaSpaceLocationPrototype;
16445
+ space_location?: LuaSpaceLocationPrototype;
16118
16446
  speed: double;
16119
16447
  /**
16120
16448
  * The starter pack used to create this space platform.
@@ -17016,7 +17344,7 @@ interface LuaSurface {
17016
17344
  *
17017
17345
  * The sound is not played if its location is not {@link charted | runtime:LuaForce::chart} for that player.
17018
17346
  * @param table.path The sound to play.
17019
- * @param table.position Where the sound should be played. If not given, it's played at the current position of each player.
17347
+ * @param table.position Where the sound should be played. If not given, it's played globally on this surface.
17020
17348
  * @param table.volume_modifier The volume of the sound to play. Must be between 0 and 1 inclusive.
17021
17349
  * @param table.override_sound_type The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
17022
17350
  */
@@ -18207,6 +18535,7 @@ interface LuaTrain {
18207
18535
  * Gets all rails under the train.
18208
18536
  */
18209
18537
  get_rails(this: void): LuaEntity[];
18538
+ get_schedule(this: void): LuaSchedule;
18210
18539
  /**
18211
18540
  * Go to the station specified by the index in the train's schedule.
18212
18541
  */
@@ -18522,6 +18851,13 @@ interface LuaTransportLine {
18522
18851
  * Remove all items from this transport line.
18523
18852
  */
18524
18853
  clear(this: void): void;
18854
+ /**
18855
+ * Force insert item at a given position. Inserts item onto a transport line. If a position is out of range, it is clamped to a closest valid position on the transport line. Item will be inserted regardless of other items nearby, possibly forcing items to become squashed.
18856
+ * @param position Where on the line to insert the items.
18857
+ * @param items Items to insert.
18858
+ * @param belt_stack_size Maximum size of stack created on belt
18859
+ */
18860
+ force_insert_at(this: void, position: float, items: ItemStackIdentification, belt_stack_size?: uint8): void;
18525
18861
  /**
18526
18862
  * Get counts of all items on this line, similar to how {@link LuaInventory::get_contents | runtime:LuaInventory::get_contents} does.
18527
18863
  * @returns List of all items on this line.