factorio-types 0.0.32 → 0.0.34
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 +178 -35
- package/dist/concepts.d.ts +135 -12
- package/dist/defines.d.ts +2 -1
- package/dist/events.d.ts +31 -10
- 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.78
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -249,7 +249,14 @@ interface LuaBootstrap {
|
|
|
249
249
|
get_event_order(this: void): void
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
|
-
*
|
|
252
|
+
* Gets the prototype history for the given type and name.
|
|
253
|
+
*/
|
|
254
|
+
get_prototype_history(this: void,
|
|
255
|
+
type: string,
|
|
256
|
+
name: string): void
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Register a function to be run when mod configuration changes. This is called when the game version or any mod version changed, when any mod was added or removed, when a startup setting has changed, when any prototypes have been added or removed, or when a migration was applied. It allows the mod to make any changes it deems appropriate to both the data structures in its {@link global | global} table or to the game state through {@link LuaGameScript | LuaGameScript}.
|
|
253
260
|
* @remarks
|
|
254
261
|
* For more context, refer to the {@link Data Lifecycle | data-lifecycle} page.
|
|
255
262
|
*
|
|
@@ -303,9 +310,11 @@ interface LuaBootstrap {
|
|
|
303
310
|
handler: (this: void) => any | null): void
|
|
304
311
|
|
|
305
312
|
/**
|
|
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.
|
|
313
|
+
* 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.
|
|
314
|
+
*
|
|
315
|
+
* It gives the mod the opportunity to rectify potential differences in local state introduced by the save/load cycle. Doing anything other than the following three will lead to desyncs, breaking multiplayer and replay functionality. Access to {@link LuaGameScript | 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.
|
|
307
316
|
*
|
|
308
|
-
* The only legitimate uses of this event are
|
|
317
|
+
* The only legitimate uses of this event are these:
|
|
309
318
|
* - Re-setup {@link metatables | https://www.lua.org/pil/13.html} as they are not persisted through the save/load cycle.
|
|
310
319
|
* - Re-setup conditional event handlers, meaning subscribing to an event only when some condition is met to save processing time.
|
|
311
320
|
* - Create local references to data stored in the {@link global | global} table.
|
|
@@ -401,13 +410,15 @@ interface LuaBootstrap {
|
|
|
401
410
|
/**
|
|
402
411
|
* @param table.entity - The entity transferred from or to.
|
|
403
412
|
* @param table.from_player - Whether the transfer was from player to entity. If `false`, the transfer was from entity to player.
|
|
413
|
+
* @param table.is_split - Whether the transfer was a split action (half stack).
|
|
404
414
|
* @param table.player_index - The player transferred from or to.
|
|
405
415
|
*/
|
|
406
416
|
raise_player_fast_transferred(this: void,
|
|
407
417
|
table: {
|
|
408
418
|
player_index: number,
|
|
409
419
|
entity: LuaEntity,
|
|
410
|
-
from_player: boolean
|
|
420
|
+
from_player: boolean,
|
|
421
|
+
is_split: boolean
|
|
411
422
|
}): void
|
|
412
423
|
|
|
413
424
|
/**
|
|
@@ -446,6 +457,18 @@ interface LuaBootstrap {
|
|
|
446
457
|
tiles: Tile[]
|
|
447
458
|
}): void
|
|
448
459
|
|
|
460
|
+
/**
|
|
461
|
+
* @param table.entity - The entity that was teleported.
|
|
462
|
+
* @param table.old_position - The entity's position before the teleportation.
|
|
463
|
+
* @param table.old_surface_index - The entity's surface before the teleportation.
|
|
464
|
+
*/
|
|
465
|
+
raise_script_teleported(this: void,
|
|
466
|
+
table: {
|
|
467
|
+
entity: LuaEntity,
|
|
468
|
+
old_surface_index: number,
|
|
469
|
+
old_position: MapPosition
|
|
470
|
+
}): void
|
|
471
|
+
|
|
449
472
|
/**
|
|
450
473
|
* Register a metatable to have linkage recorded and restored when saving/loading. The metatable itself will not be saved. Instead, only the linkage to a registered metatable is saved, and the metatable registered under that name will be used when loading the table.
|
|
451
474
|
* @remarks
|
|
@@ -792,7 +815,7 @@ interface LuaCombinatorControlBehavior extends LuaControlBehavior {
|
|
|
792
815
|
}
|
|
793
816
|
|
|
794
817
|
/**
|
|
795
|
-
* Allows for the registration of custom console commands
|
|
818
|
+
* Allows for the registration of custom console commands through the global object named `commands`. Similarly to {@link event subscriptions | LuaBootstrap::on_event}, these don't persist through a save-and-load cycle.
|
|
796
819
|
*/
|
|
797
820
|
interface LuaCommandProcessor {
|
|
798
821
|
/**
|
|
@@ -1034,6 +1057,11 @@ interface LuaControl {
|
|
|
1034
1057
|
*/
|
|
1035
1058
|
get_main_inventory(this: void): void
|
|
1036
1059
|
|
|
1060
|
+
/**
|
|
1061
|
+
* The maximum inventory index this entity may use.
|
|
1062
|
+
*/
|
|
1063
|
+
get_max_inventory_index(this: void): void
|
|
1064
|
+
|
|
1037
1065
|
/**
|
|
1038
1066
|
* Gets the parameters of a personal logistic request and auto-trash slot.
|
|
1039
1067
|
* @param slot_index - The slot to get.
|
|
@@ -1144,13 +1172,16 @@ interface LuaControl {
|
|
|
1144
1172
|
* @remarks
|
|
1145
1173
|
* Some entities may not be teleported. For instance, transport belts won't allow teleportation and this method will always return `false` when used on any such entity.
|
|
1146
1174
|
* You can also pass 1 or 2 numbers as the parameters and they will be used as relative teleport coordinates `'teleport(0, 1)'` to move the entity 1 tile positive y. `'teleport(4)'` to move the entity 4 tiles to the positive x.
|
|
1175
|
+
* `script_raised_teleported` will not be raised if teleporting a player with no character.
|
|
1147
1176
|
*
|
|
1148
1177
|
* @param position - Where to teleport to.
|
|
1178
|
+
* @param raise_teleported - If true, [defines.events.script_raised_teleported](defines.events.script_raised_teleported) will be fired on successful entity teleportation.
|
|
1149
1179
|
* @param surface - Surface to teleport to. If not given, will teleport to the entity's current surface. Only players, cars, and spidertrons can be teleported cross-surface.
|
|
1150
1180
|
*/
|
|
1151
1181
|
teleport(this: void,
|
|
1152
1182
|
position: MapPosition,
|
|
1153
|
-
surface?: SurfaceIdentification
|
|
1183
|
+
surface?: SurfaceIdentification,
|
|
1184
|
+
raise_teleported?: boolean): void
|
|
1154
1185
|
|
|
1155
1186
|
/**
|
|
1156
1187
|
* Select an entity, as if by hovering the mouse above it.
|
|
@@ -1340,6 +1371,11 @@ interface LuaControl {
|
|
|
1340
1371
|
*/
|
|
1341
1372
|
force: ForceIdentification
|
|
1342
1373
|
|
|
1374
|
+
/**
|
|
1375
|
+
* Unique {@link index | LuaForce::index} associated with the force of this entity.
|
|
1376
|
+
*/
|
|
1377
|
+
readonly force_index: number
|
|
1378
|
+
|
|
1343
1379
|
/**
|
|
1344
1380
|
* Whether this character entity is in combat.
|
|
1345
1381
|
*/
|
|
@@ -1453,6 +1489,11 @@ interface LuaControl {
|
|
|
1453
1489
|
*/
|
|
1454
1490
|
readonly surface: LuaSurface
|
|
1455
1491
|
|
|
1492
|
+
/**
|
|
1493
|
+
* Unique {@link index | LuaSurface::index} associated with the surface this entity is currently on.
|
|
1494
|
+
*/
|
|
1495
|
+
readonly surface_index: number
|
|
1496
|
+
|
|
1456
1497
|
/**
|
|
1457
1498
|
* The vehicle the player is currently sitting in.
|
|
1458
1499
|
*/
|
|
@@ -2112,6 +2153,19 @@ interface LuaEntity extends LuaControl {
|
|
|
2112
2153
|
disconnect_rolling_stock(this: void,
|
|
2113
2154
|
direction: defines.rail_direction): void
|
|
2114
2155
|
|
|
2156
|
+
/**
|
|
2157
|
+
* Returns a table with all entities affected by this beacon
|
|
2158
|
+
* @remarks
|
|
2159
|
+
* Applies to subclasses: Beacon
|
|
2160
|
+
*
|
|
2161
|
+
*/
|
|
2162
|
+
get_beacon_effect_receivers(this: void): void
|
|
2163
|
+
|
|
2164
|
+
/**
|
|
2165
|
+
* Returns a table with all beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
|
2166
|
+
*/
|
|
2167
|
+
get_beacons(this: void): void
|
|
2168
|
+
|
|
2115
2169
|
/**
|
|
2116
2170
|
* Get the source of this beam.
|
|
2117
2171
|
* @remarks
|
|
@@ -3003,6 +3057,11 @@ interface LuaEntity extends LuaControl {
|
|
|
3003
3057
|
*/
|
|
3004
3058
|
backer_name?: string
|
|
3005
3059
|
|
|
3060
|
+
/**
|
|
3061
|
+
* Number of beacons affecting this effect receiver. Can only be used when the entity has an effect receiver (AssemblingMachine, Furnace, Lab, MiningDrills)
|
|
3062
|
+
*/
|
|
3063
|
+
readonly beacons_count?: number
|
|
3064
|
+
|
|
3006
3065
|
/**
|
|
3007
3066
|
* The belt connectable neighbours of this belt connectable entity. Only entities that input to or are outputs of this entity. Does not contain the other end of an underground belt, see {@link LuaEntity::neighbours | LuaEntity::neighbours} for that. This is a dictionary with `"inputs"`, `"outputs"` entries that are arrays of transport belt connectable entities, or empty tables if no entities.
|
|
3008
3067
|
* @remarks
|
|
@@ -3323,7 +3382,7 @@ interface LuaEntity extends LuaControl {
|
|
|
3323
3382
|
readonly energy_generated_last_tick: number
|
|
3324
3383
|
|
|
3325
3384
|
/**
|
|
3326
|
-
* The label on this entity, if any. `nil` if this is not a spider-
|
|
3385
|
+
* The label on this entity, if any. `nil` if this is not a spider-vehicle.
|
|
3327
3386
|
*/
|
|
3328
3387
|
entity_label?: string
|
|
3329
3388
|
|
|
@@ -3497,6 +3556,14 @@ interface LuaEntity extends LuaControl {
|
|
|
3497
3556
|
*/
|
|
3498
3557
|
inserter_stack_size_override: number
|
|
3499
3558
|
|
|
3559
|
+
/**
|
|
3560
|
+
* Returns the current target pickup count of the inserter.
|
|
3561
|
+
* @remarks
|
|
3562
|
+
* This considers the circuit network, manual override and the inserter stack size limit based on technology.
|
|
3563
|
+
*
|
|
3564
|
+
*/
|
|
3565
|
+
readonly inserter_target_pickup_count: number
|
|
3566
|
+
|
|
3500
3567
|
/**
|
|
3501
3568
|
* (deprecated by 1.1.51) If this entity is a MilitaryTarget. Returns same value as LuaEntity::is_military_target
|
|
3502
3569
|
*/
|
|
@@ -4119,7 +4186,9 @@ interface LuaEntity extends LuaControl {
|
|
|
4119
4186
|
readonly unit_group?: LuaUnitGroup
|
|
4120
4187
|
|
|
4121
4188
|
/**
|
|
4122
|
-
* A
|
|
4189
|
+
* A unique number identifying this entity for the lifetime of the save. These are allocated sequentially, and not re-used (until overflow).
|
|
4190
|
+
*
|
|
4191
|
+
* Only entities inheriting from {@link EntityWithOwner | https://wiki.factorio.com/Prototype/EntityWithOwner}, as well as {@link ItemRequestProxy | https://wiki.factorio.com/Prototype/ItemRequestProxy} and {@link EntityGhost | https://wiki.factorio.com/Prototype/EntityGhost} are assigned a unit number. Returns `nil` otherwise.
|
|
4123
4192
|
*/
|
|
4124
4193
|
readonly unit_number?: number
|
|
4125
4194
|
|
|
@@ -4218,6 +4287,11 @@ interface LuaEntityPrototype {
|
|
|
4218
4287
|
*/
|
|
4219
4288
|
readonly air_resistance?: number
|
|
4220
4289
|
|
|
4290
|
+
/**
|
|
4291
|
+
* The alert icon scale of this entity prototype.
|
|
4292
|
+
*/
|
|
4293
|
+
readonly alert_icon_scale: number
|
|
4294
|
+
|
|
4221
4295
|
/**
|
|
4222
4296
|
* The alert icon shift of this entity prototype.
|
|
4223
4297
|
*/
|
|
@@ -4803,7 +4877,7 @@ interface LuaEntityPrototype {
|
|
|
4803
4877
|
/**
|
|
4804
4878
|
* The fluid capacity of this entity or 0 if this entity doesn't support fluids.
|
|
4805
4879
|
* @remarks
|
|
4806
|
-
* Crafting machines will report 0 due to their fluid capacity being
|
|
4880
|
+
* Crafting machines will report 0 due to their fluid capacity being whatever a given recipe needs.
|
|
4807
4881
|
*
|
|
4808
4882
|
*/
|
|
4809
4883
|
readonly fluid_capacity: number
|
|
@@ -4910,7 +4984,7 @@ interface LuaEntityPrototype {
|
|
|
4910
4984
|
readonly idle_energy_usage?: number
|
|
4911
4985
|
|
|
4912
4986
|
/**
|
|
4913
|
-
* A vector of the gun prototypes of this car, spider
|
|
4987
|
+
* A vector of the gun prototypes of this car, spider vehicle, artillery wagon, or turret.
|
|
4914
4988
|
* @remarks
|
|
4915
4989
|
* Applies to subclasses: Car,SpiderVehicle,ArtilleryTurret,ArtilleryWagon
|
|
4916
4990
|
*
|
|
@@ -5274,7 +5348,7 @@ interface LuaEntityPrototype {
|
|
|
5274
5348
|
/**
|
|
5275
5349
|
* The default maximum power output of this generator prototype.
|
|
5276
5350
|
* @remarks
|
|
5277
|
-
* Applies to subclasses: Generator
|
|
5351
|
+
* Applies to subclasses: BurnerGenerator,Generator
|
|
5278
5352
|
*
|
|
5279
5353
|
*/
|
|
5280
5354
|
readonly max_power_output?: number
|
|
@@ -6564,7 +6638,7 @@ interface LuaFluidBox {
|
|
|
6564
6638
|
index: number): void
|
|
6565
6639
|
|
|
6566
6640
|
/**
|
|
6567
|
-
* The prototype of this fluidbox index.
|
|
6641
|
+
* The prototype of this fluidbox index. If this is used on a fluidbox of a crafting machine which due to recipe was created by merging multiple prototypes, a table of prototypes that were merged will be returned instead
|
|
6568
6642
|
*/
|
|
6569
6643
|
get_prototype(this: void,
|
|
6570
6644
|
index: number): void
|
|
@@ -7354,7 +7428,7 @@ interface LuaForce {
|
|
|
7354
7428
|
ghost_time_to_live: number
|
|
7355
7429
|
|
|
7356
7430
|
/**
|
|
7357
|
-
*
|
|
7431
|
+
* This force's unique ID, and index in {@link LuaGameScript::forces | LuaGameScript::forces}. It is assigned when a force is created, and remains so until it is {@link merged | on_force_merged} (ie. deleted). Indexes of merged forces can be reused.
|
|
7358
7432
|
*/
|
|
7359
7433
|
readonly index: number
|
|
7360
7434
|
|
|
@@ -8260,6 +8334,11 @@ interface LuaGameScript {
|
|
|
8260
8334
|
*/
|
|
8261
8335
|
readonly connected_players: LuaPlayer[]
|
|
8262
8336
|
|
|
8337
|
+
/**
|
|
8338
|
+
* Whether a console command has been used.
|
|
8339
|
+
*/
|
|
8340
|
+
readonly console_command_used: boolean
|
|
8341
|
+
|
|
8263
8342
|
/**
|
|
8264
8343
|
* A dictionary containing every LuaCustomInputPrototype indexed by `name`.
|
|
8265
8344
|
*/
|
|
@@ -11079,6 +11158,15 @@ interface LuaItemStack {
|
|
|
11079
11158
|
transfer_stack(this: void,
|
|
11080
11159
|
stack: ItemStackIdentification): void
|
|
11081
11160
|
|
|
11161
|
+
/**
|
|
11162
|
+
* Use the capsule item with the entity as the source, targeting the given position.
|
|
11163
|
+
* @param entity - The entity to use the capsule item with.
|
|
11164
|
+
* @param target_position - The position to use the capsule item with.
|
|
11165
|
+
*/
|
|
11166
|
+
use_capsule(this: void,
|
|
11167
|
+
entity: LuaEntity,
|
|
11168
|
+
target_position: MapPosition): void
|
|
11169
|
+
|
|
11082
11170
|
/**
|
|
11083
11171
|
* The active blueprint index for this blueprint book. `nil` if this blueprint book is empty.
|
|
11084
11172
|
* @remarks
|
|
@@ -11177,6 +11265,14 @@ interface LuaItemStack {
|
|
|
11177
11265
|
*/
|
|
11178
11266
|
durability?: number
|
|
11179
11267
|
|
|
11268
|
+
/**
|
|
11269
|
+
* If this is an item with entity data, get the stored entity color.
|
|
11270
|
+
* @remarks
|
|
11271
|
+
* Applies to subclasses: ItemWithEntityData
|
|
11272
|
+
*
|
|
11273
|
+
*/
|
|
11274
|
+
entity_color?: Color
|
|
11275
|
+
|
|
11180
11276
|
/**
|
|
11181
11277
|
* The number of entity filters this deconstruction item supports.
|
|
11182
11278
|
* @remarks
|
|
@@ -11198,6 +11294,14 @@ interface LuaItemStack {
|
|
|
11198
11294
|
*/
|
|
11199
11295
|
entity_filters: string[]
|
|
11200
11296
|
|
|
11297
|
+
/**
|
|
11298
|
+
* If this is an item with entity data, get the stored entity label.
|
|
11299
|
+
* @remarks
|
|
11300
|
+
* Applies to subclasses: ItemWithEntityData
|
|
11301
|
+
*
|
|
11302
|
+
*/
|
|
11303
|
+
entity_label?: string
|
|
11304
|
+
|
|
11201
11305
|
/**
|
|
11202
11306
|
* If this item extends the inventory it resides in (provides its contents for counts, crafting, insertion). Only callable on items with inventories.
|
|
11203
11307
|
* @remarks
|
|
@@ -12336,11 +12440,7 @@ interface LuaPlayer extends LuaControl {
|
|
|
12336
12440
|
character: LuaEntity): void
|
|
12337
12441
|
|
|
12338
12442
|
/**
|
|
12339
|
-
* Builds
|
|
12340
|
-
* @remarks
|
|
12341
|
-
* Anything built will fire normal player-built events.
|
|
12342
|
-
* The cursor stack will automatically be reduced as if the player built normally.
|
|
12343
|
-
*
|
|
12443
|
+
* Builds whatever is in the cursor on the surface the player is on. The cursor stack will automatically be reduced as if the player built normally.
|
|
12344
12444
|
* @param table.alt - If alt build should be used instead of normal build. Defaults to normal.
|
|
12345
12445
|
* @param table.direction - Direction the entity would be placed
|
|
12346
12446
|
* @param table.position - Where the entity would be placed
|
|
@@ -12618,11 +12718,13 @@ interface LuaPlayer extends LuaControl {
|
|
|
12618
12718
|
alert_type: defines.alert_type): void
|
|
12619
12719
|
|
|
12620
12720
|
/**
|
|
12621
|
-
* Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position
|
|
12721
|
+
* Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position, scale, and entity to follow. Render mode change requests are processed before rendering of the next frame.
|
|
12722
|
+
* @param entity - The entity to follow. If not given the current entity being followed will be cleared.
|
|
12622
12723
|
*/
|
|
12623
12724
|
open_map(this: void,
|
|
12624
12725
|
position: MapPosition,
|
|
12625
|
-
scale?: number
|
|
12726
|
+
scale?: number,
|
|
12727
|
+
entity?: LuaEntity): void
|
|
12626
12728
|
|
|
12627
12729
|
/**
|
|
12628
12730
|
* Invokes the "smart pipette" action on the player as if the user pressed it.
|
|
@@ -12687,18 +12789,18 @@ interface LuaPlayer extends LuaControl {
|
|
|
12687
12789
|
}): void
|
|
12688
12790
|
|
|
12689
12791
|
/**
|
|
12690
|
-
* Requests a translation for the given localised string. If the request is successful the {@link on_string_translated | on_string_translated} event will be fired
|
|
12792
|
+
* Requests a translation for the given localised string. If the request is successful, the {@link on_string_translated | on_string_translated} event will be fired with the results.
|
|
12691
12793
|
* @remarks
|
|
12692
|
-
* Does nothing if this player is not connected
|
|
12794
|
+
* Does nothing if this player is not connected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
|
|
12693
12795
|
*
|
|
12694
12796
|
*/
|
|
12695
12797
|
request_translation(this: void,
|
|
12696
12798
|
localised_string: LocalisedString): void
|
|
12697
12799
|
|
|
12698
12800
|
/**
|
|
12699
|
-
* Requests
|
|
12801
|
+
* Requests translation for the given set of localised strings. If the request is successful, a {@link on_string_translated | on_string_translated} event will be fired for each string with the results.
|
|
12700
12802
|
* @remarks
|
|
12701
|
-
* Does nothing if this player is not connected
|
|
12803
|
+
* Does nothing if this player is not connected (see {@link LuaPlayer::connected | LuaPlayer::connected}).
|
|
12702
12804
|
*
|
|
12703
12805
|
*/
|
|
12704
12806
|
request_translations(this: void,
|
|
@@ -12825,11 +12927,13 @@ interface LuaPlayer extends LuaControl {
|
|
|
12825
12927
|
position: MapPosition): void
|
|
12826
12928
|
|
|
12827
12929
|
/**
|
|
12828
|
-
* Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position
|
|
12930
|
+
* Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position, scale, and entity to follow. Render mode change requests are processed before rendering of the next frame.
|
|
12931
|
+
* @param entity - The entity to follow. If not given the current entity being followed will be cleared.
|
|
12829
12932
|
*/
|
|
12830
12933
|
zoom_to_world(this: void,
|
|
12831
12934
|
position: MapPosition,
|
|
12832
|
-
scale?: number
|
|
12935
|
+
scale?: number,
|
|
12936
|
+
entity?: LuaEntity): void
|
|
12833
12937
|
|
|
12834
12938
|
/**
|
|
12835
12939
|
* `true` if the player is an admin.
|
|
@@ -12902,6 +13006,11 @@ interface LuaPlayer extends LuaControl {
|
|
|
12902
13006
|
*/
|
|
12903
13007
|
readonly display_scale: number
|
|
12904
13008
|
|
|
13009
|
+
/**
|
|
13010
|
+
* The wire drag target for this player, if any.
|
|
13011
|
+
*/
|
|
13012
|
+
readonly drag_target?: DragTarget
|
|
13013
|
+
|
|
12905
13014
|
/**
|
|
12906
13015
|
* The source entity used during entity settings copy-paste, if any.
|
|
12907
13016
|
*/
|
|
@@ -12920,7 +13029,7 @@ interface LuaPlayer extends LuaControl {
|
|
|
12920
13029
|
hand_location?: ItemStackLocation
|
|
12921
13030
|
|
|
12922
13031
|
/**
|
|
12923
|
-
* This player's unique index in {@link LuaGameScript::players | LuaGameScript::players}. It is
|
|
13032
|
+
* This player's unique ID, and index in {@link LuaGameScript::players | LuaGameScript::players}. It is assigned when a player is created, and remains so (even when the player is not {@link connected | LuaPlayer::connected}) until the player is irreversably {@link removed | on_player_removed}. Indexes of removed players can be reused.
|
|
12924
13033
|
*/
|
|
12925
13034
|
readonly index: number
|
|
12926
13035
|
|
|
@@ -13117,7 +13226,7 @@ interface LuaProgrammableSpeakerControlBehavior extends LuaControlBehavior {
|
|
|
13117
13226
|
}
|
|
13118
13227
|
|
|
13119
13228
|
/**
|
|
13120
|
-
* An interface to send messages to the calling RCON interface
|
|
13229
|
+
* An interface to send messages to the calling RCON interface through the global object named `rcon`.
|
|
13121
13230
|
*/
|
|
13122
13231
|
interface LuaRCON {
|
|
13123
13232
|
/**
|
|
@@ -13176,6 +13285,11 @@ interface LuaRailPath {
|
|
|
13176
13285
|
*/
|
|
13177
13286
|
readonly current: number
|
|
13178
13287
|
|
|
13288
|
+
/**
|
|
13289
|
+
* If the path goes from the front of the train
|
|
13290
|
+
*/
|
|
13291
|
+
readonly is_front: boolean
|
|
13292
|
+
|
|
13179
13293
|
/**
|
|
13180
13294
|
* 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.
|
|
13181
13295
|
*/
|
|
@@ -13651,7 +13765,7 @@ interface LuaRemote {
|
|
|
13651
13765
|
}
|
|
13652
13766
|
|
|
13653
13767
|
/**
|
|
13654
|
-
* Allows rendering of geometric shapes, text and sprites in the game world
|
|
13768
|
+
* Allows rendering of geometric shapes, text and sprites in the game world through the global object named `rendering`. Each render object is identified by an id that is universally unique for the lifetime of a whole game.
|
|
13655
13769
|
* @remarks
|
|
13656
13770
|
* If an entity target of an object is destroyed or changes surface, then the object is also destroyed.
|
|
13657
13771
|
*
|
|
@@ -13981,7 +14095,7 @@ interface LuaRendering {
|
|
|
13981
14095
|
* Not all fonts support scaling.
|
|
13982
14096
|
*
|
|
13983
14097
|
* @param table.alignment - Defaults to "left". Other options are "right" and "center".
|
|
13984
|
-
* @param table.draw_on_ground - If this should be drawn below sprites and entities.
|
|
14098
|
+
* @param table.draw_on_ground - If this should be drawn below sprites and entities. Rich text does not support this option.
|
|
13985
14099
|
* @param table.font - Name of font to use. Defaults to the same font as flying-text.
|
|
13986
14100
|
* @param table.forces - The forces that this object is rendered to. Passing `nil` or an empty table will render it to all forces.
|
|
13987
14101
|
* @param table.only_in_alt_mode - If this should only be rendered in alt mode. Defaults to false.
|
|
@@ -13991,6 +14105,7 @@ interface LuaRendering {
|
|
|
13991
14105
|
* @param table.target_offset - Only used if `target` is a LuaEntity.
|
|
13992
14106
|
* @param table.text - The text to display.
|
|
13993
14107
|
* @param table.time_to_live - In ticks. Defaults to living forever.
|
|
14108
|
+
* @param table.use_rich_text - If rich text rendering is enabled. Defaults to false.
|
|
13994
14109
|
* @param table.vertical_alignment - Defaults to "top". Other options are "middle", "baseline" and "bottom".
|
|
13995
14110
|
* @param table.visible - If this is rendered to anyone at all. Defaults to true.
|
|
13996
14111
|
*/
|
|
@@ -14012,7 +14127,8 @@ interface LuaRendering {
|
|
|
14012
14127
|
alignment?: string,
|
|
14013
14128
|
vertical_alignment?: string,
|
|
14014
14129
|
scale_with_zoom?: boolean,
|
|
14015
|
-
only_in_alt_mode?: boolean
|
|
14130
|
+
only_in_alt_mode?: boolean,
|
|
14131
|
+
use_rich_text?: boolean
|
|
14016
14132
|
}): void
|
|
14017
14133
|
|
|
14018
14134
|
/**
|
|
@@ -14340,6 +14456,15 @@ interface LuaRendering {
|
|
|
14340
14456
|
get_type(this: void,
|
|
14341
14457
|
id: number): void
|
|
14342
14458
|
|
|
14459
|
+
/**
|
|
14460
|
+
* Get if the text with this id parses rich text tags.
|
|
14461
|
+
* @remarks
|
|
14462
|
+
* Applies to subclasses: Text
|
|
14463
|
+
*
|
|
14464
|
+
*/
|
|
14465
|
+
get_use_rich_text(this: void,
|
|
14466
|
+
id: number): void
|
|
14467
|
+
|
|
14343
14468
|
/**
|
|
14344
14469
|
* Get the vertical alignment of the text with this id.
|
|
14345
14470
|
* @remarks
|
|
@@ -14781,6 +14906,16 @@ interface LuaRendering {
|
|
|
14781
14906
|
to: MapPosition | LuaEntity,
|
|
14782
14907
|
to_offset?: Vector): void
|
|
14783
14908
|
|
|
14909
|
+
/**
|
|
14910
|
+
* Set if the text with this id parses rich text tags.
|
|
14911
|
+
* @remarks
|
|
14912
|
+
* Applies to subclasses: Text
|
|
14913
|
+
*
|
|
14914
|
+
*/
|
|
14915
|
+
set_use_rich_text(this: void,
|
|
14916
|
+
id: number,
|
|
14917
|
+
use_rich_text: boolean): void
|
|
14918
|
+
|
|
14784
14919
|
/**
|
|
14785
14920
|
* Set the vertical alignment of the text with this id. Does nothing if this object is not a text.
|
|
14786
14921
|
* @remarks
|
|
@@ -15000,7 +15135,7 @@ interface LuaShortcutPrototype {
|
|
|
15000
15135
|
readonly order: string
|
|
15001
15136
|
|
|
15002
15137
|
/**
|
|
15003
|
-
* The technology to
|
|
15138
|
+
* The technology that needs to be researched once (in any save) for this shortcut to be unlocked (in all saves).
|
|
15004
15139
|
*/
|
|
15005
15140
|
readonly technology_to_unlock?: LuaTechnologyPrototype
|
|
15006
15141
|
|
|
@@ -15809,6 +15944,7 @@ interface LuaSurface {
|
|
|
15809
15944
|
}): void
|
|
15810
15945
|
|
|
15811
15946
|
/**
|
|
15947
|
+
* Whether the given decorative prototype collides at the given position and direction.
|
|
15812
15948
|
* @param position - The position to check
|
|
15813
15949
|
* @param prototype - The decorative prototype to check
|
|
15814
15950
|
*/
|
|
@@ -15857,6 +15993,7 @@ interface LuaSurface {
|
|
|
15857
15993
|
area: ScriptPosition): void
|
|
15858
15994
|
|
|
15859
15995
|
/**
|
|
15996
|
+
* Whether the given entity prototype collides at the given position and direction.
|
|
15860
15997
|
* @param position - The position to check
|
|
15861
15998
|
* @param prototype - The entity prototype to check
|
|
15862
15999
|
* @param use_map_generation_bounding_box - If the map generation bounding box should be used instead of the collision bounding box
|
|
@@ -15965,6 +16102,7 @@ interface LuaSurface {
|
|
|
15965
16102
|
to_be_upgraded?: boolean,
|
|
15966
16103
|
limit?: number,
|
|
15967
16104
|
is_military_target?: boolean,
|
|
16105
|
+
has_item_inside?: LuaItemPrototype,
|
|
15968
16106
|
invert?: boolean
|
|
15969
16107
|
}): void
|
|
15970
16108
|
|
|
@@ -16507,7 +16645,7 @@ interface LuaSurface {
|
|
|
16507
16645
|
generate_with_lab_tiles: boolean
|
|
16508
16646
|
|
|
16509
16647
|
/**
|
|
16510
|
-
*
|
|
16648
|
+
* This surface's unique ID, and index in {@link LuaGameScript::surfaces | LuaGameScript::surfaces}. It is assigned when a surface is created, and remains so until it is {@link deleted | on_surface_deleted}. Indexes of deleted surfaces can be reused.
|
|
16511
16649
|
*/
|
|
16512
16650
|
readonly index: number
|
|
16513
16651
|
|
|
@@ -16517,7 +16655,7 @@ interface LuaSurface {
|
|
|
16517
16655
|
map_gen_settings: MapGenSettings
|
|
16518
16656
|
|
|
16519
16657
|
/**
|
|
16520
|
-
* The minimal brightness during the night.
|
|
16658
|
+
* The minimal brightness during the night. Defaults to `0.15`. This has an effect on both rendering and game mechanics such as biter spawns and solar power.
|
|
16521
16659
|
*/
|
|
16522
16660
|
min_brightness: number
|
|
16523
16661
|
|
|
@@ -18389,6 +18527,11 @@ interface LuaGuiElementAddParamsTextfield extends LuaGuiElementAddParams {
|
|
|
18389
18527
|
*
|
|
18390
18528
|
*/
|
|
18391
18529
|
interface LuaSurfaceCreateEntityParams {
|
|
18530
|
+
/**
|
|
18531
|
+
* If fast_replace is true simulate fast replace using this character.
|
|
18532
|
+
*/
|
|
18533
|
+
'character'?: LuaEntity
|
|
18534
|
+
|
|
18392
18535
|
/**
|
|
18393
18536
|
* If false, the building effect smoke will not be shown around the new entity.
|
|
18394
18537
|
*/
|
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.78
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -762,6 +762,20 @@ interface DisplayResolution {
|
|
|
762
762
|
width: number
|
|
763
763
|
}
|
|
764
764
|
|
|
765
|
+
interface DragTarget {
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* If the wire being dragged is a circuit wire this is the connector id.
|
|
769
|
+
*/
|
|
770
|
+
target_circuit_id?: defines.circuit_connector_id,
|
|
771
|
+
target_entity: LuaEntity,
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* If the wire being dragged is copper wire this is the wire id.
|
|
775
|
+
*/
|
|
776
|
+
target_wire_id?: defines.wire_connection_id
|
|
777
|
+
}
|
|
778
|
+
|
|
765
779
|
/**
|
|
766
780
|
* These values represent a percentual increase in evolution. This means a value of `0.1` would increase evolution by 10%.
|
|
767
781
|
*/
|
|
@@ -1059,9 +1073,9 @@ type FluidPrototypeFilter = FluidPrototypeFilterDefaultTemperature | FluidProtot
|
|
|
1059
1073
|
type ForceCondition = /* All forces pass. */ 'all' | /* Forces which will attack pass. */ 'enemy' | /* Forces which won't attack pass. */ 'ally' | /* Forces which are friends pass. */ 'friend' | /* Forces which are not friends pass. */ 'not-friend' | /* The same force pass. */ 'same' | /* The non-same forces pass. */ 'not-same'
|
|
1060
1074
|
|
|
1061
1075
|
/**
|
|
1062
|
-
* A force may be specified in one of
|
|
1076
|
+
* A force may be specified in one of three ways.
|
|
1063
1077
|
*/
|
|
1064
|
-
type ForceIdentification = /* The force name. */ string | /* A reference to {@link LuaForce | LuaForce} may be passed directly. */ LuaForce
|
|
1078
|
+
type ForceIdentification = /* The force index. */ number | /* The force name. */ string | /* A reference to {@link LuaForce | LuaForce} may be passed directly. */ LuaForce
|
|
1065
1079
|
|
|
1066
1080
|
/**
|
|
1067
1081
|
* Parameters that affect the look and control of the game. Updating any of the member attributes here will immediately take effect in the game engine.
|
|
@@ -1563,6 +1577,14 @@ type LuaScriptRaisedDestroyEventFilter = LuaScriptRaisedDestroyEventFilterGhostN
|
|
|
1563
1577
|
*/
|
|
1564
1578
|
type LuaScriptRaisedReviveEventFilter = LuaScriptRaisedReviveEventFilterGhostName | LuaScriptRaisedReviveEventFilterGhostType | LuaScriptRaisedReviveEventFilterName | LuaScriptRaisedReviveEventFilterType | DefaultLuaScriptRaisedReviveEventFilter
|
|
1565
1579
|
|
|
1580
|
+
/**
|
|
1581
|
+
* Depending on the value of `filter`, the table may take additional fields. `filter` may be one of the following:
|
|
1582
|
+
* @remarks
|
|
1583
|
+
* Other attributes may be specified depending on `filter`:
|
|
1584
|
+
*
|
|
1585
|
+
*/
|
|
1586
|
+
type LuaScriptRaisedTeleportedEventFilter = LuaScriptRaisedTeleportedEventFilterGhostName | LuaScriptRaisedTeleportedEventFilterGhostType | LuaScriptRaisedTeleportedEventFilterName | LuaScriptRaisedTeleportedEventFilterType | DefaultLuaScriptRaisedTeleportedEventFilter
|
|
1587
|
+
|
|
1566
1588
|
/**
|
|
1567
1589
|
* Depending on the value of `filter`, the table may take additional fields. `filter` may be one of the following:
|
|
1568
1590
|
* @remarks
|
|
@@ -1816,7 +1838,7 @@ interface ModSetting {
|
|
|
1816
1838
|
/**
|
|
1817
1839
|
* The value of the mod setting. The type depends on the kind of setting.
|
|
1818
1840
|
*/
|
|
1819
|
-
value: number | boolean | string
|
|
1841
|
+
value: number | boolean | string | Color
|
|
1820
1842
|
}
|
|
1821
1843
|
|
|
1822
1844
|
/**
|
|
@@ -2259,6 +2281,19 @@ interface ProgrammableSpeakerParameters {
|
|
|
2259
2281
|
*/
|
|
2260
2282
|
type PrototypeFilter = Array</* for type `"item"` */ ItemPrototypeFilter | /* for type `"tile"` */ TilePrototypeFilter | /* for type `"entity"` */ EntityPrototypeFilter | /* for type `"fluid"` */ FluidPrototypeFilter | /* for type `"recipe"` */ RecipePrototypeFilter | /* for type `"decorative"` */ DecorativePrototypeFilter | /* for type `"achievement"` */ AchievementPrototypeFilter | /* for type `"equipment"` */ EquipmentPrototypeFilter | /* for type `"technology"` */ TechnologyPrototypeFilter>
|
|
2261
2283
|
|
|
2284
|
+
interface PrototypeHistory {
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* The mods that changed this prototype in the order they changed it.
|
|
2288
|
+
*/
|
|
2289
|
+
changed: string[],
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* The mod that created this prototype.
|
|
2293
|
+
*/
|
|
2294
|
+
created: string
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2262
2297
|
/**
|
|
2263
2298
|
* 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".
|
|
2264
2299
|
*
|
|
@@ -2545,6 +2580,8 @@ interface TabAndContent {
|
|
|
2545
2580
|
|
|
2546
2581
|
/**
|
|
2547
2582
|
* A dictionary of string to the four basic Lua types: `string`, `boolean`, `number`, `table`.
|
|
2583
|
+
*
|
|
2584
|
+
* Note that the API returns tags as a simple table, meaning any modifications to it will not propagate back to the game. Thus, to modify a set of tags, the whole table needs to be written back to the respective property.
|
|
2548
2585
|
* @example
|
|
2549
2586
|
* ```
|
|
2550
2587
|
* {a = 1, b = true, c = "three", d = {e = "f"}}
|
|
@@ -2572,7 +2609,7 @@ type TechnologyModifier = TechnologyModifierOtherTypes | TechnologyModifierAmmoD
|
|
|
2572
2609
|
* Other attributes may be specified depending on `filter`:
|
|
2573
2610
|
*
|
|
2574
2611
|
*/
|
|
2575
|
-
type TechnologyPrototypeFilter = TechnologyPrototypeFilterLevel | TechnologyPrototypeFilterMaxLevel | TechnologyPrototypeFilterResearchUnitIngredient | TechnologyPrototypeFilterTime | DefaultTechnologyPrototypeFilter
|
|
2612
|
+
type TechnologyPrototypeFilter = TechnologyPrototypeFilterLevel | TechnologyPrototypeFilterMaxLevel | TechnologyPrototypeFilterResearchUnitIngredient | TechnologyPrototypeFilterTime | TechnologyPrototypeFilterUnlocksRecipe | DefaultTechnologyPrototypeFilter
|
|
2576
2613
|
|
|
2577
2614
|
interface Tile {
|
|
2578
2615
|
|
|
@@ -2830,7 +2867,7 @@ interface WireConnectionDefinition {
|
|
|
2830
2867
|
/**
|
|
2831
2868
|
* Mandatory if the source entity has more than one wire connection using copper wire.
|
|
2832
2869
|
*/
|
|
2833
|
-
source_wire_id?: defines.
|
|
2870
|
+
source_wire_id?: defines.wire_connection_id,
|
|
2834
2871
|
|
|
2835
2872
|
/**
|
|
2836
2873
|
* Mandatory if the target entity has more than one circuit connection using circuit wire.
|
|
@@ -2845,7 +2882,7 @@ interface WireConnectionDefinition {
|
|
|
2845
2882
|
/**
|
|
2846
2883
|
* Mandatory if the target entity has more than one wire connection using copper wire.
|
|
2847
2884
|
*/
|
|
2848
|
-
target_wire_id?: defines.
|
|
2885
|
+
target_wire_id?: defines.wire_connection_id,
|
|
2849
2886
|
|
|
2850
2887
|
/**
|
|
2851
2888
|
* Wire color, either {@link defines.wire_type.red | defines.wire_type.red} or {@link defines.wire_type.green | defines.wire_type.green}.
|
|
@@ -5350,6 +5387,79 @@ interface DefaultLuaScriptRaisedReviveEventFilter extends BaseLuaScriptRaisedRev
|
|
|
5350
5387
|
filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable'
|
|
5351
5388
|
}
|
|
5352
5389
|
|
|
5390
|
+
interface BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5391
|
+
|
|
5392
|
+
/**
|
|
5393
|
+
* Inverts the condition. Default is `false`.
|
|
5394
|
+
*/
|
|
5395
|
+
invert?: boolean,
|
|
5396
|
+
|
|
5397
|
+
/**
|
|
5398
|
+
* How to combine this with the previous filter. Must be `"or"` or `"and"`. Defaults to `"or"`. When evaluating the filters, `"and"` has higher precedence than `"or"`.
|
|
5399
|
+
*/
|
|
5400
|
+
mode?: string
|
|
5401
|
+
}
|
|
5402
|
+
|
|
5403
|
+
interface LuaScriptRaisedTeleportedEventFilterGhostName extends BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5404
|
+
|
|
5405
|
+
/**
|
|
5406
|
+
* The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
|
|
5407
|
+
*/
|
|
5408
|
+
filter: 'ghost_name',
|
|
5409
|
+
|
|
5410
|
+
/**
|
|
5411
|
+
* The ghost prototype name
|
|
5412
|
+
*/
|
|
5413
|
+
name: string
|
|
5414
|
+
}
|
|
5415
|
+
|
|
5416
|
+
interface LuaScriptRaisedTeleportedEventFilterGhostType extends BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5417
|
+
|
|
5418
|
+
/**
|
|
5419
|
+
* The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
|
|
5420
|
+
*/
|
|
5421
|
+
filter: 'ghost_type',
|
|
5422
|
+
|
|
5423
|
+
/**
|
|
5424
|
+
* The ghost prototype type
|
|
5425
|
+
*/
|
|
5426
|
+
type: string
|
|
5427
|
+
}
|
|
5428
|
+
|
|
5429
|
+
interface LuaScriptRaisedTeleportedEventFilterName extends BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5430
|
+
|
|
5431
|
+
/**
|
|
5432
|
+
* The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
|
|
5433
|
+
*/
|
|
5434
|
+
filter: 'name',
|
|
5435
|
+
|
|
5436
|
+
/**
|
|
5437
|
+
* The prototype name
|
|
5438
|
+
*/
|
|
5439
|
+
name: string
|
|
5440
|
+
}
|
|
5441
|
+
|
|
5442
|
+
interface LuaScriptRaisedTeleportedEventFilterType extends BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5443
|
+
|
|
5444
|
+
/**
|
|
5445
|
+
* The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
|
|
5446
|
+
*/
|
|
5447
|
+
filter: 'type',
|
|
5448
|
+
|
|
5449
|
+
/**
|
|
5450
|
+
* The prototype type
|
|
5451
|
+
*/
|
|
5452
|
+
type: string
|
|
5453
|
+
}
|
|
5454
|
+
|
|
5455
|
+
interface DefaultLuaScriptRaisedTeleportedEventFilter extends BaseLuaScriptRaisedTeleportedEventFilter {
|
|
5456
|
+
|
|
5457
|
+
/**
|
|
5458
|
+
* The condition to filter on. One of `"ghost"`, `"rail"`, `"rail-signal"`, `"rolling-stock"`, `"robot-with-logistics-interface"`, `"vehicle"`, `"turret"`, `"crafting-machine"`, `"wall-connectable"`, `"transport-belt-connectable"`, `"circuit-network-connectable"`, `"type"`, `"name"`, `"ghost_type"`, `"ghost_name"`.
|
|
5459
|
+
*/
|
|
5460
|
+
filter: 'ghost' | 'rail' | 'rail-signal' | 'rolling-stock' | 'robot-with-logistics-interface' | 'vehicle' | 'turret' | 'crafting-machine' | 'wall-connectable' | 'transport-belt-connectable' | 'circuit-network-connectable'
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5353
5463
|
interface BaseLuaSectorScannedEventFilter {
|
|
5354
5464
|
|
|
5355
5465
|
/**
|
|
@@ -5896,7 +6006,7 @@ interface BaseTechnologyPrototypeFilter {
|
|
|
5896
6006
|
interface TechnologyPrototypeFilterLevel extends BaseTechnologyPrototypeFilter {
|
|
5897
6007
|
|
|
5898
6008
|
/**
|
|
5899
|
-
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
|
|
6009
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
5900
6010
|
*/
|
|
5901
6011
|
filter: 'level',
|
|
5902
6012
|
comparison: ComparatorString,
|
|
@@ -5910,7 +6020,7 @@ interface TechnologyPrototypeFilterLevel extends BaseTechnologyPrototypeFilter {
|
|
|
5910
6020
|
interface TechnologyPrototypeFilterMaxLevel extends BaseTechnologyPrototypeFilter {
|
|
5911
6021
|
|
|
5912
6022
|
/**
|
|
5913
|
-
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
|
|
6023
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
5914
6024
|
*/
|
|
5915
6025
|
filter: 'max-level',
|
|
5916
6026
|
comparison: ComparatorString,
|
|
@@ -5924,7 +6034,7 @@ interface TechnologyPrototypeFilterMaxLevel extends BaseTechnologyPrototypeFilte
|
|
|
5924
6034
|
interface TechnologyPrototypeFilterResearchUnitIngredient extends BaseTechnologyPrototypeFilter {
|
|
5925
6035
|
|
|
5926
6036
|
/**
|
|
5927
|
-
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
|
|
6037
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
5928
6038
|
*/
|
|
5929
6039
|
filter: 'research-unit-ingredient',
|
|
5930
6040
|
|
|
@@ -5937,7 +6047,7 @@ interface TechnologyPrototypeFilterResearchUnitIngredient extends BaseTechnology
|
|
|
5937
6047
|
interface TechnologyPrototypeFilterTime extends BaseTechnologyPrototypeFilter {
|
|
5938
6048
|
|
|
5939
6049
|
/**
|
|
5940
|
-
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
|
|
6050
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
5941
6051
|
*/
|
|
5942
6052
|
filter: 'time',
|
|
5943
6053
|
comparison: ComparatorString,
|
|
@@ -5948,10 +6058,23 @@ interface TechnologyPrototypeFilterTime extends BaseTechnologyPrototypeFilter {
|
|
|
5948
6058
|
value: number
|
|
5949
6059
|
}
|
|
5950
6060
|
|
|
6061
|
+
interface TechnologyPrototypeFilterUnlocksRecipe extends BaseTechnologyPrototypeFilter {
|
|
6062
|
+
|
|
6063
|
+
/**
|
|
6064
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
6065
|
+
*/
|
|
6066
|
+
filter: 'unlocks-recipe',
|
|
6067
|
+
|
|
6068
|
+
/**
|
|
6069
|
+
* The recipe to check.
|
|
6070
|
+
*/
|
|
6071
|
+
recipe: string
|
|
6072
|
+
}
|
|
6073
|
+
|
|
5951
6074
|
interface DefaultTechnologyPrototypeFilter extends BaseTechnologyPrototypeFilter {
|
|
5952
6075
|
|
|
5953
6076
|
/**
|
|
5954
|
-
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"level"`, `"max-level"`, `"time"`.
|
|
6077
|
+
* The condition to filter on. One of `"enabled"`, `"hidden"`, `"upgrade"`, `"visible-when-disabled"`, `"has-effects"`, `"has-prerequisites"`, `"research-unit-ingredient"`, `"unlocks-recipe"`, `"level"`, `"max-level"`, `"time"`.
|
|
5955
6078
|
*/
|
|
5956
6079
|
filter: 'enabled' | 'hidden' | 'upgrade' | 'visible-when-disabled' | 'has-effects' | 'has-prerequisites'
|
|
5957
6080
|
}
|
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.78
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
declare namespace defines {
|
|
@@ -673,6 +673,7 @@ declare namespace defines {
|
|
|
673
673
|
script_raised_destroy,
|
|
674
674
|
script_raised_revive,
|
|
675
675
|
script_raised_set_tiles,
|
|
676
|
+
script_raised_teleported,
|
|
676
677
|
}
|
|
677
678
|
enum flow_precision_index {
|
|
678
679
|
fifty_hours,
|
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.78
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1317,6 +1317,10 @@ interface on_player_fast_transferred extends event {
|
|
|
1317
1317
|
* Whether the transfer was from player to entity. If `false`, the transfer was from entity to player.
|
|
1318
1318
|
*/
|
|
1319
1319
|
from_player: boolean
|
|
1320
|
+
/**
|
|
1321
|
+
* Whether the transfer was a split action (half stack).
|
|
1322
|
+
*/
|
|
1323
|
+
is_split: boolean
|
|
1320
1324
|
/**
|
|
1321
1325
|
* The player transferred from or to.
|
|
1322
1326
|
*/
|
|
@@ -1483,11 +1487,11 @@ interface on_player_promoted extends event {
|
|
|
1483
1487
|
player_index: number
|
|
1484
1488
|
}
|
|
1485
1489
|
/**
|
|
1486
|
-
* Called when a player is removed (deleted) from the game.
|
|
1490
|
+
* Called when a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link leaving | on_player_left_game} the game, and instead behaves like the player never existed in the save file.
|
|
1487
1491
|
*/
|
|
1488
1492
|
interface on_player_removed extends event {
|
|
1489
1493
|
/**
|
|
1490
|
-
* The
|
|
1494
|
+
* The index of the removed player.
|
|
1491
1495
|
*/
|
|
1492
1496
|
player_index: number
|
|
1493
1497
|
}
|
|
@@ -1765,7 +1769,7 @@ interface on_post_entity_died extends event {
|
|
|
1765
1769
|
*/
|
|
1766
1770
|
interface on_pre_build extends event {
|
|
1767
1771
|
/**
|
|
1768
|
-
*
|
|
1772
|
+
* Whether the item was placed while moving.
|
|
1769
1773
|
*/
|
|
1770
1774
|
created_by_moving: boolean
|
|
1771
1775
|
/**
|
|
@@ -1773,11 +1777,11 @@ interface on_pre_build extends event {
|
|
|
1773
1777
|
*/
|
|
1774
1778
|
direction: defines.direction
|
|
1775
1779
|
/**
|
|
1776
|
-
*
|
|
1780
|
+
* Whether the blueprint was flipped horizontally. `nil` if not built by a blueprint.
|
|
1777
1781
|
*/
|
|
1778
1782
|
flip_horizontal: boolean
|
|
1779
1783
|
/**
|
|
1780
|
-
*
|
|
1784
|
+
* Whether the blueprint was flipped vertically. `nil` if not built by a blueprint.
|
|
1781
1785
|
*/
|
|
1782
1786
|
flip_vertical: boolean
|
|
1783
1787
|
/**
|
|
@@ -1906,11 +1910,11 @@ interface on_pre_player_mined_item extends event {
|
|
|
1906
1910
|
player_index: number
|
|
1907
1911
|
}
|
|
1908
1912
|
/**
|
|
1909
|
-
* Called before a player is removed (deleted) from the game.
|
|
1913
|
+
* Called before a player is removed (deleted) from the game. This is markedly different from a player temporarily {@link leaving | on_player_left_game} the game, and instead behaves like the player never existed in the save file.
|
|
1910
1914
|
*/
|
|
1911
1915
|
interface on_pre_player_removed extends event {
|
|
1912
1916
|
/**
|
|
1913
|
-
* The
|
|
1917
|
+
* The index of the removed player.
|
|
1914
1918
|
*/
|
|
1915
1919
|
player_index: number
|
|
1916
1920
|
}
|
|
@@ -2282,7 +2286,7 @@ interface on_spider_command_completed extends event {
|
|
|
2282
2286
|
vehicle: LuaEntity
|
|
2283
2287
|
}
|
|
2284
2288
|
/**
|
|
2285
|
-
* Called when a translation request generated through {@link LuaPlayer::request_translation | LuaPlayer::request_translation}
|
|
2289
|
+
* Called when a translation request generated through {@link LuaPlayer::request_translation | LuaPlayer::request_translation} or {@link LuaPlayer::request_translations | LuaPlayer::request_translations} has been completed.
|
|
2286
2290
|
*/
|
|
2287
2291
|
interface on_string_translated extends event {
|
|
2288
2292
|
/**
|
|
@@ -2328,7 +2332,7 @@ interface on_surface_deleted extends event {
|
|
|
2328
2332
|
surface_index: number
|
|
2329
2333
|
}
|
|
2330
2334
|
/**
|
|
2331
|
-
* Called after a surface is imported.
|
|
2335
|
+
* Called after a surface is imported via the map editor.
|
|
2332
2336
|
*/
|
|
2333
2337
|
interface on_surface_imported extends event {
|
|
2334
2338
|
/**
|
|
@@ -2477,3 +2481,20 @@ interface script_raised_set_tiles extends event {
|
|
|
2477
2481
|
*/
|
|
2478
2482
|
tiles: Tile[]
|
|
2479
2483
|
}
|
|
2484
|
+
/**
|
|
2485
|
+
* A static event mods can use to tell other mods they teleported something by script. This event is only raised if a mod does so with {@link LuaBootstrap::raise_event | LuaBootstrap::raise_event} or {@link LuaBootstrap::raise_script_teleported | LuaBootstrap::raise_script_teleported}, or when `raise_teleported` is passed to {@link LuaControl::teleport | LuaControl::teleport}. Can be filtered using {@link LuaScriptRaisedTeleportedEventFilter | LuaScriptRaisedTeleportedEventFilter}.
|
|
2486
|
+
*/
|
|
2487
|
+
interface script_raised_teleported extends event {
|
|
2488
|
+
/**
|
|
2489
|
+
* The entity that was teleported.
|
|
2490
|
+
*/
|
|
2491
|
+
entity: LuaEntity
|
|
2492
|
+
/**
|
|
2493
|
+
* The entity's position before the teleportation.
|
|
2494
|
+
*/
|
|
2495
|
+
old_position: MapPosition
|
|
2496
|
+
/**
|
|
2497
|
+
* The entity's surface before the teleportation.
|
|
2498
|
+
*/
|
|
2499
|
+
old_surface_index: number
|
|
2500
|
+
}
|
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.78
|
|
6
6
|
// API version 3
|
|
7
7
|
|
|
8
8
|
/**
|