factorio-types 0.0.23 → 0.0.24
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 +162 -102
- package/dist/concepts.d.ts +57 -10
- package/dist/core.d.ts +1 -4
- package/dist/defines.d.ts +1 -1
- package/dist/events.d.ts +5 -1
- package/dist/global.d.ts +1 -1
- package/package.json +1 -1
package/dist/classes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.60
|
|
6
6
|
// API version 2
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -97,7 +97,7 @@ interface LuaAchievementPrototype {
|
|
|
97
97
|
readonly object_name: string
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
101
101
|
*/
|
|
102
102
|
readonly order: string
|
|
103
103
|
|
|
@@ -134,7 +134,7 @@ interface LuaAmmoCategoryPrototype {
|
|
|
134
134
|
readonly object_name: string
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
137
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
138
138
|
*/
|
|
139
139
|
readonly order: string
|
|
140
140
|
|
|
@@ -207,7 +207,7 @@ interface LuaAutoplaceControlPrototype {
|
|
|
207
207
|
readonly object_name: string
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
|
-
*
|
|
210
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
211
211
|
*/
|
|
212
212
|
readonly order: string
|
|
213
213
|
|
|
@@ -249,7 +249,10 @@ interface LuaBootstrap {
|
|
|
249
249
|
get_event_order(this: void): void
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
|
-
* Register a function to be run when mod configuration changes. This is called when the game version or any mod version
|
|
252
|
+
* Register a function to be run when mod configuration changes. This is called when the major game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, or when any prototypes have been added or removed. It allows the mod to make any changes it deems appropriate to both the data structures in its {@link global | global} table or to the game state through {@link LuaGameScript | LuaGameScript}.
|
|
253
|
+
* @remarks
|
|
254
|
+
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
255
|
+
*
|
|
253
256
|
* @param f - The handler for this event. Passing `nil` will unregister it.
|
|
254
257
|
*/
|
|
255
258
|
on_configuration_changed(this: void,
|
|
@@ -282,7 +285,10 @@ interface LuaBootstrap {
|
|
|
282
285
|
filters?: EventFilter[]): void
|
|
283
286
|
|
|
284
287
|
/**
|
|
285
|
-
* Register a
|
|
288
|
+
* Register a function to be run on mod initialization. This is only called when a new save game is created or when a save file is loaded that previously didn't contain the mod. During it, the mod gets the chance to set up initial values that it will use for its lifetime. It has full access to {@link LuaGameScript | LuaGameScript} and the {@link global | global} table and can change anything about them that it deems appropriate. No other events will be raised for the mod until it has finished this step.
|
|
289
|
+
* @remarks
|
|
290
|
+
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
291
|
+
*
|
|
286
292
|
* @param f - The handler for this event. Passing `nil` will unregister it.
|
|
287
293
|
* @example
|
|
288
294
|
* Initialize a `players` table in `global` for later use.
|
|
@@ -297,14 +303,17 @@ interface LuaBootstrap {
|
|
|
297
303
|
f: (this: void) => any): void
|
|
298
304
|
|
|
299
305
|
/**
|
|
300
|
-
* Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript | LuaGameScript}
|
|
306
|
+
* Register a function to be run on save load. This is only called for mods that have been part of the save previously, or for players connecting to a running multiplayer session. It gives the mod the opportunity to do some very specific actions, should it need to. Doing anything other than these three will lead to desyncs, which breaks multiplayer and replay functionality. Access to {@link LuaGameScript | LuaGameScript} is not available. The {@link global | global} table can be accessed and is safe to read from, but not write to, as doing so will lead to an error.
|
|
301
307
|
*
|
|
302
|
-
* The only legitimate uses of this event are
|
|
303
|
-
* - Re-setup {@link metatables | https://www.lua.org/pil/13.html} as they are not persisted through save
|
|
304
|
-
* - Re-setup conditional event handlers.
|
|
305
|
-
* - Create local references to data stored in the {@link global |
|
|
308
|
+
* The only legitimate uses of this event are the following:
|
|
309
|
+
* - Re-setup {@link metatables | https://www.lua.org/pil/13.html} as they are not persisted through the save/load cycle.
|
|
310
|
+
* - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
|
|
311
|
+
* - Create local references to data stored in the {@link global | global} table.
|
|
306
312
|
*
|
|
307
|
-
* For all other purposes, {@link LuaBootstrap::on_init | LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | LuaBootstrap::on_configuration_changed} or
|
|
313
|
+
* For all other purposes, {@link LuaBootstrap::on_init | LuaBootstrap::on_init}, {@link LuaBootstrap::on_configuration_changed | LuaBootstrap::on_configuration_changed} or {@link migrations | migrations} should be used instead.
|
|
314
|
+
* @remarks
|
|
315
|
+
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
316
|
+
*
|
|
308
317
|
* @param f - The handler for this event. Passing `nil` will unregister it.
|
|
309
318
|
*/
|
|
310
319
|
on_load(this: void,
|
|
@@ -1547,7 +1556,7 @@ interface LuaCustomInputPrototype {
|
|
|
1547
1556
|
readonly object_name: string
|
|
1548
1557
|
|
|
1549
1558
|
/**
|
|
1550
|
-
*
|
|
1559
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
1551
1560
|
*/
|
|
1552
1561
|
readonly order: string
|
|
1553
1562
|
|
|
@@ -1647,7 +1656,7 @@ interface LuaDamagePrototype {
|
|
|
1647
1656
|
readonly object_name: string
|
|
1648
1657
|
|
|
1649
1658
|
/**
|
|
1650
|
-
*
|
|
1659
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
1651
1660
|
*/
|
|
1652
1661
|
readonly order: string
|
|
1653
1662
|
|
|
@@ -1728,7 +1737,7 @@ interface LuaDecorativePrototype {
|
|
|
1728
1737
|
readonly object_name: string
|
|
1729
1738
|
|
|
1730
1739
|
/**
|
|
1731
|
-
*
|
|
1740
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
1732
1741
|
*/
|
|
1733
1742
|
readonly order: string
|
|
1734
1743
|
|
|
@@ -2199,7 +2208,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2199
2208
|
get_or_create_control_behavior(this: void): void
|
|
2200
2209
|
|
|
2201
2210
|
/**
|
|
2202
|
-
* Gets the
|
|
2211
|
+
* Gets the entity's output inventory if it has one.
|
|
2203
2212
|
*/
|
|
2204
2213
|
get_output_inventory(this: void): void
|
|
2205
2214
|
|
|
@@ -2375,7 +2384,7 @@ interface LuaEntity extends LuaControl {
|
|
|
2375
2384
|
is_closing(this: void): void
|
|
2376
2385
|
|
|
2377
2386
|
/**
|
|
2378
|
-
* Returns true if this entity is connected to an electric network.
|
|
2387
|
+
* Returns `true` if this entity produces or consumes electricity and is connected to an electric network that has at least one entity that can produce power.
|
|
2379
2388
|
*/
|
|
2380
2389
|
is_connected_to_electric_network(this: void): void
|
|
2381
2390
|
|
|
@@ -2788,14 +2797,17 @@ interface LuaEntity extends LuaControl {
|
|
|
2788
2797
|
readonly armed: boolean
|
|
2789
2798
|
|
|
2790
2799
|
/**
|
|
2791
|
-
* The player this character is associated with or `nil` if
|
|
2800
|
+
* The player this character is associated with, or `nil` if there isn't one. Set to `nil` to clear.
|
|
2801
|
+
*
|
|
2802
|
+
* The player will be automatically disassociated when a controller is set on the character. Also, all characters associated to a player will be logged off when the player logs off in multiplayer.
|
|
2803
|
+
*
|
|
2804
|
+
* Reading this property will return a {@link LuaPlayer | LuaPlayer}, while {@link PlayerIdentification | PlayerIdentification} can be used when writing.
|
|
2792
2805
|
* @remarks
|
|
2793
2806
|
* A character associated with a player is not directly controlled by any player.
|
|
2794
|
-
* Set to `nil` to clear. The player will be automatically disassociated when a controller is set on the character.
|
|
2795
2807
|
* Applies to subclasses: Character
|
|
2796
2808
|
*
|
|
2797
2809
|
*/
|
|
2798
|
-
associated_player?: LuaPlayer
|
|
2810
|
+
associated_player?: LuaPlayer | PlayerIdentification
|
|
2799
2811
|
|
|
2800
2812
|
/**
|
|
2801
2813
|
* Whether this rocket silo automatically launches the rocket when cargo is inserted.
|
|
@@ -3349,12 +3361,14 @@ interface LuaEntity extends LuaControl {
|
|
|
3349
3361
|
kills: number
|
|
3350
3362
|
|
|
3351
3363
|
/**
|
|
3352
|
-
* The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. Can be `nil` if the last user is not part of the save anymore.
|
|
3364
|
+
* The last player that changed any setting on this entity. This includes building the entity, changing its color, or configuring its circuit network. Can be `nil` if the last user is not part of the save anymore.
|
|
3365
|
+
*
|
|
3366
|
+
* Reading this property will return a {@link LuaPlayer | LuaPlayer}, while {@link PlayerIdentification | PlayerIdentification} can be used when writing.
|
|
3353
3367
|
* @remarks
|
|
3354
3368
|
* Applies to subclasses: EntityWithOwner
|
|
3355
3369
|
*
|
|
3356
3370
|
*/
|
|
3357
|
-
last_user: LuaPlayer
|
|
3371
|
+
last_user: LuaPlayer | PlayerIdentification
|
|
3358
3372
|
|
|
3359
3373
|
/**
|
|
3360
3374
|
* The link ID this linked container is using.
|
|
@@ -3616,8 +3630,10 @@ interface LuaEntity extends LuaControl {
|
|
|
3616
3630
|
|
|
3617
3631
|
/**
|
|
3618
3632
|
* The player that this `simple-entity-with-owner`, `simple-entity-with-force`, `flying-text`, or `highlight-box` is visible to. `nil` means it is rendered for every player.
|
|
3633
|
+
*
|
|
3634
|
+
* Reading this property will return a {@link LuaPlayer | LuaPlayer}, while {@link PlayerIdentification | PlayerIdentification} can be used when writing.
|
|
3619
3635
|
*/
|
|
3620
|
-
render_player: LuaPlayer
|
|
3636
|
+
render_player: LuaPlayer | PlayerIdentification
|
|
3621
3637
|
|
|
3622
3638
|
/**
|
|
3623
3639
|
* The forces that this `simple-entity-with-owner`, `simple-entity-with-force`, or `flying-text` is visible to. `nil` or an empty array means it is rendered for every force.
|
|
@@ -3657,12 +3673,12 @@ interface LuaEntity extends LuaControl {
|
|
|
3657
3673
|
rotatable: boolean
|
|
3658
3674
|
|
|
3659
3675
|
/**
|
|
3660
|
-
* The secondary bounding box of this entity or `nil` if it doesn't have one.
|
|
3676
|
+
* The secondary bounding box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
|
3661
3677
|
*/
|
|
3662
3678
|
readonly secondary_bounding_box?: BoundingBox
|
|
3663
3679
|
|
|
3664
3680
|
/**
|
|
3665
|
-
* The secondary selection box of this entity or `nil` if it doesn't have one.
|
|
3681
|
+
* The secondary selection box of this entity or `nil` if it doesn't have one. This only exists for curved rails, and is automatically determined by the game.
|
|
3666
3682
|
*/
|
|
3667
3683
|
readonly secondary_selection_box?: BoundingBox
|
|
3668
3684
|
|
|
@@ -4059,6 +4075,11 @@ interface LuaEntityPrototype {
|
|
|
4059
4075
|
*/
|
|
4060
4076
|
readonly always_on?: boolean
|
|
4061
4077
|
|
|
4078
|
+
/**
|
|
4079
|
+
* Gets the animation speed coefficient of this belt . `nil` if this is not transport belt connectable.
|
|
4080
|
+
*/
|
|
4081
|
+
readonly animation_speed_coefficient: number
|
|
4082
|
+
|
|
4062
4083
|
/**
|
|
4063
4084
|
* The attack parameters for this entity or `nil` if the entity doesn't use attack parameters.
|
|
4064
4085
|
*/
|
|
@@ -4074,6 +4095,11 @@ interface LuaEntityPrototype {
|
|
|
4074
4095
|
*/
|
|
4075
4096
|
readonly automated_ammo_count?: number
|
|
4076
4097
|
|
|
4098
|
+
/**
|
|
4099
|
+
* Does this prototoype automaticly cycle weapons. `nil` if this is not a spider vechicle.
|
|
4100
|
+
*/
|
|
4101
|
+
readonly automatic_weapon_cycling: boolean
|
|
4102
|
+
|
|
4077
4103
|
/**
|
|
4078
4104
|
* Autoplace specification for this entity prototype. `nil` if none.
|
|
4079
4105
|
*/
|
|
@@ -4150,6 +4176,11 @@ interface LuaEntityPrototype {
|
|
|
4150
4176
|
*/
|
|
4151
4177
|
readonly center_collision_mask: CollisionMask
|
|
4152
4178
|
|
|
4179
|
+
/**
|
|
4180
|
+
* Gets the chain shooting cooldown modifier of this prototype. `nil` if this is not a spider vechicle.
|
|
4181
|
+
*/
|
|
4182
|
+
readonly chain_shooting_cooldown_modifier: number
|
|
4183
|
+
|
|
4153
4184
|
/**
|
|
4154
4185
|
* @remarks
|
|
4155
4186
|
* Applies to subclasses: Character
|
|
@@ -4157,6 +4188,11 @@ interface LuaEntityPrototype {
|
|
|
4157
4188
|
*/
|
|
4158
4189
|
readonly character_corpse: LuaEntityPrototype
|
|
4159
4190
|
|
|
4191
|
+
/**
|
|
4192
|
+
* Gets the chunk exploration radius of this prototype. `nil` if this is not a spider vechicle.
|
|
4193
|
+
*/
|
|
4194
|
+
readonly chunk_exploration_radius: number
|
|
4195
|
+
|
|
4160
4196
|
/**
|
|
4161
4197
|
* The item prototype name used to destroy this cliff or `nil`.
|
|
4162
4198
|
*/
|
|
@@ -4311,6 +4347,14 @@ interface LuaEntityPrototype {
|
|
|
4311
4347
|
*/
|
|
4312
4348
|
readonly drop_item_distance: number
|
|
4313
4349
|
|
|
4350
|
+
/**
|
|
4351
|
+
* The dying time of this corpse prototype. `nil` if not a corpse prototype.
|
|
4352
|
+
* @remarks
|
|
4353
|
+
* Applies to subclasses: Corpse
|
|
4354
|
+
*
|
|
4355
|
+
*/
|
|
4356
|
+
readonly dying_speed: number
|
|
4357
|
+
|
|
4314
4358
|
/**
|
|
4315
4359
|
* The effectivity of this car prototype, generator prototype or `nil`.
|
|
4316
4360
|
*/
|
|
@@ -4481,6 +4525,11 @@ interface LuaEntityPrototype {
|
|
|
4481
4525
|
*/
|
|
4482
4526
|
readonly heat_energy_source_prototype?: LuaHeatEnergySourcePrototype
|
|
4483
4527
|
|
|
4528
|
+
/**
|
|
4529
|
+
* Gets the height of this prototype. `nil` if this is not a spider vechicle.
|
|
4530
|
+
*/
|
|
4531
|
+
readonly height: number
|
|
4532
|
+
|
|
4484
4533
|
/**
|
|
4485
4534
|
* Every time this infinite resource 'ticks' down it is reduced by this amount. `nil` when not a resource. Meaningless if this isn't an infinite type resource.
|
|
4486
4535
|
*/
|
|
@@ -4612,6 +4661,13 @@ interface LuaEntityPrototype {
|
|
|
4612
4661
|
*/
|
|
4613
4662
|
readonly loot_pickup_distance: number
|
|
4614
4663
|
|
|
4664
|
+
/**
|
|
4665
|
+
* Get the manual range modifier for artillery turret and artillery wagon prototypes. `nil` if not artillery type prototype
|
|
4666
|
+
*
|
|
4667
|
+
* subclass(ArtilleryWagon, ArtilleryTurret)
|
|
4668
|
+
*/
|
|
4669
|
+
readonly manual_range_modifier: number
|
|
4670
|
+
|
|
4615
4671
|
/**
|
|
4616
4672
|
* The map color used when charting this entity if a friendly or enemy color isn't defined or `nil`.
|
|
4617
4673
|
*/
|
|
@@ -4797,7 +4853,7 @@ interface LuaEntityPrototype {
|
|
|
4797
4853
|
readonly object_name: string
|
|
4798
4854
|
|
|
4799
4855
|
/**
|
|
4800
|
-
*
|
|
4856
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
4801
4857
|
*/
|
|
4802
4858
|
readonly order: string
|
|
4803
4859
|
|
|
@@ -5064,6 +5120,11 @@ interface LuaEntityPrototype {
|
|
|
5064
5120
|
*/
|
|
5065
5121
|
readonly timeout: number
|
|
5066
5122
|
|
|
5123
|
+
/**
|
|
5124
|
+
* Gets the torso rotation speed of this prototype. `nil` if this is not a spider vechicle.
|
|
5125
|
+
*/
|
|
5126
|
+
readonly torso_rotation_speed: number
|
|
5127
|
+
|
|
5067
5128
|
/**
|
|
5068
5129
|
* If it is a tree, return the number of colors it supports. `nil` otherwise.
|
|
5069
5130
|
*/
|
|
@@ -5223,7 +5284,7 @@ interface LuaEquipmentCategoryPrototype {
|
|
|
5223
5284
|
readonly object_name: string
|
|
5224
5285
|
|
|
5225
5286
|
/**
|
|
5226
|
-
*
|
|
5287
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
5227
5288
|
*/
|
|
5228
5289
|
readonly order: string
|
|
5229
5290
|
|
|
@@ -5417,7 +5478,7 @@ interface LuaEquipmentGridPrototype {
|
|
|
5417
5478
|
readonly object_name: string
|
|
5418
5479
|
|
|
5419
5480
|
/**
|
|
5420
|
-
*
|
|
5481
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
5421
5482
|
*/
|
|
5422
5483
|
readonly order: string
|
|
5423
5484
|
|
|
@@ -5516,7 +5577,7 @@ interface LuaEquipmentPrototype {
|
|
|
5516
5577
|
readonly object_name: string
|
|
5517
5578
|
|
|
5518
5579
|
/**
|
|
5519
|
-
*
|
|
5580
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
5520
5581
|
*/
|
|
5521
5582
|
readonly order: string
|
|
5522
5583
|
|
|
@@ -5552,7 +5613,7 @@ interface LuaEquipmentPrototype {
|
|
|
5552
5613
|
*
|
|
5553
5614
|
* Examples:
|
|
5554
5615
|
* - The item production GUI shows "consumption" on the right, thus `output` describes the item consumption numbers. The same goes for fluid consumption.
|
|
5555
|
-
* - The kills
|
|
5616
|
+
* - The kills GUI shows "losses" on the right, so `output` describes how many of the force's entities were killed by enemies.
|
|
5556
5617
|
* - The electric network GUI shows "power consumption" on the left side, so in this case `input` describes the power consumption numbers.
|
|
5557
5618
|
*/
|
|
5558
5619
|
interface LuaFlowStatistics {
|
|
@@ -5562,17 +5623,23 @@ interface LuaFlowStatistics {
|
|
|
5562
5623
|
clear(this: void): void
|
|
5563
5624
|
|
|
5564
5625
|
/**
|
|
5565
|
-
* Gets the flow count value for the given time frame.
|
|
5566
|
-
*
|
|
5626
|
+
* Gets the flow count value for the given time frame. If `sample_index` is not provided, then the value returned is the average across the provided precision time period. These are the values shown in the bottom section of the statistics GUIs.
|
|
5627
|
+
*
|
|
5628
|
+
* Use `sample_index` to access the data used to generate the statistics graphs. Each precision level contains 300 samples of data so at a precision of 1 minute, each sample contains data averaged across 60s / 300 = 0.2s = 12 ticks.
|
|
5629
|
+
*
|
|
5630
|
+
* All return values are normalized to be per-tick for electric networks and per-minute for all other types.
|
|
5631
|
+
* @param table.count - If true, the count of items/fluids/entities is returned instead of the per-time-frame value.
|
|
5567
5632
|
* @param table.input - Read the input values or the output values
|
|
5568
5633
|
* @param table.name - The prototype name.
|
|
5569
|
-
* @param table.precision_index - The precision to read.
|
|
5634
|
+
* @param table.precision_index - The precision range to read.
|
|
5635
|
+
* @param table.sample_index - The sample index to read from within the precision range. If not provided, the entire precision range is read. Must be between 1 and 300 where 1 is the most recent sample and 300 is the oldest.
|
|
5570
5636
|
*/
|
|
5571
5637
|
get_flow_count(this: void,
|
|
5572
5638
|
table: {
|
|
5573
5639
|
name: string,
|
|
5574
5640
|
input: boolean,
|
|
5575
5641
|
precision_index: defines.flow_precision_index,
|
|
5642
|
+
sample_index?: number,
|
|
5576
5643
|
count?: boolean
|
|
5577
5644
|
}): void
|
|
5578
5645
|
|
|
@@ -5680,7 +5747,7 @@ interface LuaFluidBox {
|
|
|
5680
5747
|
index: number): void
|
|
5681
5748
|
|
|
5682
5749
|
/**
|
|
5683
|
-
* The
|
|
5750
|
+
* The fluidboxes to which the fluidbox at the given index is connected.
|
|
5684
5751
|
*/
|
|
5685
5752
|
get_connections(this: void,
|
|
5686
5753
|
index: number): void
|
|
@@ -5957,7 +6024,7 @@ interface LuaFluidPrototype {
|
|
|
5957
6024
|
readonly object_name: string
|
|
5958
6025
|
|
|
5959
6026
|
/**
|
|
5960
|
-
*
|
|
6027
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
5961
6028
|
*/
|
|
5962
6029
|
readonly order: string
|
|
5963
6030
|
|
|
@@ -6705,7 +6772,7 @@ interface LuaFuelCategoryPrototype {
|
|
|
6705
6772
|
readonly object_name: string
|
|
6706
6773
|
|
|
6707
6774
|
/**
|
|
6708
|
-
*
|
|
6775
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
6709
6776
|
*/
|
|
6710
6777
|
readonly order: string
|
|
6711
6778
|
|
|
@@ -7067,10 +7134,7 @@ interface LuaGameScript {
|
|
|
7067
7134
|
sound_path: SoundPath): void
|
|
7068
7135
|
|
|
7069
7136
|
/**
|
|
7070
|
-
* Checks if the given SpritePath is valid and contains a loaded sprite.
|
|
7071
|
-
* @remarks
|
|
7072
|
-
* The existence of the image is not checked for paths of type `file`.
|
|
7073
|
-
*
|
|
7137
|
+
* 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`.
|
|
7074
7138
|
* @param sprite_path - Path to the image.
|
|
7075
7139
|
*/
|
|
7076
7140
|
is_valid_sprite_path(this: void,
|
|
@@ -7574,7 +7638,9 @@ interface LuaGameScript {
|
|
|
7574
7638
|
readonly permissions: LuaPermissionGroups
|
|
7575
7639
|
|
|
7576
7640
|
/**
|
|
7577
|
-
*
|
|
7641
|
+
* This property is only populated inside {@link custom command | LuaCommandProcessor} handlers and when writing {@link Lua console commands | https://wiki.factorio.com/Console#Scripting_and_cheat_commands}. Returns the player that is typing the command, `nil` in all other instances.
|
|
7642
|
+
*
|
|
7643
|
+
* See {@link LuaGameScript::players | LuaGameScript::players} for accessing all players.
|
|
7578
7644
|
*/
|
|
7579
7645
|
readonly player: LuaPlayer
|
|
7580
7646
|
|
|
@@ -7761,6 +7827,9 @@ interface LuaGroup {
|
|
|
7761
7827
|
*/
|
|
7762
7828
|
readonly object_name: string
|
|
7763
7829
|
|
|
7830
|
+
/**
|
|
7831
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
7832
|
+
*/
|
|
7764
7833
|
readonly order: string
|
|
7765
7834
|
|
|
7766
7835
|
/**
|
|
@@ -7802,6 +7871,8 @@ interface LuaGui {
|
|
|
7802
7871
|
|
|
7803
7872
|
/**
|
|
7804
7873
|
* Returns `true` if sprite_path is valid and contains loaded sprite, otherwise `false`. Sprite path of type `file` doesn't validate if file exists.
|
|
7874
|
+
*
|
|
7875
|
+
* If you want to avoid needing a LuaGui object, {@link LuaGameScript::is_valid_sprite_path | LuaGameScript::is_valid_sprite_path} can be used instead.
|
|
7805
7876
|
* @param sprite_path - Path to a image.
|
|
7806
7877
|
*/
|
|
7807
7878
|
is_valid_sprite_path(this: void,
|
|
@@ -8334,20 +8405,7 @@ interface LuaGuiElement {
|
|
|
8334
8405
|
draw_vertical_lines: boolean
|
|
8335
8406
|
|
|
8336
8407
|
/**
|
|
8337
|
-
* The elem filters of this choose-elem-button or `nil` if there are no filters.
|
|
8338
|
-
*
|
|
8339
|
-
* The compatible type of filter is determined by elem_type:
|
|
8340
|
-
* - Type `"item"` - {@link ItemPrototypeFilter | ItemPrototypeFilter}
|
|
8341
|
-
* - Type `"tile"` - {@link TilePrototypeFilter | TilePrototypeFilter}
|
|
8342
|
-
* - Type `"entity"` - {@link EntityPrototypeFilter | EntityPrototypeFilter}
|
|
8343
|
-
* - Type `"signal"` - Does not support filters
|
|
8344
|
-
* - Type `"fluid"` - {@link FluidPrototypeFilter | FluidPrototypeFilter}
|
|
8345
|
-
* - Type `"recipe"` - {@link RecipePrototypeFilter | RecipePrototypeFilter}
|
|
8346
|
-
* - Type `"decorative"` - {@link DecorativePrototypeFilter | DecorativePrototypeFilter}
|
|
8347
|
-
* - Type `"item-group"` - Does not support filters
|
|
8348
|
-
* - Type `"achievement"` - {@link AchievementPrototypeFilter | AchievementPrototypeFilter}
|
|
8349
|
-
* - Type `"equipment"` - {@link EquipmentPrototypeFilter | EquipmentPrototypeFilter}
|
|
8350
|
-
* - Type `"technology"` - {@link TechnologyPrototypeFilter | TechnologyPrototypeFilter}
|
|
8408
|
+
* The elem filters of this choose-elem-button, or `nil` if there are no filters. The compatible type of filter is determined by `elem_type`.
|
|
8351
8409
|
* @remarks
|
|
8352
8410
|
* Writing to this field does not change or clear the currently selected element.
|
|
8353
8411
|
* Applies to subclasses: choose-elem-button
|
|
@@ -8500,7 +8558,7 @@ interface LuaGuiElement {
|
|
|
8500
8558
|
mouse_button_filter: MouseButtonFlags
|
|
8501
8559
|
|
|
8502
8560
|
/**
|
|
8503
|
-
* The name of this element.
|
|
8561
|
+
* The name of this element. `""` if no name was set.
|
|
8504
8562
|
* @example
|
|
8505
8563
|
* ```
|
|
8506
8564
|
* game.player.gui.top.greeting.name == "greeting"
|
|
@@ -9439,7 +9497,7 @@ interface LuaItemPrototype {
|
|
|
9439
9497
|
readonly mapper_count: number
|
|
9440
9498
|
|
|
9441
9499
|
/**
|
|
9442
|
-
* Effects of this module
|
|
9500
|
+
* Effects of this module.
|
|
9443
9501
|
* @remarks
|
|
9444
9502
|
* Applies to subclasses: ModuleItem
|
|
9445
9503
|
*
|
|
@@ -9457,7 +9515,7 @@ interface LuaItemPrototype {
|
|
|
9457
9515
|
readonly object_name: string
|
|
9458
9516
|
|
|
9459
9517
|
/**
|
|
9460
|
-
*
|
|
9518
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
9461
9519
|
*/
|
|
9462
9520
|
readonly order: string
|
|
9463
9521
|
|
|
@@ -10956,7 +11014,7 @@ interface LuaModSettingPrototype {
|
|
|
10956
11014
|
readonly object_name: string
|
|
10957
11015
|
|
|
10958
11016
|
/**
|
|
10959
|
-
*
|
|
11017
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
10960
11018
|
*/
|
|
10961
11019
|
readonly order: string
|
|
10962
11020
|
|
|
@@ -10993,7 +11051,7 @@ interface LuaModuleCategoryPrototype {
|
|
|
10993
11051
|
readonly object_name: string
|
|
10994
11052
|
|
|
10995
11053
|
/**
|
|
10996
|
-
*
|
|
11054
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
10997
11055
|
*/
|
|
10998
11056
|
readonly order: string
|
|
10999
11057
|
|
|
@@ -11038,7 +11096,7 @@ interface LuaNamedNoiseExpression {
|
|
|
11038
11096
|
readonly object_name: string
|
|
11039
11097
|
|
|
11040
11098
|
/**
|
|
11041
|
-
*
|
|
11099
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
11042
11100
|
*/
|
|
11043
11101
|
readonly order: string
|
|
11044
11102
|
|
|
@@ -11073,7 +11131,7 @@ interface LuaNoiseLayerPrototype {
|
|
|
11073
11131
|
readonly object_name: string
|
|
11074
11132
|
|
|
11075
11133
|
/**
|
|
11076
|
-
*
|
|
11134
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
11077
11135
|
*/
|
|
11078
11136
|
readonly order: string
|
|
11079
11137
|
|
|
@@ -11118,7 +11176,7 @@ interface LuaParticlePrototype {
|
|
|
11118
11176
|
readonly object_name: string
|
|
11119
11177
|
|
|
11120
11178
|
/**
|
|
11121
|
-
*
|
|
11179
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
11122
11180
|
*/
|
|
11123
11181
|
readonly order: string
|
|
11124
11182
|
|
|
@@ -11881,7 +11939,7 @@ interface LuaPlayer extends LuaControl {
|
|
|
11881
11939
|
hand_location: ItemStackLocation
|
|
11882
11940
|
|
|
11883
11941
|
/**
|
|
11884
|
-
* This player's index in {@link LuaGameScript::players | LuaGameScript::players}.
|
|
11942
|
+
* This player's unique index in {@link LuaGameScript::players | LuaGameScript::players}. It is given to them when they are {@link created | on_player_created} and remains assigned to them until they are {@link removed | on_player_removed}.
|
|
11885
11943
|
*/
|
|
11886
11944
|
readonly index: number
|
|
11887
11945
|
|
|
@@ -12340,7 +12398,7 @@ interface LuaRecipe {
|
|
|
12340
12398
|
readonly object_name: string
|
|
12341
12399
|
|
|
12342
12400
|
/**
|
|
12343
|
-
*
|
|
12401
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
12344
12402
|
*/
|
|
12345
12403
|
readonly order: string
|
|
12346
12404
|
|
|
@@ -12390,7 +12448,7 @@ interface LuaRecipeCategoryPrototype {
|
|
|
12390
12448
|
readonly object_name: string
|
|
12391
12449
|
|
|
12392
12450
|
/**
|
|
12393
|
-
*
|
|
12451
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
12394
12452
|
*/
|
|
12395
12453
|
readonly order: string
|
|
12396
12454
|
|
|
@@ -12508,7 +12566,7 @@ interface LuaRecipePrototype {
|
|
|
12508
12566
|
readonly object_name: string
|
|
12509
12567
|
|
|
12510
12568
|
/**
|
|
12511
|
-
*
|
|
12569
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
12512
12570
|
*/
|
|
12513
12571
|
readonly order: string
|
|
12514
12572
|
|
|
@@ -12644,13 +12702,13 @@ interface LuaRendering {
|
|
|
12644
12702
|
* @param table.animation - Name of an [animation prototype](https://wiki.factorio.com/Prototype/Animation).
|
|
12645
12703
|
* @param table.animation_offset - Offset of the animation in frames. Default is 0.
|
|
12646
12704
|
* @param table.animation_speed - How many frames the animation goes forward per tick. Default is 1.
|
|
12647
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12705
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12648
12706
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12649
12707
|
* @param table.orientation - The orientation of the animation. Default is 0.
|
|
12650
12708
|
* @param table.orientation_target - If given, the animation rotates so that it faces this target. Note that `orientation` is still applied to the animation.
|
|
12651
12709
|
* @param table.orientation_target_offset - Only used if `orientation_target` is a LuaEntity.
|
|
12652
12710
|
* @param table.oriented_offset - Offsets the center of the animation if `orientation_target` is given. This offset will rotate together with the animation.
|
|
12653
|
-
* @param table.players - The players that this object is rendered to.
|
|
12711
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12654
12712
|
* @param table.target - Center of the animation.
|
|
12655
12713
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12656
12714
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
@@ -12685,11 +12743,11 @@ interface LuaRendering {
|
|
|
12685
12743
|
* Create an arc.
|
|
12686
12744
|
* @param table.angle - The angle of the arc, in radian.
|
|
12687
12745
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12688
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12746
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12689
12747
|
* @param table.max_radius - The radius of the outer edge of the arc, in tiles.
|
|
12690
12748
|
* @param table.min_radius - The radius of the inner edge of the arc, in tiles.
|
|
12691
12749
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12692
|
-
* @param table.players - The players that this object is rendered to.
|
|
12750
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12693
12751
|
* @param table.start_angle - Where the arc starts, in radian.
|
|
12694
12752
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12695
12753
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
@@ -12717,9 +12775,9 @@ interface LuaRendering {
|
|
|
12717
12775
|
* Create a circle.
|
|
12718
12776
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12719
12777
|
* @param table.filled - If the circle should be filled.
|
|
12720
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12778
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12721
12779
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12722
|
-
* @param table.players - The players that this object is rendered to.
|
|
12780
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12723
12781
|
* @param table.radius - In tiles.
|
|
12724
12782
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12725
12783
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
@@ -12749,13 +12807,13 @@ interface LuaRendering {
|
|
|
12749
12807
|
* The base game uses the utility sprites `light_medium` and `light_small` for lights.
|
|
12750
12808
|
*
|
|
12751
12809
|
* @param table.color - Defaults to white (no tint).
|
|
12752
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12810
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12753
12811
|
* @param table.intensity - Default is 1.
|
|
12754
12812
|
* @param table.minimum_darkness - The minimum darkness at which this light is rendered. Default is 0.
|
|
12755
12813
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12756
12814
|
* @param table.orientation - The orientation of the light. Default is 0.
|
|
12757
12815
|
* @param table.oriented - If this light has the same orientation as the entity target, default is false. Note that `orientation` is still applied to the sprite.
|
|
12758
|
-
* @param table.players - The players that this object is rendered to.
|
|
12816
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12759
12817
|
* @param table.scale - Default is 1.
|
|
12760
12818
|
* @param table.target - Center of the light.
|
|
12761
12819
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
@@ -12785,11 +12843,11 @@ interface LuaRendering {
|
|
|
12785
12843
|
* Create a line.
|
|
12786
12844
|
* @param table.dash_length - Length of the dashes that this line has. Used only if gap_length > 0. Default is 0.
|
|
12787
12845
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12788
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12846
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12789
12847
|
* @param table.from_offset - Only used if `from` is a LuaEntity.
|
|
12790
12848
|
* @param table.gap_length - Length of the gaps that this line has, in tiles. Default is 0.
|
|
12791
12849
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12792
|
-
* @param table.players - The players that this object is rendered to.
|
|
12850
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12793
12851
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
12794
12852
|
* @param table.to_offset - Only used if `to` is a LuaEntity.
|
|
12795
12853
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
@@ -12829,12 +12887,12 @@ interface LuaRendering {
|
|
|
12829
12887
|
/**
|
|
12830
12888
|
* Create a triangle mesh defined by a triangle strip.
|
|
12831
12889
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12832
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12890
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12833
12891
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12834
12892
|
* @param table.orientation - The orientation applied to all vertices. Default is 0.
|
|
12835
12893
|
* @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.
|
|
12836
12894
|
* @param table.orientation_target_offset - Only used if `orientation_target` is a LuaEntity.
|
|
12837
|
-
* @param table.players - The players that this object is rendered to.
|
|
12895
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12838
12896
|
* @param table.target - Acts like an offset applied to all vertices that are not set to an entity.
|
|
12839
12897
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12840
12898
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
@@ -12862,10 +12920,10 @@ interface LuaRendering {
|
|
|
12862
12920
|
* Create a rectangle.
|
|
12863
12921
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12864
12922
|
* @param table.filled - If the rectangle should be filled.
|
|
12865
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12923
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12866
12924
|
* @param table.left_top_offset - Only used if `left_top` is a LuaEntity.
|
|
12867
12925
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12868
|
-
* @param table.players - The players that this object is rendered to.
|
|
12926
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12869
12927
|
* @param table.right_bottom_offset - Only used if `right_bottom` is a LuaEntity.
|
|
12870
12928
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
12871
12929
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
@@ -12891,13 +12949,13 @@ interface LuaRendering {
|
|
|
12891
12949
|
|
|
12892
12950
|
/**
|
|
12893
12951
|
* Create a sprite.
|
|
12894
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
12952
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12895
12953
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12896
12954
|
* @param table.orientation - The orientation of the sprite. Default is 0.
|
|
12897
12955
|
* @param table.orientation_target - If given, the sprite rotates so that it faces this target. Note that `orientation` is still applied to the sprite.
|
|
12898
12956
|
* @param table.orientation_target_offset - Only used if `orientation_target` is a LuaEntity.
|
|
12899
12957
|
* @param table.oriented_offset - Offsets the center of the sprite if `orientation_target` is given. This offset will rotate together with the sprite.
|
|
12900
|
-
* @param table.players - The players that this object is rendered to.
|
|
12958
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12901
12959
|
* @param table.target - Center of the sprite.
|
|
12902
12960
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12903
12961
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
@@ -12946,10 +13004,10 @@ interface LuaRendering {
|
|
|
12946
13004
|
* @param table.alignment - Defaults to "left". Other options are "right" and "center".
|
|
12947
13005
|
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
12948
13006
|
* @param table.font - Name of font to use. Defaults to the same font as flying-text.
|
|
12949
|
-
* @param table.forces - The forces that this object is rendered to.
|
|
13007
|
+
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
12950
13008
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
12951
13009
|
* @param table.orientation - The orientation of the text. Default is 0.
|
|
12952
|
-
* @param table.players - The players that this object is rendered to.
|
|
13010
|
+
* @param table.players - The players that this object is rendered to. Passing `nil` or an empty table will render it to all players.
|
|
12953
13011
|
* @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.
|
|
12954
13012
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
12955
13013
|
* @param table.text - The text to display.
|
|
@@ -13833,7 +13891,7 @@ interface LuaResourceCategoryPrototype {
|
|
|
13833
13891
|
readonly object_name: string
|
|
13834
13892
|
|
|
13835
13893
|
/**
|
|
13836
|
-
*
|
|
13894
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
13837
13895
|
*/
|
|
13838
13896
|
readonly order: string
|
|
13839
13897
|
|
|
@@ -13952,7 +14010,7 @@ interface LuaShortcutPrototype {
|
|
|
13952
14010
|
readonly object_name: string
|
|
13953
14011
|
|
|
13954
14012
|
/**
|
|
13955
|
-
*
|
|
14013
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
13956
14014
|
*/
|
|
13957
14015
|
readonly order: string
|
|
13958
14016
|
|
|
@@ -14869,10 +14927,12 @@ interface LuaSurface {
|
|
|
14869
14927
|
*
|
|
14870
14928
|
* If no filters (`name`, `type`, `force`, etc.) are given, this returns all entities in the search area. If multiple filters are specified, only entities matching all given filters are returned.
|
|
14871
14929
|
*
|
|
14872
|
-
* If no `area` or `position` are given, the entire surface is searched.
|
|
14873
|
-
*
|
|
14930
|
+
* - If no `area` or `position` are given, the entire surface is searched.
|
|
14931
|
+
* - If `position` is given, this returns the entities colliding with that position (i.e the given position is within the entity's collision box).
|
|
14932
|
+
* - If `position` and `radius` are given, this returns the entities within the radius of the position. Looks for the center of entities.
|
|
14933
|
+
* - If `area` is specified, this returns the entities colliding with that area.
|
|
14934
|
+
* @param table.invert - Whether the filters should be inverted.
|
|
14874
14935
|
* @param table.position - Has precedence over area field.
|
|
14875
|
-
* @param table.radius - If given with position, will return all entities within the radius of the position.
|
|
14876
14936
|
* @example
|
|
14877
14937
|
* ```
|
|
14878
14938
|
* game.surfaces[1].find_entities_filtered{area = {{-10, -10}, {10, 10}}, type = "resource"} -- gets all resources in the rectangle
|
|
@@ -15565,7 +15625,7 @@ interface LuaTechnology {
|
|
|
15565
15625
|
readonly object_name: string
|
|
15566
15626
|
|
|
15567
15627
|
/**
|
|
15568
|
-
*
|
|
15628
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
15569
15629
|
*/
|
|
15570
15630
|
readonly order: string
|
|
15571
15631
|
|
|
@@ -15684,7 +15744,7 @@ interface LuaTechnologyPrototype {
|
|
|
15684
15744
|
readonly object_name: string
|
|
15685
15745
|
|
|
15686
15746
|
/**
|
|
15687
|
-
*
|
|
15747
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
15688
15748
|
*/
|
|
15689
15749
|
readonly order: string
|
|
15690
15750
|
|
|
@@ -15857,7 +15917,7 @@ interface LuaTilePrototype {
|
|
|
15857
15917
|
readonly emissions_per_second: number
|
|
15858
15918
|
|
|
15859
15919
|
/**
|
|
15860
|
-
* Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name.
|
|
15920
|
+
* Items that when placed will produce this tile. It is a dictionary indexed by the item prototype name. `nil` (instead of an empty table) if no items can place this tile.
|
|
15861
15921
|
*/
|
|
15862
15922
|
readonly items_to_place_this: SimpleItemStack[]
|
|
15863
15923
|
|
|
@@ -15869,7 +15929,7 @@ interface LuaTilePrototype {
|
|
|
15869
15929
|
|
|
15870
15930
|
readonly map_color: Color
|
|
15871
15931
|
|
|
15872
|
-
readonly mineable_properties: { minable: boolean,
|
|
15932
|
+
readonly mineable_properties: { minable: boolean, mining_particle?: string, mining_time: number, products: Product[] }
|
|
15873
15933
|
|
|
15874
15934
|
/**
|
|
15875
15935
|
* Name of this prototype.
|
|
@@ -15892,7 +15952,7 @@ interface LuaTilePrototype {
|
|
|
15892
15952
|
readonly object_name: string
|
|
15893
15953
|
|
|
15894
15954
|
/**
|
|
15895
|
-
*
|
|
15955
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
15896
15956
|
*/
|
|
15897
15957
|
readonly order: string
|
|
15898
15958
|
|
|
@@ -16405,7 +16465,7 @@ interface LuaTrivialSmokePrototype {
|
|
|
16405
16465
|
readonly object_name: string
|
|
16406
16466
|
|
|
16407
16467
|
/**
|
|
16408
|
-
*
|
|
16468
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
16409
16469
|
*/
|
|
16410
16470
|
readonly order: string
|
|
16411
16471
|
|
|
@@ -16550,7 +16610,7 @@ interface LuaVirtualSignalPrototype {
|
|
|
16550
16610
|
readonly object_name: string
|
|
16551
16611
|
|
|
16552
16612
|
/**
|
|
16553
|
-
*
|
|
16613
|
+
* The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.
|
|
16554
16614
|
*/
|
|
16555
16615
|
readonly order: string
|
|
16556
16616
|
|
|
@@ -16737,7 +16797,7 @@ interface LuaGuiElementAddParams {
|
|
|
16737
16797
|
'index'?: number
|
|
16738
16798
|
|
|
16739
16799
|
/**
|
|
16740
|
-
* Name of the child element.
|
|
16800
|
+
* Name of the child element. It must be unique within the parent element.
|
|
16741
16801
|
*/
|
|
16742
16802
|
'name'?: string
|
|
16743
16803
|
|
|
@@ -16834,7 +16894,7 @@ interface LuaGuiElementAddParamsChooseElemButton extends LuaGuiElementAddParams
|
|
|
16834
16894
|
'decorative'?: string
|
|
16835
16895
|
|
|
16836
16896
|
/**
|
|
16837
|
-
* Filters describing what to show in the selection window.
|
|
16897
|
+
* Filters describing what to show in the selection window. The applicable filter depends on the `elem_type`.
|
|
16838
16898
|
*/
|
|
16839
16899
|
'elem_filters'?: ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter[]
|
|
16840
16900
|
|
|
@@ -17328,7 +17388,7 @@ interface LuaSurfaceCreateEntityParams {
|
|
|
17328
17388
|
/**
|
|
17329
17389
|
* Source entity. Used for beams and highlight-boxes.
|
|
17330
17390
|
*/
|
|
17331
|
-
'source'?: LuaEntity
|
|
17391
|
+
'source'?: LuaEntity | MapPosition
|
|
17332
17392
|
|
|
17333
17393
|
/**
|
|
17334
17394
|
* If true, entity types that have spawn_decorations property will apply triggers defined in the property.
|
|
@@ -17343,7 +17403,7 @@ interface LuaSurfaceCreateEntityParams {
|
|
|
17343
17403
|
/**
|
|
17344
17404
|
* Entity with health for the new entity to target.
|
|
17345
17405
|
*/
|
|
17346
|
-
'target'?: LuaEntity
|
|
17406
|
+
'target'?: LuaEntity | MapPosition
|
|
17347
17407
|
|
|
17348
17408
|
}
|
|
17349
17409
|
|
|
@@ -17507,7 +17567,7 @@ interface LuaSurfaceCreateEntityParamsHighlightBox extends LuaSurfaceCreateEntit
|
|
|
17507
17567
|
'blink_interval'?: number
|
|
17508
17568
|
|
|
17509
17569
|
/**
|
|
17510
|
-
* The bounding box defining the highlight box using absolute map coordinates. If specified, the `position` parameter
|
|
17570
|
+
* The bounding box defining the highlight box using absolute map coordinates. If specified, the general `position` parameter still needs to be present, but will be ignored. If not specified, the game falls back to the `source` parameter first, then the `target` parameter second. One of these three parameters need to be specified.
|
|
17511
17571
|
*/
|
|
17512
17572
|
'bounding_box'?: BoundingBox
|
|
17513
17573
|
|
package/dist/concepts.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.60
|
|
6
6
|
// API version 2
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
type AchievementPrototypeFilter = AchievementPrototypeFilterType | DefaultAchievementPrototypeFilter
|
|
17
17
|
|
|
18
|
+
interface AdvancedMapGenSettings {
|
|
19
|
+
'difficulty_settings': DifficultySettings
|
|
20
|
+
'enemy_evolution': EnemyEvolutionMapSettings
|
|
21
|
+
'enemy_expansion': EnemyExpansionMapSettings
|
|
22
|
+
'pollution': PollutionMapSettings
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
/**
|
|
19
26
|
* @param icon - The SignalID used for a custom alert. Only present for custom alerts.
|
|
20
27
|
* @param message - The message for a custom alert. Only present for custom alerts.
|
|
@@ -39,7 +46,7 @@ interface Alert {
|
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
/**
|
|
42
|
-
* A {@link string | string} that specifies where a
|
|
49
|
+
* A {@link string | string} that specifies where a GUI element should be.
|
|
43
50
|
*/
|
|
44
51
|
declare enum Alignment {
|
|
45
52
|
'top-left',
|
|
@@ -191,17 +198,11 @@ interface AutoplaceControl {
|
|
|
191
198
|
'size': MapGenSize
|
|
192
199
|
}
|
|
193
200
|
|
|
194
|
-
interface AutoplaceSetting {
|
|
195
|
-
'frequency': MapGenSize
|
|
196
|
-
'richness': MapGenSize
|
|
197
|
-
'size': MapGenSize
|
|
198
|
-
}
|
|
199
|
-
|
|
200
201
|
/**
|
|
201
202
|
* @param treat_missing_as_default - Whether missing autoplace names for this type should be default enabled.
|
|
202
203
|
*/
|
|
203
204
|
interface AutoplaceSettings {
|
|
204
|
-
'settings': {[key: string]:
|
|
205
|
+
'settings': {[key: string]: AutoplaceControl}
|
|
205
206
|
/**
|
|
206
207
|
* Whether missing autoplace names for this type should be default enabled.
|
|
207
208
|
*/
|
|
@@ -395,7 +396,7 @@ interface BlueprintSignalIcon {
|
|
|
395
396
|
* @example
|
|
396
397
|
* Explicit definition:
|
|
397
398
|
* ```
|
|
398
|
-
* {left_top = {-2, -3}, right_bottom = {5, 8}}
|
|
399
|
+
* {left_top = {x = -2, y = -3}, right_bottom = {x = 5, y = 8}}
|
|
399
400
|
* ```
|
|
400
401
|
*
|
|
401
402
|
* @example
|
|
@@ -1090,6 +1091,9 @@ type EntityPrototypeFilter = EntityPrototypeFilterBuildBaseEvolutionRequirement
|
|
|
1090
1091
|
|
|
1091
1092
|
/**
|
|
1092
1093
|
* This is a set of flags given as a dictionary{@link [string | string} → {@link boolean | boolean}]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
|
|
1094
|
+
* @remarks
|
|
1095
|
+
* By default, none of these flags are set.
|
|
1096
|
+
*
|
|
1093
1097
|
*/
|
|
1094
1098
|
type EntityPrototypeFlags = {
|
|
1095
1099
|
[key in EntityPrototypeFlagsKey]: true
|
|
@@ -1556,6 +1560,9 @@ type ItemPrototypeFilter = ItemPrototypeFilterBurntResult | ItemPrototypeFilterD
|
|
|
1556
1560
|
|
|
1557
1561
|
/**
|
|
1558
1562
|
* This is a set of flags given as dictionary{@link [string | string} → {@link boolean | boolean}]. When a flag is set, it is present in the dictionary with the value `true`. Unset flags aren't present in the dictionary at all. So, the boolean value is meaningless and exists just for easy table lookup if a flag is set.
|
|
1563
|
+
* @remarks
|
|
1564
|
+
* By default, none of these flags are set.
|
|
1565
|
+
*
|
|
1559
1566
|
*/
|
|
1560
1567
|
type ItemPrototypeFlags = {
|
|
1561
1568
|
[key in ItemPrototypeFlagsKey]: true
|
|
@@ -1940,6 +1947,23 @@ interface MapExchangeStringData {
|
|
|
1940
1947
|
'map_settings': MapAndDifficultySettings
|
|
1941
1948
|
}
|
|
1942
1949
|
|
|
1950
|
+
/**
|
|
1951
|
+
* @param default - Whether this is the preset that is selected by default.
|
|
1952
|
+
* @param order - The string used to alphabetically sort the presets. It is a simple string that has no additional semantic meaning.
|
|
1953
|
+
*/
|
|
1954
|
+
interface MapGenPreset {
|
|
1955
|
+
'advanced_settings'?: AdvancedMapGenSettings
|
|
1956
|
+
'basic_settings'?: MapGenSettings
|
|
1957
|
+
/**
|
|
1958
|
+
* Whether this is the preset that is selected by default.
|
|
1959
|
+
*/
|
|
1960
|
+
'default'?: boolean
|
|
1961
|
+
/**
|
|
1962
|
+
* The string used to alphabetically sort the presets. It is a simple string that has no additional semantic meaning.
|
|
1963
|
+
*/
|
|
1964
|
+
'order': string
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1943
1967
|
/**
|
|
1944
1968
|
* The 'map type' dropdown in the map generation GUI is actually a selector for elevation generator. The base game sets `property_expression_names.elevation` to `"0_16-elevation"` to reproduce terrain from 0.16 or to `"0_17-island"` for the island preset. If generators are available for other properties, the 'map type' dropdown in the GUI will be renamed to 'elevation' and shown along with selectors for the other selectable properties.
|
|
1945
1969
|
* @param autoplace_controls - Indexed by autoplace control prototype name.
|
|
@@ -2632,6 +2656,25 @@ interface ProgrammableSpeakerParameters {
|
|
|
2632
2656
|
'playback_volume': number
|
|
2633
2657
|
}
|
|
2634
2658
|
|
|
2659
|
+
/**
|
|
2660
|
+
* Types `"signal"` and `"item-group"` do not support filters.
|
|
2661
|
+
*
|
|
2662
|
+
* Available filters:
|
|
2663
|
+
* - {@link ItemPrototypeFilter | ItemPrototypeFilter} for type `"item"`
|
|
2664
|
+
* - {@link TilePrototypeFilter | TilePrototypeFilter} for type `"tile"`
|
|
2665
|
+
* - {@link EntityPrototypeFilter | EntityPrototypeFilter} for type `"entity"`
|
|
2666
|
+
* - {@link FluidPrototypeFilter | FluidPrototypeFilter} for type `"fluid"`
|
|
2667
|
+
* - {@link RecipePrototypeFilter | RecipePrototypeFilter} for type `"recipe"`
|
|
2668
|
+
* - {@link DecorativePrototypeFilter | DecorativePrototypeFilter} for type `"decorative"`
|
|
2669
|
+
* - {@link AchievementPrototypeFilter | AchievementPrototypeFilter} for type `"achievement"`
|
|
2670
|
+
* - {@link EquipmentPrototypeFilter | EquipmentPrototypeFilter} for type `"equipment"`
|
|
2671
|
+
* - {@link TechnologyPrototypeFilter | TechnologyPrototypeFilter} for type `"technology"`
|
|
2672
|
+
* @remarks
|
|
2673
|
+
* Filters are always used as an array of filters of a specific type. Every filter can only be used with its corresponding event, and different types of event filters can not be mixed.
|
|
2674
|
+
*
|
|
2675
|
+
*/
|
|
2676
|
+
type PrototypeFilter = ItemPrototypeFilter | TilePrototypeFilter | EntityPrototypeFilter | FluidPrototypeFilter | RecipePrototypeFilter | DecorativePrototypeFilter | AchievementPrototypeFilter | EquipmentPrototypeFilter | TechnologyPrototypeFilter
|
|
2677
|
+
|
|
2635
2678
|
/**
|
|
2636
2679
|
* The smooth orientation. It is a {@link float | float} in the range `[0, 1)` that covers a full circle, starting at the top and going clockwise. This means a value of `0` indicates "north", a value of `0.5` indicates "south".
|
|
2637
2680
|
*
|
|
@@ -2880,6 +2923,8 @@ interface SmokeSource {
|
|
|
2880
2923
|
/**
|
|
2881
2924
|
* A sound defined by a {@link string | string}. It can be either the name of a {@link sound prototype | https://wiki.factorio.com/Prototype/Sound} defined in the data stage or a path in the form `"type/name"`. The latter option can be sorted into three categories.
|
|
2882
2925
|
*
|
|
2926
|
+
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript::is_valid_sound_path | LuaGameScript::is_valid_sound_path}.
|
|
2927
|
+
*
|
|
2883
2928
|
* The utility and ambient types each contain general use sound prototypes defined by the game itself.
|
|
2884
2929
|
* - `"utility"` - Uses the {@link UtilitySounds | https://wiki.factorio.com/Prototype/UtilitySounds} prototype. Example: `"utility/wire_connect_pole"`
|
|
2885
2930
|
* - `"ambient"` - Uses {@link AmbientSound | https://wiki.factorio.com/Prototype/AmbientSound} prototypes. Example: `"ambient/resource-deficiency"`
|
|
@@ -2935,6 +2980,8 @@ interface SpawnPointDefinition {
|
|
|
2935
2980
|
/**
|
|
2936
2981
|
* It is specified by {@link string | string}. It can be either the name of a {@link sprite prototype | https://wiki.factorio.com/Prototype/Sprite} defined in the data stage or a path in form "type/name".
|
|
2937
2982
|
*
|
|
2983
|
+
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript::is_valid_sprite_path | LuaGameScript::is_valid_sprite_path}.
|
|
2984
|
+
*
|
|
2938
2985
|
* The supported types are:
|
|
2939
2986
|
* - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate
|
|
2940
2987
|
* - `"entity"` - for example "entity/small-biter" is the icon sprite of the small biter
|
package/dist/core.d.ts
CHANGED
|
@@ -27,7 +27,4 @@ type Table = any;
|
|
|
27
27
|
|
|
28
28
|
// The docs and json definition make reference to these types but have no information as to what they are
|
|
29
29
|
type BlueprintCircuitConnection = any;
|
|
30
|
-
type BlueprintControlBehavior = any;
|
|
31
|
-
|
|
32
|
-
// This is a copy from the data stage, which this package doesn't have type info for currently
|
|
33
|
-
type MapGenPreset = any;
|
|
30
|
+
type BlueprintControlBehavior = any;
|
package/dist/defines.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.60
|
|
6
6
|
// API version 2
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
package/dist/events.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.60
|
|
6
6
|
// API version 2
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1916,6 +1916,10 @@ interface on_pre_surface_deleted extends event {
|
|
|
1916
1916
|
* Called when research is cancelled.
|
|
1917
1917
|
*/
|
|
1918
1918
|
interface on_research_cancelled extends event {
|
|
1919
|
+
/**
|
|
1920
|
+
* The force whose research was cancelled.
|
|
1921
|
+
*/
|
|
1922
|
+
force: LuaForce
|
|
1919
1923
|
/**
|
|
1920
1924
|
* A mapping of technology name to how many times it was cancelled.
|
|
1921
1925
|
*/
|
package/dist/global.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Factorio API reference https://lua-api.factorio.com/latest/index.html
|
|
3
3
|
// Generated from JSON source https://lua-api.factorio.com/latest/runtime-api.json
|
|
4
4
|
// Definition source https://github.com/sguest/factorio-types
|
|
5
|
-
// Factorio version 1.1.
|
|
5
|
+
// Factorio version 1.1.60
|
|
6
6
|
// API version 2
|
|
7
7
|
|
|
8
8
|
/**
|