factorio-types 1.2.38 → 1.2.40
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 +295 -16
- package/dist/concepts.d.ts +82 -10
- package/dist/datacollection.d.ts +1 -1
- package/dist/defines.d.ts +290 -283
- package/dist/events.d.ts +38 -1
- package/dist/global.d.ts +1 -1
- package/dist/prototypes.d.ts +157 -9
- package/dist/types.d.ts +29 -10
- package/package.json +2 -2
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.
|
|
5
|
+
// Factorio version 2.0.57
|
|
6
6
|
// API version 6
|
|
7
7
|
|
|
8
8
|
declare namespace runtime {
|
|
@@ -297,6 +297,7 @@ interface LuaAssemblingMachineControlBehavior extends LuaGenericOnOffControlBeha
|
|
|
297
297
|
* Prototype of an asteroid chunk.
|
|
298
298
|
*/
|
|
299
299
|
interface LuaAsteroidChunkPrototype extends LuaPrototypeBase {
|
|
300
|
+
readonly dying_trigger_effect?: TriggerEffectItem[];
|
|
300
301
|
/**
|
|
301
302
|
* An alternative prototype that will be used to display info about this prototype in Factoriopedia.
|
|
302
303
|
*/
|
|
@@ -3146,6 +3147,24 @@ interface LuaBootstrap {
|
|
|
3146
3147
|
script.on_event(defines.events.on_built_entity,
|
|
3147
3148
|
function(event) game.print("Gotta go fast!") end,
|
|
3148
3149
|
{{filter = "name", name = "fast-inserter"}})
|
|
3150
|
+
```
|
|
3151
|
+
*/
|
|
3152
|
+
on_event(this: void, event: defines.events.on_research_queued, handler: ((this: void, arg0: runtime.on_research_queued) => any) | nil, filters?: EventFilter): void;
|
|
3153
|
+
/**
|
|
3154
|
+
* 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.
|
|
3155
|
+
* @param event The event(s) or custom-input to invoke the handler on.
|
|
3156
|
+
* @param handler The handler for this event. Passing `nil` will unregister it.
|
|
3157
|
+
* @param filters The filters for this event. Can only be used when registering for individual events.
|
|
3158
|
+
* @example ```
|
|
3159
|
+
-- Register for the on_tick event to print the current tick to console each tick
|
|
3160
|
+
script.on_event(defines.events.on_tick,
|
|
3161
|
+
function(event) game.print(event.tick) end)
|
|
3162
|
+
```
|
|
3163
|
+
* @example ```
|
|
3164
|
+
-- Register for the on_built_entity event, limiting it to only be received when a `"fast-inserter"` is built
|
|
3165
|
+
script.on_event(defines.events.on_built_entity,
|
|
3166
|
+
function(event) game.print("Gotta go fast!") end,
|
|
3167
|
+
{{filter = "name", name = "fast-inserter"}})
|
|
3149
3168
|
```
|
|
3150
3169
|
*/
|
|
3151
3170
|
on_event(this: void, event: defines.events.on_research_reversed, handler: ((this: void, arg0: runtime.on_research_reversed) => any) | nil, filters?: EventFilter): void;
|
|
@@ -5716,6 +5735,12 @@ interface LuaEntity extends LuaControl {
|
|
|
5716
5735
|
* Whether the entity can be destroyed
|
|
5717
5736
|
*/
|
|
5718
5737
|
can_be_destroyed(this: void): boolean;
|
|
5738
|
+
/**
|
|
5739
|
+
* The same as {@link LuaInventory::can_set_filter | runtime:LuaInventory::can_set_filter} but also works for ghosts.
|
|
5740
|
+
* @param index The item stack index
|
|
5741
|
+
* @param filter The item filter
|
|
5742
|
+
*/
|
|
5743
|
+
can_set_inventory_filter(this: void, inventory_index: defines.inventory, index: uint, filter: ItemFilter): boolean;
|
|
5719
5744
|
/**
|
|
5720
5745
|
* Whether this character can shoot the given entity or position.
|
|
5721
5746
|
*/
|
|
@@ -5996,6 +6021,16 @@ interface LuaEntity extends LuaControl {
|
|
|
5996
6021
|
* Gets the filter for this infinity pipe, or `nil` if the filter is empty.
|
|
5997
6022
|
*/
|
|
5998
6023
|
get_infinity_pipe_filter(this: void): InfinityPipeFilter | null;
|
|
6024
|
+
/**
|
|
6025
|
+
* The same as {@link LuaInventory::get_bar | runtime:LuaInventory::get_bar} but also works for ghosts.
|
|
6026
|
+
*/
|
|
6027
|
+
get_inventory_bar(this: void, inventory_index: defines.inventory): uint;
|
|
6028
|
+
/**
|
|
6029
|
+
* The same as {@link LuaInventory::get_filter | runtime:LuaInventory::get_filter} but also works for ghosts.
|
|
6030
|
+
* @param index The item stack index
|
|
6031
|
+
* @returns The current filter or `nil` if none.
|
|
6032
|
+
*/
|
|
6033
|
+
get_inventory_filter(this: void, inventory_index: defines.inventory, index: uint): ItemFilter | null;
|
|
5999
6034
|
/**
|
|
6000
6035
|
* Gets the inventory size override of the selected inventory if size override was set using {@link set_inventory_size_override | runtime:LuaEntity::set_inventory_size_override}.
|
|
6001
6036
|
*/
|
|
@@ -6204,6 +6239,14 @@ interface LuaEntity extends LuaControl {
|
|
|
6204
6239
|
* @returns Amount of fluid actually inserted.
|
|
6205
6240
|
*/
|
|
6206
6241
|
insert_fluid(this: void, fluid: Fluid): double;
|
|
6242
|
+
/**
|
|
6243
|
+
* The same as {@link LuaInventory::supports_bar | runtime:LuaInventory::supports_bar} but also works for ghosts.
|
|
6244
|
+
*/
|
|
6245
|
+
inventory_supports_bar(this: void, inventory_index: defines.inventory): boolean;
|
|
6246
|
+
/**
|
|
6247
|
+
* The same as {@link LuaInventory::supports_filters | runtime:LuaInventory::supports_filters} but also works for ghosts.
|
|
6248
|
+
*/
|
|
6249
|
+
inventory_supports_filters(this: void, inventory_index: defines.inventory): boolean;
|
|
6207
6250
|
/**
|
|
6208
6251
|
* @returns `true` if this gate is currently closed.
|
|
6209
6252
|
*/
|
|
@@ -6220,6 +6263,10 @@ interface LuaEntity extends LuaControl {
|
|
|
6220
6263
|
* Returns whether a craft is currently in process. It does not indicate whether progress is currently being made, but whether a crafting process has been started in this machine.
|
|
6221
6264
|
*/
|
|
6222
6265
|
is_crafting(this: void): boolean;
|
|
6266
|
+
/**
|
|
6267
|
+
* The same as {@link LuaInventory::is_filtered | runtime:LuaInventory::is_filtered} but also works for ghosts.
|
|
6268
|
+
*/
|
|
6269
|
+
is_inventory_filtered(this: void, inventory_index: defines.inventory): boolean;
|
|
6223
6270
|
/**
|
|
6224
6271
|
* @returns `true` if this gate is currently opened.
|
|
6225
6272
|
*/
|
|
@@ -6378,7 +6425,7 @@ interface LuaEntity extends LuaControl {
|
|
|
6378
6425
|
* This differs from {@link LuaEntity::set_passenger | runtime:LuaEntity::set_passenger} in that the passenger can't drive the vehicle.
|
|
6379
6426
|
* @param driver The new driver. Writing `nil` ejects the current driver, if any.
|
|
6380
6427
|
*/
|
|
6381
|
-
set_driver(this: void, driver
|
|
6428
|
+
set_driver(this: void, driver: LuaEntity | PlayerIdentification | nil): void;
|
|
6382
6429
|
/**
|
|
6383
6430
|
* Set the filter for a slot in an inserter (ItemFilter), loader (ItemFilter), mining drill (EntityID), asteroid collector (AsteroidChunkID) or logistic storage container (ItemWithQualityID). The entity must allow filters.
|
|
6384
6431
|
* @param index Index of the slot to set the filter for.
|
|
@@ -6410,6 +6457,18 @@ interface LuaEntity extends LuaControl {
|
|
|
6410
6457
|
* @param filter The new filter, or `nil` to clear the filter.
|
|
6411
6458
|
*/
|
|
6412
6459
|
set_infinity_pipe_filter(this: void, filter: InfinityPipeFilter | nil): void;
|
|
6460
|
+
/**
|
|
6461
|
+
* The same as {@link LuaInventory::set_bar | runtime:LuaInventory::set_bar} but also works for ghosts.
|
|
6462
|
+
* @param bar The new limit. Omitting this parameter or passing `nil` will clear the limit.
|
|
6463
|
+
*/
|
|
6464
|
+
set_inventory_bar(this: void, inventory_index: defines.inventory, bar?: uint): void;
|
|
6465
|
+
/**
|
|
6466
|
+
* The same as {@link LuaInventory::set_filter | runtime:LuaInventory::set_filter} but also works for ghosts.
|
|
6467
|
+
* @param index The item stack index.
|
|
6468
|
+
* @param filter The new filter. `nil` erases any existing filter.
|
|
6469
|
+
* @returns If the filter was allowed to be set.
|
|
6470
|
+
*/
|
|
6471
|
+
set_inventory_filter(this: void, inventory_index: defines.inventory, index: uint, filter: ItemFilter | nil): boolean;
|
|
6413
6472
|
/**
|
|
6414
6473
|
* Sets inventory size override. When set, supported entity will ignore inventory size from prototype and will instead keep inventory size equal to the override. Setting `nil` will restore default inventory size.
|
|
6415
6474
|
* @param overflow Items that would be deleted due to change of inventory size will be transferred to this inventory. Must be a script inventory or inventory of other entity. Inventory references obtained from proxy container are not allowed.
|
|
@@ -6421,7 +6480,7 @@ interface LuaEntity extends LuaControl {
|
|
|
6421
6480
|
* This differs from {@link LuaEntity::get_driver | runtime:LuaEntity::get_driver} in that the passenger can't drive the car.
|
|
6422
6481
|
* @param passenger The new passenger. Writing `nil` ejects the current passenger, if any.
|
|
6423
6482
|
*/
|
|
6424
|
-
set_passenger(this: void, passenger
|
|
6483
|
+
set_passenger(this: void, passenger: LuaEntity | PlayerIdentification | nil): void;
|
|
6425
6484
|
/**
|
|
6426
6485
|
* Set the entity ID name at the specified position in the turret's priority list.
|
|
6427
6486
|
* @param index The index of the entry to set.
|
|
@@ -6678,7 +6737,7 @@ interface LuaEntity extends LuaControl {
|
|
|
6678
6737
|
*/
|
|
6679
6738
|
consumption_modifier: float;
|
|
6680
6739
|
/**
|
|
6681
|
-
* If this
|
|
6740
|
+
* If this rolling stock has 'copy color from train stop' enabled.
|
|
6682
6741
|
*/
|
|
6683
6742
|
copy_color_from_train_stop: boolean;
|
|
6684
6743
|
/**
|
|
@@ -7120,6 +7179,14 @@ interface LuaEntity extends LuaControl {
|
|
|
7120
7179
|
*/
|
|
7121
7180
|
readonly owned_plants: LuaEntity[];
|
|
7122
7181
|
parameters: ProgrammableSpeakerParameters;
|
|
7182
|
+
/**
|
|
7183
|
+
* For inserters taking items from transport belt connectables, this determines whether the inserter is allowed to take items from the left lane.
|
|
7184
|
+
*/
|
|
7185
|
+
pickup_from_left_lane: boolean;
|
|
7186
|
+
/**
|
|
7187
|
+
* For inserters taking items from transport belt connectables, this determines whether the inserter is allowed to take items from the right lane.
|
|
7188
|
+
*/
|
|
7189
|
+
pickup_from_right_lane: boolean;
|
|
7123
7190
|
/**
|
|
7124
7191
|
* Where the inserter will pick up items from.
|
|
7125
7192
|
*
|
|
@@ -7510,11 +7577,17 @@ interface LuaEntity extends LuaControl {
|
|
|
7510
7577
|
*/
|
|
7511
7578
|
interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
7512
7579
|
/**
|
|
7513
|
-
* The crafting speed of this crafting-machine.
|
|
7580
|
+
* The crafting speed of this crafting-machine or character.
|
|
7514
7581
|
*/
|
|
7515
7582
|
get_crafting_speed(this: void, quality?: QualityID): double;
|
|
7516
7583
|
/**
|
|
7517
|
-
*
|
|
7584
|
+
* Gets the fluid capacity of this entity or 0 if this entity doesn't support fluids.
|
|
7585
|
+
*
|
|
7586
|
+
* Crafting machines will report 0 due to their fluid capacity being whatever a given recipe needs.
|
|
7587
|
+
*/
|
|
7588
|
+
get_fluid_capacity(this: void, quality?: QualityID): double;
|
|
7589
|
+
/**
|
|
7590
|
+
* The fluid usage of this generator or fusion reactor prototype.
|
|
7518
7591
|
*/
|
|
7519
7592
|
get_fluid_usage_per_tick(this: void, quality?: QualityID): double | null;
|
|
7520
7593
|
/**
|
|
@@ -7565,6 +7638,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7565
7638
|
* The maximum wire distance for this entity. 0 if the entity doesn't support wires.
|
|
7566
7639
|
*/
|
|
7567
7640
|
get_max_wire_distance(this: void, quality?: QualityID): double;
|
|
7641
|
+
/**
|
|
7642
|
+
* The mining radius of this mining drill prototype.
|
|
7643
|
+
*/
|
|
7644
|
+
get_mining_drill_radius(this: void, quality?: QualityID): double | null;
|
|
7568
7645
|
/**
|
|
7569
7646
|
* The pumping speed of this offshore or normal pump.
|
|
7570
7647
|
*/
|
|
@@ -7669,10 +7746,21 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7669
7746
|
* The animation speed coefficient of this belt connectable prototype.
|
|
7670
7747
|
*/
|
|
7671
7748
|
readonly animation_speed_coefficient?: double;
|
|
7749
|
+
readonly arm_angular_speed_cap_base?: float;
|
|
7750
|
+
readonly arm_angular_speed_cap_quality_scaling?: float;
|
|
7751
|
+
readonly arm_color_gradient?: Color[];
|
|
7752
|
+
readonly arm_count_base?: uint;
|
|
7753
|
+
readonly arm_count_quality_scaling?: uint;
|
|
7754
|
+
readonly arm_energy_usage?: double;
|
|
7755
|
+
readonly arm_inventory_size_quality_increase?: uint;
|
|
7756
|
+
readonly arm_slow_energy_usage?: double;
|
|
7757
|
+
readonly arm_speed_base?: float;
|
|
7758
|
+
readonly arm_speed_quality_scaling?: float;
|
|
7672
7759
|
/**
|
|
7673
7760
|
* The attack parameters for this entity, if any.
|
|
7674
7761
|
*/
|
|
7675
7762
|
readonly attack_parameters?: AttackParameters;
|
|
7763
|
+
readonly attack_reaction?: AttackReactionItem[];
|
|
7676
7764
|
/**
|
|
7677
7765
|
* The attack result of this entity, if any.
|
|
7678
7766
|
*/
|
|
@@ -7734,6 +7822,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7734
7822
|
* Whether this unit prototype can open gates.
|
|
7735
7823
|
*/
|
|
7736
7824
|
readonly can_open_gates?: boolean;
|
|
7825
|
+
readonly captured_spawner_entity?: LuaEntityPrototype;
|
|
7737
7826
|
/**
|
|
7738
7827
|
* The chain shooting cooldown modifier of this spider vehicle prototype.
|
|
7739
7828
|
*/
|
|
@@ -7747,6 +7836,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7747
7836
|
* The item prototype name used to destroy this cliff.
|
|
7748
7837
|
*/
|
|
7749
7838
|
readonly cliff_explosive_prototype?: string;
|
|
7839
|
+
readonly collection_box_offset?: float;
|
|
7750
7840
|
/**
|
|
7751
7841
|
* The bounding box used for collision checking.
|
|
7752
7842
|
*/
|
|
@@ -7827,6 +7917,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7827
7917
|
speed_from_center_deviation: float;
|
|
7828
7918
|
};
|
|
7829
7919
|
readonly damage_hit_tint?: Color;
|
|
7920
|
+
readonly damaged_trigger_effect?: TriggerEffectItem[];
|
|
7830
7921
|
/**
|
|
7831
7922
|
* Value between 0 and 1 darkness where all lamps of this lamp prototype are off.
|
|
7832
7923
|
*/
|
|
@@ -7835,6 +7926,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7835
7926
|
* Value between 0 and 1 darkness where all lamps of this lamp prototype are on.
|
|
7836
7927
|
*/
|
|
7837
7928
|
readonly darkness_for_all_lamps_on?: float;
|
|
7929
|
+
readonly deposit_radius?: float;
|
|
7838
7930
|
/**
|
|
7839
7931
|
* Whether this generator prototype destroys non-fuel fluids.
|
|
7840
7932
|
*/
|
|
@@ -7864,10 +7956,12 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7864
7956
|
*/
|
|
7865
7957
|
readonly drawing_box_vertical_extension: double;
|
|
7866
7958
|
readonly drop_item_distance?: uint;
|
|
7959
|
+
readonly dying_explosion?: ExplosionDefinition[];
|
|
7867
7960
|
/**
|
|
7868
7961
|
* The dying time of this corpse prototype.
|
|
7869
7962
|
*/
|
|
7870
7963
|
readonly dying_speed?: float;
|
|
7964
|
+
readonly dying_trigger_effect?: TriggerEffectItem[];
|
|
7871
7965
|
/**
|
|
7872
7966
|
* Effect receiver prototype of this crafting machine, lab, or mining drill.
|
|
7873
7967
|
*/
|
|
@@ -7904,6 +7998,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7904
7998
|
* The direct energy usage of this entity, if any.
|
|
7905
7999
|
*/
|
|
7906
8000
|
readonly energy_usage?: double;
|
|
8001
|
+
readonly energy_usage_quality_scaling?: float;
|
|
7907
8002
|
/**
|
|
7908
8003
|
* The engine starting speed for this rocket silo rocket prototype.
|
|
7909
8004
|
*/
|
|
@@ -7996,6 +8091,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
7996
8091
|
* Whether this unit, car, or character prototype has belt immunity.
|
|
7997
8092
|
*/
|
|
7998
8093
|
readonly has_belt_immunity?: boolean;
|
|
8094
|
+
readonly head_collection_radius?: float;
|
|
7999
8095
|
/**
|
|
8000
8096
|
* Amount this entity can heal per tick, if any.
|
|
8001
8097
|
*/
|
|
@@ -8016,6 +8112,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8016
8112
|
* The height of this spider vehicle prototype.
|
|
8017
8113
|
*/
|
|
8018
8114
|
readonly height?: double;
|
|
8115
|
+
readonly held_items_display_count?: uint8;
|
|
8116
|
+
readonly held_items_offset?: float;
|
|
8117
|
+
readonly held_items_spread?: float;
|
|
8118
|
+
readonly hide_resistances?: boolean;
|
|
8019
8119
|
/**
|
|
8020
8120
|
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
|
8021
8121
|
*/
|
|
@@ -8052,10 +8152,19 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8052
8152
|
* The instruments for this programmable speaker.
|
|
8053
8153
|
*/
|
|
8054
8154
|
readonly instruments?: ProgrammableSpeakerInstrument[];
|
|
8155
|
+
/**
|
|
8156
|
+
* Properties of custom inventory. Only provided if inventory_type is `"with_custom_stack_size"`.
|
|
8157
|
+
*/
|
|
8158
|
+
readonly inventory_properties?: InventoryWithCustomStackSizePrototype;
|
|
8159
|
+
readonly inventory_size_quality_increase?: uint;
|
|
8055
8160
|
/**
|
|
8056
8161
|
* The inventory type this container or linked container uses.
|
|
8057
8162
|
*/
|
|
8058
|
-
readonly inventory_type?: 'normal' | 'with_bar' | 'with_filters_and_bar';
|
|
8163
|
+
readonly inventory_type?: 'normal' | 'with_bar' | 'with_filters' | 'with_filters_and_bar' | 'with_weight_limit' | 'with_custom_stack_size';
|
|
8164
|
+
/**
|
|
8165
|
+
* Weight limit of the inventory if inventory_type is `"with_weight_limit"`.
|
|
8166
|
+
*/
|
|
8167
|
+
readonly inventory_weight_limit?: Weight;
|
|
8059
8168
|
/**
|
|
8060
8169
|
*
|
|
8061
8170
|
* These are the objects that are considered buildings:
|
|
@@ -8142,6 +8251,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8142
8251
|
* The max belt stack size for this loader.
|
|
8143
8252
|
*/
|
|
8144
8253
|
readonly loader_max_belt_stack_size?: uint8;
|
|
8254
|
+
/**
|
|
8255
|
+
* True if this loader will not drop items for which total amount is less than a full belt stack.
|
|
8256
|
+
*/
|
|
8257
|
+
readonly loader_wait_for_full_stack?: boolean;
|
|
8145
8258
|
/**
|
|
8146
8259
|
* The logistic mode of this logistic container.
|
|
8147
8260
|
*/
|
|
@@ -8216,6 +8329,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8216
8329
|
* The max payload size of this logistics or construction robot.
|
|
8217
8330
|
*/
|
|
8218
8331
|
readonly max_payload_size?: uint;
|
|
8332
|
+
readonly max_performance?: ThrusterPerformancePoint;
|
|
8219
8333
|
/**
|
|
8220
8334
|
* The maximum polyphony for this programmable speaker.
|
|
8221
8335
|
*/
|
|
@@ -8249,6 +8363,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8249
8363
|
* The minimum darkness at which this unit spawner can spawn entities.
|
|
8250
8364
|
*/
|
|
8251
8365
|
readonly min_darkness_to_spawn?: float;
|
|
8366
|
+
readonly min_performance?: ThrusterPerformancePoint;
|
|
8252
8367
|
/**
|
|
8253
8368
|
* The minimum pursue time of this unit prototype.
|
|
8254
8369
|
*/
|
|
@@ -8261,6 +8376,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8261
8376
|
* Whether this entity is minable and what can be obtained by mining it.
|
|
8262
8377
|
*/
|
|
8263
8378
|
readonly mineable_properties: MineableProperties;
|
|
8379
|
+
readonly minimal_arm_swing_segment_retraction?: uint;
|
|
8264
8380
|
/**
|
|
8265
8381
|
* Minimum amount of this resource.
|
|
8266
8382
|
*/
|
|
@@ -8294,7 +8410,10 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8294
8410
|
* 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.
|
|
8295
8411
|
*/
|
|
8296
8412
|
readonly object_name: string;
|
|
8413
|
+
readonly overkill_fraction?: float;
|
|
8414
|
+
readonly passive_energy_usage?: double;
|
|
8297
8415
|
readonly per_lane_filters?: boolean;
|
|
8416
|
+
readonly perceived_performance?: PerceivedPerformance;
|
|
8298
8417
|
/**
|
|
8299
8418
|
* The beacon profile: extra multiplier applied to the effects received from beacon by the effect receiver based on amount of beacons that reach that effect receiver
|
|
8300
8419
|
*/
|
|
@@ -8307,6 +8426,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8307
8426
|
* The pumping speed of this offshore or normal pump. This property is deprecated in favor of {@link LuaEntityPrototype::get_pumping_speed | runtime:LuaEntityPrototype::get_pumping_speed} and should not be used.
|
|
8308
8427
|
*/
|
|
8309
8428
|
readonly pumping_speed?: double;
|
|
8429
|
+
readonly quality_affects_mining_radius?: boolean;
|
|
8430
|
+
readonly quality_affects_module_slots?: boolean;
|
|
8310
8431
|
/**
|
|
8311
8432
|
* The radar range of this unit prototype.
|
|
8312
8433
|
*/
|
|
@@ -8316,6 +8437,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8316
8437
|
*/
|
|
8317
8438
|
readonly radius: double;
|
|
8318
8439
|
readonly radius_visualisation_specification?: RadiusVisualisationSpecification;
|
|
8440
|
+
readonly random_corpse_variation?: boolean;
|
|
8319
8441
|
readonly reach_distance?: uint;
|
|
8320
8442
|
readonly reach_resource_distance?: double;
|
|
8321
8443
|
readonly related_underground_belt?: LuaEntityPrototype;
|
|
@@ -8469,6 +8591,7 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8469
8591
|
* The terrain friction modifier for this vehicle.
|
|
8470
8592
|
*/
|
|
8471
8593
|
readonly terrain_friction_modifier?: float;
|
|
8594
|
+
readonly tether_size?: float;
|
|
8472
8595
|
readonly ticks_to_keep_aiming_direction?: uint;
|
|
8473
8596
|
readonly ticks_to_keep_gun?: uint;
|
|
8474
8597
|
readonly ticks_to_stay_in_combat?: uint;
|
|
@@ -8518,6 +8641,8 @@ interface LuaEntityPrototype extends LuaPrototypeBase {
|
|
|
8518
8641
|
* The turret rotation speed of this car prototype.
|
|
8519
8642
|
*/
|
|
8520
8643
|
readonly turret_rotation_speed?: float;
|
|
8644
|
+
readonly two_direction_only?: boolean;
|
|
8645
|
+
readonly unpowered_arm_speed_scale?: float;
|
|
8521
8646
|
/**
|
|
8522
8647
|
* Whether this logistic container prototype uses exact mode
|
|
8523
8648
|
*/
|
|
@@ -9382,6 +9507,10 @@ interface LuaForce {
|
|
|
9382
9507
|
* @param force The force to copy from.
|
|
9383
9508
|
*/
|
|
9384
9509
|
copy_from(this: void, force: ForceID): void;
|
|
9510
|
+
/**
|
|
9511
|
+
* Creates the given group if it doesn't already exist.
|
|
9512
|
+
*/
|
|
9513
|
+
create_logistic_group(this: void, name: string, type?: defines.logistic_group_type): void;
|
|
9385
9514
|
/**
|
|
9386
9515
|
* Creates a new space platform on this force.
|
|
9387
9516
|
* @param table.name The platform name. If not provided, a random name will be used.
|
|
@@ -9393,6 +9522,10 @@ interface LuaForce {
|
|
|
9393
9522
|
planet: SpaceLocationID;
|
|
9394
9523
|
starter_pack: ItemWithQualityID;
|
|
9395
9524
|
}): LuaSpacePlatform | null;
|
|
9525
|
+
/**
|
|
9526
|
+
* Deletes the given logistic group if it exists.
|
|
9527
|
+
*/
|
|
9528
|
+
delete_logistic_group(this: void, name: string, type?: defines.logistic_group_type): void;
|
|
9396
9529
|
/**
|
|
9397
9530
|
* Disable all recipes and technologies. Only recipes and technologies enabled explicitly will be useable from this point.
|
|
9398
9531
|
*/
|
|
@@ -9501,6 +9634,14 @@ interface LuaForce {
|
|
|
9501
9634
|
* Gets the linked inventory for the given prototype and link ID if it exists or `nil`.
|
|
9502
9635
|
*/
|
|
9503
9636
|
get_linked_inventory(this: void, prototype: EntityID, link_id: uint): LuaInventory | null;
|
|
9637
|
+
/**
|
|
9638
|
+
* Gets the information about the given logistic group.
|
|
9639
|
+
*/
|
|
9640
|
+
get_logistic_group(this: void, name: string, type?: defines.logistic_group_type): LogisticGroup | null;
|
|
9641
|
+
/**
|
|
9642
|
+
* Gets the names of the current logistic groups.
|
|
9643
|
+
*/
|
|
9644
|
+
get_logistic_groups(this: void, type?: defines.logistic_group_type): string[];
|
|
9504
9645
|
get_spawn_position(this: void, surface: SurfaceIdentification): MapPosition;
|
|
9505
9646
|
get_surface_hidden(this: void, surface: SurfaceIdentification): boolean;
|
|
9506
9647
|
/**
|
|
@@ -11122,6 +11263,10 @@ interface BaseLuaGuiElementAddParams {
|
|
|
11122
11263
|
* Location in its parent that the child element should slot into. By default, the child will be appended onto the end.
|
|
11123
11264
|
*/
|
|
11124
11265
|
'index'?: uint;
|
|
11266
|
+
/**
|
|
11267
|
+
* Whether the child element is locked. Defaults to `false`.
|
|
11268
|
+
*/
|
|
11269
|
+
'locked'?: boolean;
|
|
11125
11270
|
/**
|
|
11126
11271
|
* Name of the child element. It must be unique within the parent element.
|
|
11127
11272
|
*/
|
|
@@ -11707,19 +11852,30 @@ interface LuaHeatEnergySourcePrototype {
|
|
|
11707
11852
|
readonly valid: boolean;
|
|
11708
11853
|
}
|
|
11709
11854
|
/**
|
|
11710
|
-
* Provides various helper and utility functions. It is accessible through the global object named `helpers
|
|
11855
|
+
* Provides various helper and utility functions. It is accessible through the global object named `helpers` in all stages (settings, prototype and runtime).
|
|
11711
11856
|
*/
|
|
11712
11857
|
interface LuaHelpers {
|
|
11713
11858
|
/**
|
|
11714
11859
|
* Goes over all items, entities, tiles, recipes, technologies among other things and logs if the locale is incorrect.
|
|
11715
11860
|
*
|
|
11716
11861
|
* Also prints true/false if called from the console.
|
|
11862
|
+
*
|
|
11863
|
+
* Not available in settings and prototype stages.
|
|
11717
11864
|
*/
|
|
11718
11865
|
check_prototype_translations(this: void): void;
|
|
11866
|
+
/**
|
|
11867
|
+
* Compares 2 version strings.
|
|
11868
|
+
* @param first First version string to compare.
|
|
11869
|
+
* @param second Second version string to compare.
|
|
11870
|
+
* @returns -1 if first is smaller than second, 0 if first equal second, 1 if first is greater than second.
|
|
11871
|
+
*/
|
|
11872
|
+
compare_versions(this: void, first: string, second: string): int;
|
|
11719
11873
|
/**
|
|
11720
11874
|
* Creates a {@link LuaProfiler | runtime:LuaProfiler}, which is used for measuring script performance.
|
|
11721
11875
|
*
|
|
11722
11876
|
* LuaProfiler cannot be serialized.
|
|
11877
|
+
*
|
|
11878
|
+
* Not available in settings and prototype stages.
|
|
11723
11879
|
* @param stopped Create the timer stopped
|
|
11724
11880
|
*/
|
|
11725
11881
|
create_profiler(this: void, stopped?: boolean): LuaProfiler;
|
|
@@ -11752,11 +11908,15 @@ interface LuaHelpers {
|
|
|
11752
11908
|
evaluate_expression(this: void, expression: MathExpression, variables?: Record<string, double>): double;
|
|
11753
11909
|
/**
|
|
11754
11910
|
* Checks if the given SoundPath is valid.
|
|
11911
|
+
*
|
|
11912
|
+
* Not available in settings and prototype stages.
|
|
11755
11913
|
* @param sound_path Path to the sound.
|
|
11756
11914
|
*/
|
|
11757
11915
|
is_valid_sound_path(this: void, sound_path: SoundPath): boolean;
|
|
11758
11916
|
/**
|
|
11759
11917
|
* Checks if the given SpritePath is valid and contains a loaded sprite. The existence of the image is not checked for paths of type `file`.
|
|
11918
|
+
*
|
|
11919
|
+
* Not available in settings and prototype stages.
|
|
11760
11920
|
* @param sprite_path Path to the image.
|
|
11761
11921
|
*/
|
|
11762
11922
|
is_valid_sprite_path(this: void, sprite_path: SpritePath): boolean;
|
|
@@ -11768,6 +11928,8 @@ interface LuaHelpers {
|
|
|
11768
11928
|
json_to_table(this: void, json: string): AnyBasic | null;
|
|
11769
11929
|
/**
|
|
11770
11930
|
* Convert a map exchange string to map gen settings and map settings.
|
|
11931
|
+
*
|
|
11932
|
+
* Not available in settings and prototype stages.
|
|
11771
11933
|
*/
|
|
11772
11934
|
parse_map_exchange_string(this: void, map_exchange_string: string): MapExchangeStringData;
|
|
11773
11935
|
/**
|
|
@@ -11784,9 +11946,13 @@ interface LuaHelpers {
|
|
|
11784
11946
|
* @param filename The name of the file. Providing a directory path (ex. `"save/here/example.txt"`) will create the necessary folder structure in `script-output`.
|
|
11785
11947
|
* @param data The content to write to the file.
|
|
11786
11948
|
* @param append If `true`, `data` will be appended to the end of the file. Defaults to `false`, which will overwrite any pre-existing file with the new `data`.
|
|
11787
|
-
* @param for_player If given, the file will only be written for this `player_index`. Providing `0` will only write to the server's output if present.
|
|
11949
|
+
* @param for_player If given, the file will only be written for this `player_index`. Providing `0` will only write to the server's output if present. `for_player` cannot be used in settings and prototype stages.
|
|
11788
11950
|
*/
|
|
11789
11951
|
write_file(this: void, filename: string, data: LocalisedString, append?: boolean, for_player?: uint): void;
|
|
11952
|
+
/**
|
|
11953
|
+
* Current version of game
|
|
11954
|
+
*/
|
|
11955
|
+
readonly game_version: string;
|
|
11790
11956
|
/**
|
|
11791
11957
|
* 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.
|
|
11792
11958
|
*/
|
|
@@ -11945,7 +12111,7 @@ interface LuaInventory {
|
|
|
11945
12111
|
* Set the current bar.
|
|
11946
12112
|
*
|
|
11947
12113
|
* Only useable if this inventory supports having a bar.
|
|
11948
|
-
* @param bar The new limit. Omitting this parameter will clear the limit.
|
|
12114
|
+
* @param bar The new limit. Omitting this parameter or passing `nil` will clear the limit.
|
|
11949
12115
|
*/
|
|
11950
12116
|
set_bar(this: void, bar?: uint): void;
|
|
11951
12117
|
/**
|
|
@@ -11983,6 +12149,10 @@ interface LuaInventory {
|
|
|
11983
12149
|
* The inventory index this inventory uses, if any.
|
|
11984
12150
|
*/
|
|
11985
12151
|
readonly index?: defines.inventory;
|
|
12152
|
+
/**
|
|
12153
|
+
* Gives a maximum weight of items that can be inserted into this inventory.
|
|
12154
|
+
*/
|
|
12155
|
+
readonly max_weight?: Weight;
|
|
11986
12156
|
/**
|
|
11987
12157
|
* The mod that owns this inventory, if any.
|
|
11988
12158
|
*/
|
|
@@ -12003,6 +12173,10 @@ interface LuaInventory {
|
|
|
12003
12173
|
* 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.
|
|
12004
12174
|
*/
|
|
12005
12175
|
readonly valid: boolean;
|
|
12176
|
+
/**
|
|
12177
|
+
* Gives a total weight of all items currently in this inventory.
|
|
12178
|
+
*/
|
|
12179
|
+
readonly weight: Weight;
|
|
12006
12180
|
/**
|
|
12007
12181
|
* The indexing operator.
|
|
12008
12182
|
* @example ```
|
|
@@ -12510,6 +12684,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12510
12684
|
* The collision box used by character entities when wearing this armor.
|
|
12511
12685
|
*/
|
|
12512
12686
|
readonly collision_box?: BoundingBox;
|
|
12687
|
+
readonly create_electric_network?: boolean;
|
|
12513
12688
|
readonly default_import_location: LuaSpaceLocationPrototype;
|
|
12514
12689
|
/**
|
|
12515
12690
|
* The default label color used for this item with label, if any.
|
|
@@ -12590,6 +12765,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12590
12765
|
*/
|
|
12591
12766
|
readonly infinite?: boolean;
|
|
12592
12767
|
readonly ingredient_to_weight_coefficient: double;
|
|
12768
|
+
readonly initial_items?: ItemProduct[];
|
|
12593
12769
|
/**
|
|
12594
12770
|
* The main inventory size for item-with-inventory-prototype.
|
|
12595
12771
|
*/
|
|
@@ -12653,6 +12829,10 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12653
12829
|
* The results of launching this item in a rocket.
|
|
12654
12830
|
*/
|
|
12655
12831
|
readonly rocket_launch_products: Product[];
|
|
12832
|
+
/**
|
|
12833
|
+
* How this item interacts when being sent to orbit.
|
|
12834
|
+
*/
|
|
12835
|
+
readonly send_to_orbit_mode: 'not-sendable' | 'manual' | 'automated';
|
|
12656
12836
|
/**
|
|
12657
12837
|
* If this selection tool skips things covered by fog of war.
|
|
12658
12838
|
*/
|
|
@@ -12678,6 +12858,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12678
12858
|
* The rail support used by this rail planner.
|
|
12679
12859
|
*/
|
|
12680
12860
|
readonly support?: LuaEntityPrototype;
|
|
12861
|
+
readonly surface?: LuaSurfacePrototype;
|
|
12681
12862
|
/**
|
|
12682
12863
|
* Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules with higher tier modules if they have the same category.
|
|
12683
12864
|
*/
|
|
@@ -12686,6 +12867,8 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12686
12867
|
* The number of tile filters this deconstruction item has.
|
|
12687
12868
|
*/
|
|
12688
12869
|
readonly tile_filter_slots?: uint;
|
|
12870
|
+
readonly tiles?: SpacePlatformTileDefinition[];
|
|
12871
|
+
readonly trigger?: TriggerItem;
|
|
12689
12872
|
/**
|
|
12690
12873
|
* 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.
|
|
12691
12874
|
*/
|
|
@@ -12693,7 +12876,7 @@ interface LuaItemPrototype extends LuaPrototypeBase {
|
|
|
12693
12876
|
/**
|
|
12694
12877
|
* Weight of this item. More information on how item weight is determined can be found on its {@link auxiliary page | runtime:item-weight}.
|
|
12695
12878
|
*/
|
|
12696
|
-
readonly weight:
|
|
12879
|
+
readonly weight: Weight;
|
|
12697
12880
|
}
|
|
12698
12881
|
/**
|
|
12699
12882
|
* A reference to an item and count owned by some external entity.
|
|
@@ -13861,6 +14044,10 @@ interface LuaPlayer extends LuaControl {
|
|
|
13861
14044
|
* Exit the current cutscene. Errors if not in a cutscene.
|
|
13862
14045
|
*/
|
|
13863
14046
|
exit_cutscene(this: void): void;
|
|
14047
|
+
/**
|
|
14048
|
+
* Exit remote view if possible. Exiting will fail if the player is in a rocket or in a platform.
|
|
14049
|
+
*/
|
|
14050
|
+
exit_remote_view(this: void): void;
|
|
13864
14051
|
/**
|
|
13865
14052
|
* Gets which quick bar page is being used for the given screen page or `nil` if not known.
|
|
13866
14053
|
* @param index The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change.
|
|
@@ -14735,6 +14922,12 @@ interface LuaPrototypes {
|
|
|
14735
14922
|
* A dictionary containing every LuaTrivialSmokePrototype indexed by `name`.
|
|
14736
14923
|
*/
|
|
14737
14924
|
readonly trivial_smoke: Record<string, LuaTrivialSmokePrototype>;
|
|
14925
|
+
/**
|
|
14926
|
+
* All utility constants.
|
|
14927
|
+
*
|
|
14928
|
+
* See {@link UtilityConstants | prototype:UtilityConstants} for possible values.
|
|
14929
|
+
*/
|
|
14930
|
+
readonly utility_constants: Record<string, AnyBasic>;
|
|
14738
14931
|
/**
|
|
14739
14932
|
* A dictionary containing every LuaVirtualSignalPrototype indexed by `name`.
|
|
14740
14933
|
*/
|
|
@@ -14778,16 +14971,38 @@ interface LuaPumpControlBehavior extends LuaGenericOnOffControlBehavior {
|
|
|
14778
14971
|
* Prototype of a quality.
|
|
14779
14972
|
*/
|
|
14780
14973
|
interface LuaQualityPrototype extends LuaPrototypeBase {
|
|
14974
|
+
readonly accumulator_capacity_multiplier: double;
|
|
14975
|
+
readonly asteroid_collector_collection_radius_bonus: uint;
|
|
14976
|
+
readonly beacon_module_slots_bonus: ItemStackIndex;
|
|
14781
14977
|
readonly beacon_power_usage_multiplier: float;
|
|
14978
|
+
readonly beacon_supply_area_distance_bonus: float;
|
|
14782
14979
|
/**
|
|
14783
14980
|
* The color of the prototype
|
|
14784
14981
|
*/
|
|
14785
14982
|
readonly color: Color;
|
|
14983
|
+
readonly crafting_machine_energy_usage_multiplier: double;
|
|
14984
|
+
readonly crafting_machine_module_slots_bonus: ItemStackIndex;
|
|
14985
|
+
readonly crafting_machine_speed_multiplier: double;
|
|
14986
|
+
readonly default_multiplier: double;
|
|
14786
14987
|
readonly draw_sprite_by_default: boolean;
|
|
14988
|
+
readonly electric_pole_supply_area_distance_bonus: float;
|
|
14989
|
+
readonly electric_pole_wire_reach_bonus: float;
|
|
14990
|
+
readonly equipment_grid_height_bonus: int16;
|
|
14991
|
+
readonly equipment_grid_width_bonus: int16;
|
|
14992
|
+
readonly fluid_wagon_capacity_multiplier: double;
|
|
14993
|
+
readonly flying_robot_max_energy_multiplier: double;
|
|
14994
|
+
readonly inserter_speed_multiplier: double;
|
|
14995
|
+
readonly inventory_size_multiplier: double;
|
|
14996
|
+
readonly lab_module_slots_bonus: ItemStackIndex;
|
|
14997
|
+
readonly lab_research_speed_multiplier: double;
|
|
14787
14998
|
/**
|
|
14788
14999
|
* Level basically specifies the stat-increasing value of this quality level
|
|
14789
15000
|
*/
|
|
14790
15001
|
readonly level: uint;
|
|
15002
|
+
readonly logistic_cell_charging_energy_multiplier: double;
|
|
15003
|
+
readonly logistic_cell_charging_station_count_bonus: uint;
|
|
15004
|
+
readonly mining_drill_mining_radius_bonus: float;
|
|
15005
|
+
readonly mining_drill_module_slots_bonus: ItemStackIndex;
|
|
14791
15006
|
readonly mining_drill_resource_drain_multiplier: float;
|
|
14792
15007
|
/**
|
|
14793
15008
|
* The next higher level of the quality
|
|
@@ -14801,6 +15016,9 @@ interface LuaQualityPrototype extends LuaPrototypeBase {
|
|
|
14801
15016
|
* 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.
|
|
14802
15017
|
*/
|
|
14803
15018
|
readonly object_name: string;
|
|
15019
|
+
readonly range_multiplier: double;
|
|
15020
|
+
readonly science_pack_drain_multiplier: float;
|
|
15021
|
+
readonly tool_durability_multiplier: double;
|
|
14804
15022
|
/**
|
|
14805
15023
|
* 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.
|
|
14806
15024
|
*/
|
|
@@ -15599,7 +15817,7 @@ interface LuaRemote {
|
|
|
15599
15817
|
readonly object_name: string;
|
|
15600
15818
|
}
|
|
15601
15819
|
/**
|
|
15602
|
-
* Reference to a single LuaRendering object.
|
|
15820
|
+
* Reference to a single {@link LuaRendering | runtime:LuaRendering} object.
|
|
15603
15821
|
*/
|
|
15604
15822
|
interface LuaRenderObject {
|
|
15605
15823
|
/**
|
|
@@ -15642,6 +15860,12 @@ interface LuaRenderObject {
|
|
|
15642
15860
|
* Animation speed of this animation. Animation speed in frames per tick.
|
|
15643
15861
|
*/
|
|
15644
15862
|
animation_speed: double;
|
|
15863
|
+
/**
|
|
15864
|
+
* Blink interval of this object based on the internal "update tick". When zero, blinking is disabled. For other values, the object will be visible the given number of ticks and then invisible for the same duration. Objects with the same blink interval will blink synchronously. Blink interval of game alerts is 30.
|
|
15865
|
+
*
|
|
15866
|
+
* For example, when the interval is 60, the object is visible for 60 ticks and hidden for the next 60.
|
|
15867
|
+
*/
|
|
15868
|
+
blink_interval: uint16;
|
|
15645
15869
|
/**
|
|
15646
15870
|
* Color or tint of the object.
|
|
15647
15871
|
*/
|
|
@@ -15652,6 +15876,8 @@ interface LuaRenderObject {
|
|
|
15652
15876
|
dash_length: double;
|
|
15653
15877
|
/**
|
|
15654
15878
|
* If this object is being drawn on the ground, under most entities and sprites.
|
|
15879
|
+
*
|
|
15880
|
+
* In {@link render_mode | runtime:LuaRenderObject::render_mode} == "chart", this value is unused.
|
|
15655
15881
|
*/
|
|
15656
15882
|
draw_on_ground: boolean;
|
|
15657
15883
|
/**
|
|
@@ -15738,6 +15964,12 @@ interface LuaRenderObject {
|
|
|
15738
15964
|
* Render layer of this sprite or animation.
|
|
15739
15965
|
*/
|
|
15740
15966
|
render_layer: RenderLayer;
|
|
15967
|
+
/**
|
|
15968
|
+
* Whether the object is rendered in game world or on the chart (map view).
|
|
15969
|
+
*
|
|
15970
|
+
* When it is changed, the object is pushed to front of its new group.
|
|
15971
|
+
*/
|
|
15972
|
+
render_mode: ScriptRenderMode;
|
|
15741
15973
|
/**
|
|
15742
15974
|
* Where bottom right corner of this rectangle is drawn.
|
|
15743
15975
|
*/
|
|
@@ -15846,10 +16078,12 @@ interface LuaRendering {
|
|
|
15846
16078
|
* @param table.oriented_offset Offsets the center of the animation if `orientation_target` is given. This offset will rotate together with the animation.
|
|
15847
16079
|
* @param table.target Center of the animation.
|
|
15848
16080
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16081
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
15849
16082
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
15850
16083
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
15851
16084
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
15852
16085
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16086
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
15853
16087
|
*/
|
|
15854
16088
|
draw_animation(this: void, table: {
|
|
15855
16089
|
animation: string;
|
|
@@ -15866,10 +16100,12 @@ interface LuaRendering {
|
|
|
15866
16100
|
target: ScriptRenderTarget;
|
|
15867
16101
|
surface: SurfaceIdentification;
|
|
15868
16102
|
time_to_live?: uint;
|
|
16103
|
+
blink_interval?: uint16;
|
|
15869
16104
|
forces?: ForceSet;
|
|
15870
16105
|
players?: PlayerIdentification[];
|
|
15871
16106
|
visible?: boolean;
|
|
15872
16107
|
only_in_alt_mode?: boolean;
|
|
16108
|
+
render_mode?: ScriptRenderMode;
|
|
15873
16109
|
}): LuaRenderObject;
|
|
15874
16110
|
/**
|
|
15875
16111
|
* Create an arc.
|
|
@@ -15878,11 +16114,13 @@ interface LuaRendering {
|
|
|
15878
16114
|
* @param table.start_angle Where the arc starts, in radian.
|
|
15879
16115
|
* @param table.angle The angle of the arc, in radian.
|
|
15880
16116
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16117
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
15881
16118
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
15882
16119
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
15883
16120
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
15884
16121
|
* @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
|
|
15885
16122
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16123
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
15886
16124
|
*/
|
|
15887
16125
|
draw_arc(this: void, table: {
|
|
15888
16126
|
color: Color;
|
|
@@ -15893,11 +16131,13 @@ interface LuaRendering {
|
|
|
15893
16131
|
target: ScriptRenderTarget;
|
|
15894
16132
|
surface: SurfaceIdentification;
|
|
15895
16133
|
time_to_live?: uint;
|
|
16134
|
+
blink_interval?: uint16;
|
|
15896
16135
|
forces?: ForceSet;
|
|
15897
16136
|
players?: PlayerIdentification[];
|
|
15898
16137
|
visible?: boolean;
|
|
15899
16138
|
draw_on_ground?: boolean;
|
|
15900
16139
|
only_in_alt_mode?: boolean;
|
|
16140
|
+
render_mode?: ScriptRenderMode;
|
|
15901
16141
|
}): LuaRenderObject;
|
|
15902
16142
|
/**
|
|
15903
16143
|
* Create a circle.
|
|
@@ -15905,11 +16145,13 @@ interface LuaRendering {
|
|
|
15905
16145
|
* @param table.width Width of the outline, used only if filled = false. Value is in pixels (32 per tile). Defaults to 1.
|
|
15906
16146
|
* @param table.filled If the circle should be filled. Defaults to false.
|
|
15907
16147
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16148
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
15908
16149
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
15909
16150
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
15910
16151
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
15911
16152
|
* @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
|
|
15912
16153
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16154
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
15913
16155
|
*/
|
|
15914
16156
|
draw_circle(this: void, table: {
|
|
15915
16157
|
color: Color;
|
|
@@ -15919,11 +16161,13 @@ interface LuaRendering {
|
|
|
15919
16161
|
target: ScriptRenderTarget;
|
|
15920
16162
|
surface: SurfaceIdentification;
|
|
15921
16163
|
time_to_live?: uint;
|
|
16164
|
+
blink_interval?: uint16;
|
|
15922
16165
|
forces?: ForceSet;
|
|
15923
16166
|
players?: PlayerIdentification[];
|
|
15924
16167
|
visible?: boolean;
|
|
15925
16168
|
draw_on_ground?: boolean;
|
|
15926
16169
|
only_in_alt_mode?: boolean;
|
|
16170
|
+
render_mode?: ScriptRenderMode;
|
|
15927
16171
|
}): LuaRenderObject;
|
|
15928
16172
|
/**
|
|
15929
16173
|
* Create a light.
|
|
@@ -15937,10 +16181,12 @@ interface LuaRendering {
|
|
|
15937
16181
|
* @param table.color Defaults to white (no tint).
|
|
15938
16182
|
* @param table.target Center of the light.
|
|
15939
16183
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16184
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
15940
16185
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
15941
16186
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
15942
16187
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
15943
16188
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16189
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
15944
16190
|
*/
|
|
15945
16191
|
draw_light(this: void, table: {
|
|
15946
16192
|
sprite: SpritePath;
|
|
@@ -15953,10 +16199,12 @@ interface LuaRendering {
|
|
|
15953
16199
|
target: ScriptRenderTarget;
|
|
15954
16200
|
surface: SurfaceIdentification;
|
|
15955
16201
|
time_to_live?: uint;
|
|
16202
|
+
blink_interval?: uint16;
|
|
15956
16203
|
forces?: ForceSet;
|
|
15957
16204
|
players?: PlayerIdentification[];
|
|
15958
16205
|
visible?: boolean;
|
|
15959
16206
|
only_in_alt_mode?: boolean;
|
|
16207
|
+
render_mode?: ScriptRenderMode;
|
|
15960
16208
|
}): LuaRenderObject;
|
|
15961
16209
|
/**
|
|
15962
16210
|
* Create a line.
|
|
@@ -15965,11 +16213,13 @@ interface LuaRendering {
|
|
|
15965
16213
|
* @param table.dash_length Length of the dashes that this line has. Used only if gap_length > 0. Default is 0.
|
|
15966
16214
|
* @param table.dash_offset Starting offset to apply to dashes. Cannot be greater than dash_length + gap_length. Default is 0.
|
|
15967
16215
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16216
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
15968
16217
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
15969
16218
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
15970
16219
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
15971
16220
|
* @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
|
|
15972
16221
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16222
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
15973
16223
|
* @example ```
|
|
15974
16224
|
-- Draw a white and 2 pixel wide line from {0, 0} to {2, 2}.
|
|
15975
16225
|
rendering.draw_line{surface = game.player.surface, from = {0, 0}, to = {2, 2}, color = {1, 1, 1}, width = 2}
|
|
@@ -15989,11 +16239,13 @@ interface LuaRendering {
|
|
|
15989
16239
|
to: ScriptRenderTarget;
|
|
15990
16240
|
surface: SurfaceIdentification;
|
|
15991
16241
|
time_to_live?: uint;
|
|
16242
|
+
blink_interval?: uint16;
|
|
15992
16243
|
forces?: ForceSet;
|
|
15993
16244
|
players?: PlayerIdentification[];
|
|
15994
16245
|
visible?: boolean;
|
|
15995
16246
|
draw_on_ground?: boolean;
|
|
15996
16247
|
only_in_alt_mode?: boolean;
|
|
16248
|
+
render_mode?: ScriptRenderMode;
|
|
15997
16249
|
}): LuaRenderObject;
|
|
15998
16250
|
/**
|
|
15999
16251
|
* Create a triangle mesh defined by a triangle strip.
|
|
@@ -16002,11 +16254,13 @@ interface LuaRendering {
|
|
|
16002
16254
|
* @param table.orientation_target If given, the vertices (that are not set to an entity) rotate so that it faces this target. Note that `orientation` is still applied.
|
|
16003
16255
|
* @param table.use_target_orientation Only used if `orientation_target` is a LuaEntity.
|
|
16004
16256
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16257
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
16005
16258
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
16006
16259
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
16007
16260
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
16008
16261
|
* @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
|
|
16009
16262
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16263
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
16010
16264
|
*/
|
|
16011
16265
|
draw_polygon(this: void, table: {
|
|
16012
16266
|
color: Color;
|
|
@@ -16017,22 +16271,26 @@ interface LuaRendering {
|
|
|
16017
16271
|
use_target_orientation?: boolean;
|
|
16018
16272
|
surface: SurfaceIdentification;
|
|
16019
16273
|
time_to_live?: uint;
|
|
16274
|
+
blink_interval?: uint16;
|
|
16020
16275
|
forces?: ForceSet;
|
|
16021
16276
|
players?: PlayerIdentification[];
|
|
16022
16277
|
visible?: boolean;
|
|
16023
16278
|
draw_on_ground?: boolean;
|
|
16024
16279
|
only_in_alt_mode?: boolean;
|
|
16280
|
+
render_mode?: ScriptRenderMode;
|
|
16025
16281
|
}): LuaRenderObject;
|
|
16026
16282
|
/**
|
|
16027
16283
|
* Create a rectangle.
|
|
16028
16284
|
* @param table.width Width of the outline, used only if filled = false. Value is in pixels (32 per tile). Defaults to 1.
|
|
16029
16285
|
* @param table.filled If the rectangle should be filled. Defaults to false.
|
|
16030
16286
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16287
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
16031
16288
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
16032
16289
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
16033
16290
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
16034
16291
|
* @param table.draw_on_ground If this should be drawn below sprites and entities. Defaults to false.
|
|
16035
16292
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16293
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
16036
16294
|
* @example ```
|
|
16037
16295
|
-- Draw a white and 1 pixel wide square outline with the corners {0, 0} and {2, 2}.
|
|
16038
16296
|
rendering.draw_rectangle{surface = game.player.surface, left_top = {0, 0}, right_bottom = {2, 2}, color = {1, 1, 1}}
|
|
@@ -16046,11 +16304,13 @@ interface LuaRendering {
|
|
|
16046
16304
|
right_bottom: ScriptRenderTarget;
|
|
16047
16305
|
surface: SurfaceIdentification;
|
|
16048
16306
|
time_to_live?: uint;
|
|
16307
|
+
blink_interval?: uint16;
|
|
16049
16308
|
forces?: ForceSet;
|
|
16050
16309
|
players?: PlayerIdentification[];
|
|
16051
16310
|
visible?: boolean;
|
|
16052
16311
|
draw_on_ground?: boolean;
|
|
16053
16312
|
only_in_alt_mode?: boolean;
|
|
16313
|
+
render_mode?: ScriptRenderMode;
|
|
16054
16314
|
}): LuaRenderObject;
|
|
16055
16315
|
/**
|
|
16056
16316
|
* Create a sprite.
|
|
@@ -16063,6 +16323,7 @@ interface LuaRendering {
|
|
|
16063
16323
|
* @param table.oriented_offset Offsets the center of the sprite if `orientation_target` is given. This offset will rotate together with the sprite.
|
|
16064
16324
|
* @param table.target Center of the sprite.
|
|
16065
16325
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16326
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
16066
16327
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
16067
16328
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
16068
16329
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
@@ -16074,6 +16335,7 @@ interface LuaRendering {
|
|
|
16074
16335
|
* @example ```
|
|
16075
16336
|
-- This will draw an iron plate icon at the character's head. The sprite will move together with the character.
|
|
16076
16337
|
rendering.draw_sprite{sprite = "item.iron-plate", target = {entity = game.player.character, offset = {0, -2}}, surface = game.player.surface}
|
|
16338
|
+
$field(render_mode, ScriptRenderMode, $optional) Mode which this object should render in. Defaults to "game".
|
|
16077
16339
|
```
|
|
16078
16340
|
*/
|
|
16079
16341
|
draw_sprite(this: void, table: {
|
|
@@ -16089,6 +16351,7 @@ interface LuaRendering {
|
|
|
16089
16351
|
target: ScriptRenderTarget;
|
|
16090
16352
|
surface: SurfaceIdentification;
|
|
16091
16353
|
time_to_live?: uint;
|
|
16354
|
+
blink_interval?: uint16;
|
|
16092
16355
|
forces?: ForceSet;
|
|
16093
16356
|
players?: PlayerIdentification[];
|
|
16094
16357
|
visible?: boolean;
|
|
@@ -16101,6 +16364,7 @@ interface LuaRendering {
|
|
|
16101
16364
|
* @param table.text The text to display.
|
|
16102
16365
|
* @param table.font Name of font to use. Defaults to the same font as flying-text.
|
|
16103
16366
|
* @param table.time_to_live In ticks. Defaults to living forever.
|
|
16367
|
+
* @param table.blink_interval In ticks. Defaults to 0 (no blinking). Game alerts use 30.
|
|
16104
16368
|
* @param table.forces The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
16105
16369
|
* @param table.players The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
16106
16370
|
* @param table.visible If this is rendered to anyone at all. Defaults to true.
|
|
@@ -16110,6 +16374,7 @@ interface LuaRendering {
|
|
|
16110
16374
|
* @param table.vertical_alignment Defaults to "top".
|
|
16111
16375
|
* @param table.scale_with_zoom Defaults to false. If true, the text scales with player zoom, resulting in it always being the same size on screen, and the size compared to the game world changes.
|
|
16112
16376
|
* @param table.only_in_alt_mode If this should only be rendered in alt mode. Defaults to false.
|
|
16377
|
+
* @param table.render_mode Mode which this object should render in. Defaults to "game".
|
|
16113
16378
|
* @param table.use_rich_text If rich text rendering is enabled. Defaults to false.
|
|
16114
16379
|
*/
|
|
16115
16380
|
draw_text(this: void, table: {
|
|
@@ -16120,6 +16385,7 @@ interface LuaRendering {
|
|
|
16120
16385
|
scale?: double;
|
|
16121
16386
|
font?: string;
|
|
16122
16387
|
time_to_live?: uint;
|
|
16388
|
+
blink_interval?: uint16;
|
|
16123
16389
|
forces?: ForceSet;
|
|
16124
16390
|
players?: PlayerIdentification[];
|
|
16125
16391
|
visible?: boolean;
|
|
@@ -16129,6 +16395,7 @@ interface LuaRendering {
|
|
|
16129
16395
|
vertical_alignment?: VerticalTextAlign;
|
|
16130
16396
|
scale_with_zoom?: boolean;
|
|
16131
16397
|
only_in_alt_mode?: boolean;
|
|
16398
|
+
render_mode?: ScriptRenderMode;
|
|
16132
16399
|
use_rich_text?: boolean;
|
|
16133
16400
|
}): LuaRenderObject;
|
|
16134
16401
|
/**
|
|
@@ -16704,6 +16971,10 @@ interface LuaSpacePlatform {
|
|
|
16704
16971
|
* The force of this space platform.
|
|
16705
16972
|
*/
|
|
16706
16973
|
readonly force: LuaForce;
|
|
16974
|
+
/**
|
|
16975
|
+
* If this platform is hidden from the remote view surface list.
|
|
16976
|
+
*/
|
|
16977
|
+
hidden: boolean;
|
|
16707
16978
|
/**
|
|
16708
16979
|
* The hub on this platform. `nil` if the platform has not had the starter pack applied or hub was destroyed but the platform not yet deleted.
|
|
16709
16980
|
*
|
|
@@ -16774,7 +17045,7 @@ interface LuaSpacePlatform {
|
|
|
16774
17045
|
/**
|
|
16775
17046
|
* The total weight of the platform.
|
|
16776
17047
|
*/
|
|
16777
|
-
readonly weight:
|
|
17048
|
+
readonly weight: Weight;
|
|
16778
17049
|
}
|
|
16779
17050
|
/**
|
|
16780
17051
|
* Control behavior for space platform hubs
|
|
@@ -17590,6 +17861,10 @@ interface LuaSurface {
|
|
|
17590
17861
|
* @returns The resulting set of tiles.
|
|
17591
17862
|
*/
|
|
17592
17863
|
get_connected_tiles(this: void, position: TilePosition, tiles: TileID[], include_diagonal?: boolean, area?: BoundingBox): TilePosition[];
|
|
17864
|
+
/**
|
|
17865
|
+
* Gets the cover tile for the given force and tile on this surface if one is set.
|
|
17866
|
+
*/
|
|
17867
|
+
get_default_cover_tile(this: void, force: ForceID, tile: TileID): LuaTilePrototype | null;
|
|
17593
17868
|
/**
|
|
17594
17869
|
* The double hidden tile name or `nil` if there isn't one for the given position.
|
|
17595
17870
|
* @param position The tile position.
|
|
@@ -17762,6 +18037,10 @@ interface LuaSurface {
|
|
|
17762
18037
|
* @param status The chunk's new status.
|
|
17763
18038
|
*/
|
|
17764
18039
|
set_chunk_generated_status(this: void, position: ChunkPosition, status: defines.chunk_generated_status): void;
|
|
18040
|
+
/**
|
|
18041
|
+
* Sets the cover tile for the given force and tile on this surface.
|
|
18042
|
+
*/
|
|
18043
|
+
set_default_cover_tile(this: void, force: ForceID, from_tile: TileID, to_tile: TileID | nil): void;
|
|
17765
18044
|
/**
|
|
17766
18045
|
* Set double hidden tile for the specified position. During normal gameplay, only {@link non-mineable | runtime:LuaTilePrototype::mineable_properties} tiles can become double hidden.
|
|
17767
18046
|
*
|
|
@@ -18840,7 +19119,7 @@ interface LuaTilePrototype extends LuaPrototypeBase {
|
|
|
18840
19119
|
readonly decorative_removal_probability: float;
|
|
18841
19120
|
readonly default_cover_tile?: LuaTilePrototype;
|
|
18842
19121
|
readonly default_destroyed_dropped_item_trigger?: TriggerItem[];
|
|
18843
|
-
readonly destroys_dropped_items
|
|
19122
|
+
readonly destroys_dropped_items: boolean;
|
|
18844
19123
|
/**
|
|
18845
19124
|
* An alternative prototype that will be used to display info about this prototype in Factoriopedia.
|
|
18846
19125
|
*/
|
|
@@ -18860,7 +19139,7 @@ interface LuaTilePrototype extends LuaPrototypeBase {
|
|
|
18860
19139
|
readonly items_to_place_this?: ItemStackDefinition[];
|
|
18861
19140
|
readonly layer: uint;
|
|
18862
19141
|
readonly map_color: Color;
|
|
18863
|
-
readonly max_health
|
|
19142
|
+
readonly max_health: float;
|
|
18864
19143
|
readonly mineable_properties: {
|
|
18865
19144
|
/**
|
|
18866
19145
|
* Is this tile mineable at all?
|
|
@@ -18901,7 +19180,7 @@ interface LuaTilePrototype extends LuaPrototypeBase {
|
|
|
18901
19180
|
readonly valid: boolean;
|
|
18902
19181
|
readonly vehicle_friction_modifier: float;
|
|
18903
19182
|
readonly walking_speed_modifier: float;
|
|
18904
|
-
readonly weight
|
|
19183
|
+
readonly weight: Weight;
|
|
18905
19184
|
}
|
|
18906
19185
|
/**
|
|
18907
19186
|
* A train. Trains are a sequence of connected rolling stocks -- locomotives and wagons.
|