factorio-types 0.0.38 → 0.0.39
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 +307 -318
- package/dist/concepts.d.ts +114 -76
- package/dist/defines.d.ts +24 -24
- package/dist/events.d.ts +59 -59
- package/dist/global.d.ts +11 -11
- package/package.json +1 -1
package/dist/concepts.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
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.
|
|
6
|
-
// API version
|
|
5
|
+
// Factorio version 1.1.89
|
|
6
|
+
// API version 4
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Depending on the value of `filter`, the table may take additional fields. `filter` may be one of the following:
|
|
@@ -42,7 +42,7 @@ interface Alert {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* A {@link string | string} that specifies where a GUI element should be.
|
|
45
|
+
* A {@link string | runtime:string} that specifies where a GUI element should be.
|
|
46
46
|
*/
|
|
47
47
|
type Alignment = 'top-left' | 'middle-left' | /* The same as `"middle-left"` */ 'left' | 'bottom-left' | 'top-center' | 'middle-center' | /* The same as `"middle-center"` */ 'center' | 'bottom-center' | 'top-right' | /* The same as `"middle-right"` */ 'right' | 'bottom-right'
|
|
48
48
|
|
|
@@ -124,7 +124,7 @@ interface AttackParameterFluid {
|
|
|
124
124
|
damage_modifier: number,
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
* Name of the {@link LuaFluidPrototype | LuaFluidPrototype}.
|
|
127
|
+
* Name of the {@link LuaFluidPrototype | runtime:LuaFluidPrototype}.
|
|
128
128
|
*/
|
|
129
129
|
type: string
|
|
130
130
|
}
|
|
@@ -139,12 +139,12 @@ type AttackParameters = AttackParametersProjectile | AttackParametersStream | De
|
|
|
139
139
|
interface AutoplaceControl {
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the {@link LuaAutoplaceControlPrototype | LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency.
|
|
142
|
+
* For things that are placed as spots such as ores and enemy bases, frequency is generally proportional to number of spots placed per unit area. For continuous features such as forests, frequency is how compressed the probability function is over distance, i.e. the inverse of 'scale' (similar to terrain_segmentation). When the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} is of the category `"terrain"`, then scale is shown in the map generator GUI instead of frequency.
|
|
143
143
|
*/
|
|
144
144
|
frequency: MapGenSize,
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* Has different effects for different things, but generally affects the 'health' or density of a thing that is placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or not 'richness' does anything for them) can be found in the {@link LuaAutoplaceControlPrototype | LuaAutoplaceControlPrototype} by looking up `game.autoplace_control_prototypes[(control prototype name)]`, e.g. `game.autoplace_control_prototypes["enemy-base"].richness` is false, because enemy base autoplacement doesn't use richness.
|
|
147
|
+
* Has different effects for different things, but generally affects the 'health' or density of a thing that is placed without affecting where it is placed. For trees, richness affects tree health. For ores, richness multiplies the amount of ore at any given tile in a patch. Metadata about autoplace controls (such as whether or not 'richness' does anything for them) can be found in the {@link LuaAutoplaceControlPrototype | runtime:LuaAutoplaceControlPrototype} by looking up `game.autoplace_control_prototypes[(control prototype name)]`, e.g. `game.autoplace_control_prototypes["enemy-base"].richness` is false, because enemy base autoplacement doesn't use richness.
|
|
148
148
|
*/
|
|
149
149
|
richness: MapGenSize,
|
|
150
150
|
|
|
@@ -323,7 +323,7 @@ interface BlueprintSignalIcon {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
/**
|
|
326
|
-
* Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition | MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero.
|
|
326
|
+
* Two positions, specifying the top-left and bottom-right corner of the box respectively. Like with {@link MapPosition | runtime:MapPosition}, the names of the members may be omitted. When read from the game, the third member `orientation` is present if it is non-zero.
|
|
327
327
|
* @example
|
|
328
328
|
* Explicit definition:
|
|
329
329
|
* ```
|
|
@@ -363,7 +363,7 @@ interface ChartTagSpec {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
|
-
* Coordinates of a chunk in a {@link LuaSurface | LuaSurface} where each integer `x`/`y` represents a different chunk. This uses the same format as {@link MapPosition | MapPosition}, meaning it can be specified either with or without explicit keys. A {@link MapPosition | MapPosition} can be translated to a ChunkPosition by dividing the `x`/`y` values by 32.
|
|
366
|
+
* Coordinates of a chunk in a {@link LuaSurface | runtime:LuaSurface} where each integer `x`/`y` represents a different chunk. This uses the same format as {@link MapPosition | runtime:MapPosition}, meaning it can be specified either with or without explicit keys. A {@link MapPosition | runtime:MapPosition} can be translated to a ChunkPosition by dividing the `x`/`y` values by 32.
|
|
367
367
|
*/
|
|
368
368
|
type ChunkPosition = {
|
|
369
369
|
x: number,
|
|
@@ -371,7 +371,7 @@ type ChunkPosition = {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
|
-
* A {@link ChunkPosition | ChunkPosition} with an added bounding box for the area of the chunk.
|
|
374
|
+
* A {@link ChunkPosition | runtime:ChunkPosition} with an added bounding box for the area of the chunk.
|
|
375
375
|
*/
|
|
376
376
|
interface ChunkPositionAndArea {
|
|
377
377
|
area: BoundingBox,
|
|
@@ -417,7 +417,7 @@ interface CircuitConnectionDefinition {
|
|
|
417
417
|
target_entity: LuaEntity,
|
|
418
418
|
|
|
419
419
|
/**
|
|
420
|
-
* Wire color, either {@link defines.wire_type.red | defines.wire_type.red} or {@link defines.wire_type.green | defines.wire_type.green}.
|
|
420
|
+
* Wire color, either {@link defines.wire_type.red | runtime:defines.wire_type.red} or {@link defines.wire_type.green | runtime:defines.wire_type.green}.
|
|
421
421
|
*/
|
|
422
422
|
wire: defines.wire_type
|
|
423
423
|
}
|
|
@@ -436,7 +436,7 @@ interface CircularParticleCreationSpecification {
|
|
|
436
436
|
height_deviation: number,
|
|
437
437
|
|
|
438
438
|
/**
|
|
439
|
-
* Name of the {@link LuaEntityPrototype | LuaEntityPrototype}
|
|
439
|
+
* Name of the {@link LuaEntityPrototype | runtime:LuaEntityPrototype}
|
|
440
440
|
*/
|
|
441
441
|
name: string,
|
|
442
442
|
speed: number,
|
|
@@ -484,21 +484,21 @@ interface CliffPlacementSettings {
|
|
|
484
484
|
type CollisionMask = {[key: string]: true}
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
|
-
* A {@link string | string} specifying a collision mask layer.
|
|
487
|
+
* A {@link string | runtime:string} specifying a collision mask layer.
|
|
488
488
|
*
|
|
489
489
|
* In addition to the listed layers, there is `"layer-13"` through `"layer-55"`. These layers are currently unused by the game but may change. If a mod is going to use one of the unused layers it's recommended to start at the higher layers because the base game will take from the lower ones.
|
|
490
490
|
*/
|
|
491
491
|
type CollisionMaskLayer = 'ground-tile' | 'water-tile' | 'resource-layer' | 'doodad-layer' | 'floor-layer' | 'item-layer' | 'ghost-layer' | 'object-layer' | 'player-layer' | 'train-layer' | 'rail-layer' | 'transport-belt-layer' | 'not-setup' | 'layer-13' | 'layer-14' | 'layer-15' | 'layer-16' | 'layer-17' | 'layer-18' | 'layer-19' | 'layer-20' | 'layer-21' | 'layer-22' | 'layer-23' | 'layer-24' | 'layer-25' | 'layer-26' | 'layer-27' | 'layer-28' | 'layer-29' | 'layer-30' | 'layer-31' | 'layer-32' | 'layer-33' | 'layer-34' | 'layer-35' | 'layer-36' | 'layer-37' | 'layer-38' | 'layer-39' | 'layer-40' | 'layer-41' | 'layer-42' | 'layer-43' | 'layer-44' | 'layer-45' | 'layer-46' | 'layer-47' | 'layer-48' | 'layer-49' | 'layer-50' | 'layer-51' | 'layer-52' | 'layer-53' | 'layer-54' | 'layer-55'
|
|
492
492
|
|
|
493
493
|
/**
|
|
494
|
-
* A {@link CollisionMask | CollisionMask} which also includes any flags this mask has.
|
|
494
|
+
* A {@link CollisionMask | runtime:CollisionMask} which also includes any flags this mask has.
|
|
495
495
|
*/
|
|
496
496
|
type CollisionMaskWithFlags = {[key: string]: true}
|
|
497
497
|
|
|
498
498
|
/**
|
|
499
499
|
* Red, green, blue and alpha values, all in range [0, 1] or all in range [0, 255] if any value is > 1. All values here are optional. Color channels default to `0`, the alpha channel defaults to `1`.
|
|
500
500
|
*
|
|
501
|
-
* Similar to {@link MapPosition | MapPosition}, Color allows the short-hand notation of passing an array of exactly 3 or 4 numbers. The game usually expects colors to be in pre-multiplied form (color channels are pre-multiplied by alpha).
|
|
501
|
+
* Similar to {@link MapPosition | runtime:MapPosition}, Color allows the short-hand notation of passing an array of exactly 3 or 4 numbers. The game usually expects colors to be in pre-multiplied form (color channels are pre-multiplied by alpha).
|
|
502
502
|
* @example
|
|
503
503
|
* ```
|
|
504
504
|
* red1 = {r = 0.5, g = 0, b = 0, a = 0.5} -- Half-opacity red
|
|
@@ -516,7 +516,7 @@ type Color = {
|
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
/**
|
|
519
|
-
* Same as {@link Color | Color}, but red, green, blue and alpha values can be any floating point number, without any special handling of the range [1, 255].
|
|
519
|
+
* Same as {@link Color | runtime:Color}, but red, green, blue and alpha values can be any floating point number, without any special handling of the range [1, 255].
|
|
520
520
|
*/
|
|
521
521
|
type ColorModifier = {
|
|
522
522
|
a?: number,
|
|
@@ -593,6 +593,12 @@ interface ConstantCombinatorParameters {
|
|
|
593
593
|
signal: SignalID
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
+
interface CopperConnectionDefinition {
|
|
597
|
+
source_wire_connector: defines.wire_connection_id,
|
|
598
|
+
target_entity: LuaEntity,
|
|
599
|
+
target_wire_connector: defines.wire_connection_id
|
|
600
|
+
}
|
|
601
|
+
|
|
596
602
|
interface CraftingQueueItem {
|
|
597
603
|
|
|
598
604
|
/**
|
|
@@ -730,18 +736,20 @@ interface DecorativeResult {
|
|
|
730
736
|
* Technology and recipe difficulty settings. Updating any of the attributes will immediately take effect in the game engine.
|
|
731
737
|
*/
|
|
732
738
|
interface DifficultySettings {
|
|
733
|
-
recipe_difficulty: defines.difficulty_settings.recipe_difficulty
|
|
734
|
-
|
|
739
|
+
recipe_difficulty: defines.difficulty_settings.recipe_difficulty
|
|
740
|
+
|
|
735
741
|
/**
|
|
736
|
-
* Either `"after-victory"`, `"always"` or `"never"`. Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See {@link LuaForce | LuaForce} for that.
|
|
742
|
+
* Either `"after-victory"`, `"always"` or `"never"`. Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See {@link LuaForce | runtime:LuaForce} for that.
|
|
737
743
|
*/
|
|
738
|
-
research_queue_setting: string
|
|
739
|
-
|
|
740
|
-
|
|
744
|
+
research_queue_setting: string
|
|
745
|
+
|
|
746
|
+
technology_difficulty: defines.difficulty_settings.technology_difficulty
|
|
747
|
+
|
|
741
748
|
/**
|
|
742
749
|
* A value in range [0.001, 1000].
|
|
743
750
|
*/
|
|
744
751
|
technology_price_multiplier: number
|
|
752
|
+
|
|
745
753
|
}
|
|
746
754
|
|
|
747
755
|
interface DisplayResolution {
|
|
@@ -907,7 +915,7 @@ interface EquipmentPoint {
|
|
|
907
915
|
}
|
|
908
916
|
|
|
909
917
|
/**
|
|
910
|
-
* Position inside an equipment grid. This uses the same format as {@link MapPosition | MapPosition}, meaning it can be specified either with or without explicit keys.
|
|
918
|
+
* Position inside an equipment grid. This uses the same format as {@link MapPosition | runtime:MapPosition}, meaning it can be specified either with or without explicit keys.
|
|
911
919
|
* @example
|
|
912
920
|
* Explicit definition:
|
|
913
921
|
* ```
|
|
@@ -936,12 +944,12 @@ type EquipmentPosition = {
|
|
|
936
944
|
type EquipmentPrototypeFilter = EquipmentPrototypeFilterType | DefaultEquipmentPrototypeFilter
|
|
937
945
|
|
|
938
946
|
/**
|
|
939
|
-
* Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@link the list of Factorio events | events
|
|
947
|
+
* Information about the event that has been raised. The table can also contain other fields depending on the type of event. See {@link the list of Factorio events | runtime:events} for more information on these.
|
|
940
948
|
*/
|
|
941
949
|
interface EventData {
|
|
942
950
|
|
|
943
951
|
/**
|
|
944
|
-
* The name of the mod that raised the event if it was raised using {@link LuaBootstrap::raise_event | LuaBootstrap::raise_event}.
|
|
952
|
+
* The name of the mod that raised the event if it was raised using {@link LuaBootstrap::raise_event | runtime:LuaBootstrap::raise_event}.
|
|
945
953
|
*/
|
|
946
954
|
mod_name?: string,
|
|
947
955
|
|
|
@@ -977,7 +985,7 @@ interface Fluid {
|
|
|
977
985
|
name: string,
|
|
978
986
|
|
|
979
987
|
/**
|
|
980
|
-
* The temperature. When reading from {@link LuaFluidBox | LuaFluidBox}, this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid will be set to the fluid's default temperature as specified in the fluid's prototype.
|
|
988
|
+
* The temperature. When reading from {@link LuaFluidBox | runtime:LuaFluidBox}, this field will always be present. It is not necessary to specify it when writing, however. When not specified, the fluid will be set to the fluid's default temperature as specified in the fluid's prototype.
|
|
981
989
|
*/
|
|
982
990
|
temperature?: number
|
|
983
991
|
}
|
|
@@ -1062,7 +1070,7 @@ type ForceCondition = /* All forces pass. */ 'all' | /* Forces which will attack
|
|
|
1062
1070
|
/**
|
|
1063
1071
|
* A force may be specified in one of three ways.
|
|
1064
1072
|
*/
|
|
1065
|
-
type ForceIdentification = /* The force index. */ number | /* The force name. */ string | /* A reference to {@link LuaForce | LuaForce} may be passed directly. */ LuaForce
|
|
1073
|
+
type ForceIdentification = /* The force index. */ number | /* The force name. */ string | /* A reference to {@link LuaForce | runtime:LuaForce} may be passed directly. */ LuaForce
|
|
1066
1074
|
|
|
1067
1075
|
/**
|
|
1068
1076
|
* 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.
|
|
@@ -1173,8 +1181,12 @@ interface GuiAnchor {
|
|
|
1173
1181
|
*/
|
|
1174
1182
|
type GuiArrowSpecification = GuiArrowSpecificationCraftingQueue | GuiArrowSpecificationEntity | GuiArrowSpecificationItemStack | GuiArrowSpecificationPosition | DefaultGuiArrowSpecification
|
|
1175
1183
|
|
|
1184
|
+
type GuiArrowType = 'nowhere' | 'goal' | 'entity_info' | 'active_window' | 'entity' | 'position' | 'crafting_queue' | 'item_stack'
|
|
1185
|
+
|
|
1186
|
+
type GuiElementType = /* A clickable element. Relevant event: {@link on_gui_click | runtime:on_gui_click} */ 'button' | /* A `button` that displays a sprite rather than text. Relevant event: {@link on_gui_click | runtime:on_gui_click} */ 'sprite-button' | /* A clickable element with a check mark that can be turned off or on. Relevant event: {@link on_gui_checked_state_changed | runtime:on_gui_checked_state_changed} */ 'checkbox' | /* An invisible container that lays out its children either horizontally or vertically. */ 'flow' | /* A non-transparent box that contains other elements. It can have a title (set via the `caption` attribute). Just like a `flow`, it lays out its children either horizontally or vertically. Relevant event: {@link on_gui_location_changed | runtime:on_gui_location_changed} */ 'frame' | /* A piece of text. */ 'label' | /* A horizontal or vertical separation line. */ 'line' | /* A partially filled bar that can be used to indicate progress. */ 'progressbar' | /* An invisible container that lays out its children in a specific number of columns. The width of each column is determined by the widest element it contains. */ 'table' | /* A single-line box the user can type into. Relevant events: {@link on_gui_text_changed | runtime:on_gui_text_changed}, {@link on_gui_confirmed | runtime:on_gui_confirmed} */ 'textfield' | /* An element that is similar to a `checkbox`, but with a circular appearance. Clicking a selected radio button will not unselect it. Radio buttons are not linked to each other in any way. Relevant event: {@link on_gui_checked_state_changed | runtime:on_gui_checked_state_changed} */ 'radiobutton' | /* An element that shows an image. */ 'sprite' | /* An invisible element that is similar to a `flow`, but has the ability to show and use scroll bars. */ 'scroll-pane' | /* A drop-down containing strings of text. Relevant event: {@link on_gui_selection_state_changed | runtime:on_gui_selection_state_changed} */ 'drop-down' | /* A list of strings, only one of which can be selected at a time. Shows a scroll bar if necessary. Relevant event: {@link on_gui_selection_state_changed | runtime:on_gui_selection_state_changed} */ 'list-box' | /* A camera that shows the game at the given position on the given surface. It can visually track an {@link entity | runtime:LuaGuiElement::entity} that is set after the element has been created. */ 'camera' | /* A button that lets the player pick from a certain kind of prototype, with optional filtering. Relevant event: {@link on_gui_elem_changed | runtime:on_gui_elem_changed} */ 'choose-elem-button' | /* A multi-line `textfield`. Relevant event: {@link on_gui_text_changed | runtime:on_gui_text_changed} */ 'text-box' | /* A horizontal number line which can be used to choose a number. Relevant event: {@link on_gui_value_changed | runtime:on_gui_value_changed} */ 'slider' | /* A minimap preview, similar to the normal player minimap. It can visually track an {@link entity | runtime:LuaGuiElement::entity} that is set after the element has been created. */ 'minimap' | /* A preview of an entity. The {@link entity | runtime:LuaGuiElement::entity} has to be set after the element has been created. */ 'entity-preview' | /* An empty element that just exists. The root GUI elements `screen` and `relative` are `empty-widget`s. */ 'empty-widget' | /* A collection of `tab`s and their contents. Relevant event: {@link on_gui_selected_tab_changed | runtime:on_gui_selected_tab_changed} */ 'tabbed-pane' | /* A tab for use in a `tabbed-pane`. */ 'tab' | /* A switch with three possible states. Can have labels attached to either side. Relevant event: {@link on_gui_switch_state_changed | runtime:on_gui_switch_state_changed} */ 'switch'
|
|
1187
|
+
|
|
1176
1188
|
/**
|
|
1177
|
-
* Screen coordinates of a GUI element in a {@link LuaGui | LuaGui}. This uses the same format as {@link TilePosition | TilePosition}, meaning it can be specified either with or without explicit keys.
|
|
1189
|
+
* Screen coordinates of a GUI element in a {@link LuaGui | runtime:LuaGui}. This uses the same format as {@link TilePosition | runtime:TilePosition}, meaning it can be specified either with or without explicit keys.
|
|
1178
1190
|
*/
|
|
1179
1191
|
type GuiLocation = {
|
|
1180
1192
|
x: number,
|
|
@@ -1386,7 +1398,7 @@ interface ItemStackLocation {
|
|
|
1386
1398
|
* If `entity-description.furnace` exists, it is concatenated with `"\n"` and returned. Otherwise, if `item-description.furnace` exists, it is returned as-is. Otherwise, `"optional fallback"` is returned. If this value wasn't specified, the translation result would be `"Unknown key: 'item-description.furnace'"`.
|
|
1387
1399
|
*
|
|
1388
1400
|
*/
|
|
1389
|
-
type LocalisedString = string | number | boolean | object | null |
|
|
1401
|
+
type LocalisedString = string | number | boolean | object | null | LocalisedString[]
|
|
1390
1402
|
|
|
1391
1403
|
interface LogisticFilter {
|
|
1392
1404
|
|
|
@@ -1616,10 +1628,10 @@ type LuaSectorScannedEventFilter = LuaSectorScannedEventFilterGhostName | LuaSec
|
|
|
1616
1628
|
type LuaUpgradeCancelledEventFilter = LuaUpgradeCancelledEventFilterGhostName | LuaUpgradeCancelledEventFilterGhostType | LuaUpgradeCancelledEventFilterName | LuaUpgradeCancelledEventFilterType | DefaultLuaUpgradeCancelledEventFilter
|
|
1617
1629
|
|
|
1618
1630
|
/**
|
|
1619
|
-
*
|
|
1631
|
+
* A standard table containing all {@link MapSettings | runtime:MapSettings} attributes plus an additional table that contains all {@link DifficultySettings | runtime:DifficultySettings} properties.
|
|
1620
1632
|
*/
|
|
1621
1633
|
interface MapAndDifficultySettings {
|
|
1622
|
-
difficulty_settings:
|
|
1634
|
+
difficulty_settings: MapDifficultySettings,
|
|
1623
1635
|
enemy_evolution: EnemyEvolutionMapSettings,
|
|
1624
1636
|
enemy_expansion: EnemyExpansionMapSettings,
|
|
1625
1637
|
|
|
@@ -1633,6 +1645,21 @@ interface MapAndDifficultySettings {
|
|
|
1633
1645
|
unit_group: UnitGroupMapSettings
|
|
1634
1646
|
}
|
|
1635
1647
|
|
|
1648
|
+
interface MapDifficultySettings {
|
|
1649
|
+
recipe_difficulty: defines.difficulty_settings.recipe_difficulty,
|
|
1650
|
+
|
|
1651
|
+
/**
|
|
1652
|
+
* Either `"after-victory"`, `"always"` or `"never"`. Changing this to `"always"` or `"after-victory"` does not automatically unlock the research queue. See {@link LuaForce | runtime:LuaForce} for that.
|
|
1653
|
+
*/
|
|
1654
|
+
research_queue_setting: string,
|
|
1655
|
+
technology_difficulty: defines.difficulty_settings.technology_difficulty,
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* A value in range [0.001, 1000].
|
|
1659
|
+
*/
|
|
1660
|
+
technology_price_multiplier: number
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1636
1663
|
/**
|
|
1637
1664
|
* The data that can be extracted from a map exchange string, as a plain table.
|
|
1638
1665
|
*/
|
|
@@ -1716,8 +1743,8 @@ interface MapGenSettings {
|
|
|
1716
1743
|
- `moisture` - a value between 0 and 1 that determines whether a tile becomes sandy (low moisture) or grassy (high moisture).
|
|
1717
1744
|
- `aux` - a value between 0 and 1 that determines whether low-moisture tiles become sand or red desert.
|
|
1718
1745
|
- `temperature` - provides a value (vaguely representing degrees Celsius, varying between -20 and 50) that is used (together with moisture and aux) as part of tree and decorative placement.
|
|
1719
|
-
- `elevation` - tiles values less than zero become water. Cliffs are placed along certain contours according to {@link CliffPlacementSettings | CliffPlacementSettings}.
|
|
1720
|
-
- `cliffiness` - determines whether (when >0.5) or not (when <0.5) a cliff will be placed at an otherwise suitable (according to {@link CliffPlacementSettings | CliffPlacementSettings}) location.
|
|
1746
|
+
- `elevation` - tiles values less than zero become water. Cliffs are placed along certain contours according to {@link CliffPlacementSettings | runtime:CliffPlacementSettings}.
|
|
1747
|
+
- `cliffiness` - determines whether (when >0.5) or not (when <0.5) a cliff will be placed at an otherwise suitable (according to {@link CliffPlacementSettings | runtime:CliffPlacementSettings}) location.
|
|
1721
1748
|
- `enemy-base-intensity` - a number that is referenced by both `enemy-base-frequency` and `enemy-base-radius`. i.e. if this is overridden, enemy base frequency and size will both be affected and do something reasonable. By default, this expression returns a value proportional to distance from any starting point, clamped at about 7.
|
|
1722
1749
|
- `enemy-base-frequency` - a number representing average number of enemy bases per tile for a region, by default in terms of `enemy-base-intensity`.
|
|
1723
1750
|
- `enemy-base-radius` - a number representing the radius of an enemy base, if one were to be placed on the given tile, by default proportional to a constant plus `enemy-base-intensity`. Climate controls ('Moisture' and 'Terrain type' at the bottom of the Terrain tab in the map generator GUI) don't have their own dedicated structures in MapGenSettings. Instead, their values are stored as property expression overrides with long names:
|
|
@@ -1802,17 +1829,23 @@ type MapPosition = {
|
|
|
1802
1829
|
*
|
|
1803
1830
|
*/
|
|
1804
1831
|
interface MapSettings {
|
|
1805
|
-
enemy_evolution: EnemyEvolutionMapSettings
|
|
1806
|
-
|
|
1807
|
-
|
|
1832
|
+
enemy_evolution: EnemyEvolutionMapSettings
|
|
1833
|
+
|
|
1834
|
+
enemy_expansion: EnemyExpansionMapSettings
|
|
1835
|
+
|
|
1808
1836
|
/**
|
|
1809
1837
|
* If a behavior fails this many times, the enemy (or enemy group) is destroyed. This solves biters getting stuck within their own base.
|
|
1810
1838
|
*/
|
|
1811
|
-
max_failed_behavior_count: number
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1839
|
+
max_failed_behavior_count: number
|
|
1840
|
+
|
|
1841
|
+
path_finder: PathFinderMapSettings
|
|
1842
|
+
|
|
1843
|
+
pollution: PollutionMapSettings
|
|
1844
|
+
|
|
1845
|
+
steering: SteeringMapSetting
|
|
1846
|
+
|
|
1815
1847
|
unit_group: UnitGroupMapSettings
|
|
1848
|
+
|
|
1816
1849
|
}
|
|
1817
1850
|
|
|
1818
1851
|
/**
|
|
@@ -1887,12 +1920,12 @@ interface ModuleEffects {
|
|
|
1887
1920
|
/**
|
|
1888
1921
|
* A set of flags. Active flags are in the dictionary as `true`, while inactive flags aren't present at all.
|
|
1889
1922
|
*
|
|
1890
|
-
* To write to this, use an array{@link [string | string}] of the mouse buttons that should be possible to use with on button. The flag `"left-and-right"` can also be set, which will set `"left"` and `"right"` to `true`.
|
|
1923
|
+
* To write to this, use an array{@link [string | runtime:string}] of the mouse buttons that should be possible to use with on button. The flag `"left-and-right"` can also be set, which will set `"left"` and `"right"` to `true`.
|
|
1891
1924
|
*/
|
|
1892
1925
|
type MouseButtonFlags = {[key: string]: true}
|
|
1893
1926
|
|
|
1894
1927
|
/**
|
|
1895
|
-
* A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@link
|
|
1928
|
+
* A fragment of a functional program used to generate coherent noise, probably for purposes related to terrain generation. These can only be meaningfully written/modified during the data load phase. More detailed information is found on the {@link prototype docs | prototype:NamedNoiseExpression}.
|
|
1896
1929
|
*/
|
|
1897
1930
|
interface NoiseExpression {
|
|
1898
1931
|
|
|
@@ -2204,7 +2237,7 @@ interface PlaceAsTileResult {
|
|
|
2204
2237
|
/**
|
|
2205
2238
|
* A player may be specified in one of three ways.
|
|
2206
2239
|
*/
|
|
2207
|
-
type PlayerIdentification = /* The player index. */ number | /* The player name. */ string | /* A reference to {@link LuaPlayer | LuaPlayer} may be passed directly. */ LuaPlayer
|
|
2240
|
+
type PlayerIdentification = /* The player index. */ number | /* The player name. */ string | /* A reference to {@link LuaPlayer | runtime:LuaPlayer} may be passed directly. */ LuaPlayer
|
|
2208
2241
|
|
|
2209
2242
|
/**
|
|
2210
2243
|
* These values are for the time frame of one second (60 ticks).
|
|
@@ -2345,7 +2378,7 @@ interface PrototypeHistory {
|
|
|
2345
2378
|
}
|
|
2346
2379
|
|
|
2347
2380
|
/**
|
|
2348
|
-
* 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".
|
|
2381
|
+
* The smooth orientation. It is a {@link float | runtime: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".
|
|
2349
2382
|
*
|
|
2350
2383
|
* For example then, a value of `0.625` would indicate "south-west", and a value of `0.875` would indicate "north-west".
|
|
2351
2384
|
*/
|
|
@@ -2382,6 +2415,11 @@ interface RidingState {
|
|
|
2382
2415
|
direction: defines.riding.direction
|
|
2383
2416
|
}
|
|
2384
2417
|
|
|
2418
|
+
interface RollingStockDrawData {
|
|
2419
|
+
orientaton: RealOrientation,
|
|
2420
|
+
position: MapPosition
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2385
2423
|
/**
|
|
2386
2424
|
* An area defined using the map editor.
|
|
2387
2425
|
*/
|
|
@@ -2531,31 +2569,31 @@ interface SmokeSource {
|
|
|
2531
2569
|
}
|
|
2532
2570
|
|
|
2533
2571
|
/**
|
|
2534
|
-
* It can be either the name of a {@link
|
|
2572
|
+
* It can be either the name of a {@link SoundPrototype | prototype:SoundPrototype} defined in the data stage, or a path in the form `"type/name"`. The latter option can be sorted into three categories.
|
|
2535
2573
|
*
|
|
2536
|
-
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript::is_valid_sound_path | LuaGameScript::is_valid_sound_path}.
|
|
2574
|
+
* The validity of a SoundPath can be verified at runtime using {@link LuaGameScript::is_valid_sound_path | runtime:LuaGameScript::is_valid_sound_path}.
|
|
2537
2575
|
*
|
|
2538
2576
|
* The utility and ambient types each contain general use sound prototypes defined by the game itself.
|
|
2539
|
-
* - `"utility"` - Uses
|
|
2540
|
-
* - `"ambient"` - Uses {@link AmbientSound |
|
|
2577
|
+
* - `"utility"` - Uses {@link UtilitySounds | prototype:UtilitySounds}. Example: `"utility/wire_connect_pole"`
|
|
2578
|
+
* - `"ambient"` - Uses {@link AmbientSound | prototype:AmbientSound}. Example: `"ambient/resource-deficiency"`
|
|
2541
2579
|
*
|
|
2542
2580
|
* The following types can be combined with any tile name as long as its prototype defines the
|
|
2543
2581
|
* corresponding sound.
|
|
2544
|
-
* - `"tile-walking"` - Uses {@link
|
|
2545
|
-
* - `"tile-mined"` - Uses {@link
|
|
2546
|
-
* - `"tile-build-small"` - Uses {@link
|
|
2547
|
-
* - `"tile-build-medium"` - Uses {@link
|
|
2548
|
-
* - `"tile-build-large"` - Uses {@link
|
|
2582
|
+
* - `"tile-walking"` - Uses {@link TilePrototype::walking_sound | prototype:TilePrototype::walking_sound}. Example: `"tile-walking/concrete"`
|
|
2583
|
+
* - `"tile-mined"` - Uses {@link TilePrototype::mined_sound | prototype:TilePrototype::mined_sound}
|
|
2584
|
+
* - `"tile-build-small"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}. Example: `"tile-build-small/concrete"`
|
|
2585
|
+
* - `"tile-build-medium"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}
|
|
2586
|
+
* - `"tile-build-large"` - Uses {@link TilePrototype::build_sound | prototype:TilePrototype::build_sound}
|
|
2549
2587
|
*
|
|
2550
2588
|
* The following types can be combined with any entity name as long as its prototype defines the
|
|
2551
2589
|
* corresponding sound.
|
|
2552
|
-
* - `"entity-build"` - Uses {@link Entity::build_sound |
|
|
2553
|
-
* - `"entity-mined"` - Uses {@link Entity::mined_sound |
|
|
2554
|
-
* - `"entity-mining"` - Uses {@link Entity::mining_sound |
|
|
2555
|
-
* - `"entity-vehicle_impact"` - Uses {@link
|
|
2556
|
-
* - `"entity-rotated"` - Uses {@link
|
|
2557
|
-
* - `"entity-open"` - Uses {@link Entity::open_sound |
|
|
2558
|
-
* - `"entity-close"` - Uses {@link Entity::close_sound |
|
|
2590
|
+
* - `"entity-build"` - Uses {@link Entity::build_sound | prototype:EntityPrototype::build_sound}. Example: `"entity-build/wooden-chest"`
|
|
2591
|
+
* - `"entity-mined"` - Uses {@link Entity::mined_sound | prototype:EntityPrototype::mined_sound}
|
|
2592
|
+
* - `"entity-mining"` - Uses {@link Entity::mining_sound | prototype:EntityPrototype::mining_sound}
|
|
2593
|
+
* - `"entity-vehicle_impact"` - Uses {@link EntityPrototype::vehicle_impact_sound | prototype:EntityPrototype::vehicle_impact_sound}
|
|
2594
|
+
* - `"entity-rotated"` - Uses {@link EntityPrototype::rotated_sound | prototype:EntityPrototype::rotated_sound}
|
|
2595
|
+
* - `"entity-open"` - Uses {@link Entity::open_sound | prototype:EntityPrototype::open_sound}
|
|
2596
|
+
* - `"entity-close"` - Uses {@link Entity::close_sound | prototype:EntityPrototype::close_sound}
|
|
2559
2597
|
*/
|
|
2560
2598
|
type SoundPath = string
|
|
2561
2599
|
|
|
@@ -2578,9 +2616,9 @@ interface SpawnPointDefinition {
|
|
|
2578
2616
|
}
|
|
2579
2617
|
|
|
2580
2618
|
/**
|
|
2581
|
-
* It can be either the name of a {@link
|
|
2619
|
+
* It can be either the name of a {@link SpritePrototype | prototype:SpritePrototype} defined in the data stage, or a path in form "type/name".
|
|
2582
2620
|
*
|
|
2583
|
-
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript::is_valid_sprite_path | LuaGameScript::is_valid_sprite_path}.
|
|
2621
|
+
* The validity of a SpritePath can be verified at runtime using {@link LuaGameScript::is_valid_sprite_path | runtime:LuaGameScript::is_valid_sprite_path}.
|
|
2584
2622
|
*
|
|
2585
2623
|
* The supported types are:
|
|
2586
2624
|
* - `"item"` - for example "item/iron-plate" is the icon sprite of iron plate
|
|
@@ -2621,7 +2659,7 @@ interface SteeringMapSettings {
|
|
|
2621
2659
|
/**
|
|
2622
2660
|
* A surface may be specified in one of three ways.
|
|
2623
2661
|
*/
|
|
2624
|
-
type SurfaceIdentification = /* It will be the index of the surface. `nauvis` has index `1`, the first surface-created surface will have index `2` and so on. */ number | /* It will be the surface name. E.g. `"nauvis"`. */ string | /* A reference to {@link LuaSurface | LuaSurface} may be passed directly. */ LuaSurface
|
|
2662
|
+
type SurfaceIdentification = /* It will be the index of the surface. `nauvis` has index `1`, the first surface-created surface will have index `2` and so on. */ number | /* It will be the surface name. E.g. `"nauvis"`. */ string | /* A reference to {@link LuaSurface | runtime:LuaSurface} may be passed directly. */ LuaSurface
|
|
2625
2663
|
|
|
2626
2664
|
interface TabAndContent {
|
|
2627
2665
|
content: LuaGuiElement,
|
|
@@ -2643,7 +2681,7 @@ type Tags = {[key: string]: AnyBasic}
|
|
|
2643
2681
|
/**
|
|
2644
2682
|
* A technology may be specified in one of three ways.
|
|
2645
2683
|
*/
|
|
2646
|
-
type TechnologyIdentification = /* The technology name. */ string | /* A reference to {@link LuaTechnology | LuaTechnology} may be passed directly. */ LuaTechnology | /* A reference to {@link LuaTechnologyPrototype | LuaTechnologyPrototype} may be passed directly. */ LuaTechnologyPrototype
|
|
2684
|
+
type TechnologyIdentification = /* The technology name. */ string | /* A reference to {@link LuaTechnology | runtime:LuaTechnology} may be passed directly. */ LuaTechnology | /* A reference to {@link LuaTechnologyPrototype | runtime:LuaTechnologyPrototype} may be passed directly. */ LuaTechnologyPrototype
|
|
2647
2685
|
|
|
2648
2686
|
/**
|
|
2649
2687
|
* The effect that is applied when a technology is researched. It is a table that contains at least the field `type`.
|
|
@@ -2675,7 +2713,7 @@ interface Tile {
|
|
|
2675
2713
|
}
|
|
2676
2714
|
|
|
2677
2715
|
/**
|
|
2678
|
-
* Coordinates of a tile on a {@link LuaSurface | LuaSurface} where each integer `x`/`y` represents a different tile. This uses the same format as {@link MapPosition | MapPosition}, except it rounds any non-integer `x`/`y` down to whole numbers. It can be specified either with or without explicit keys.
|
|
2716
|
+
* Coordinates of a tile on a {@link LuaSurface | runtime:LuaSurface} where each integer `x`/`y` represents a different tile. This uses the same format as {@link MapPosition | runtime:MapPosition}, except it rounds any non-integer `x`/`y` down to whole numbers. It can be specified either with or without explicit keys.
|
|
2679
2717
|
*/
|
|
2680
2718
|
type TilePosition = {
|
|
2681
2719
|
x: number,
|
|
@@ -2707,7 +2745,7 @@ interface TrainScheduleRecord {
|
|
|
2707
2745
|
rail?: LuaEntity,
|
|
2708
2746
|
|
|
2709
2747
|
/**
|
|
2710
|
-
* When a train is allowed to reach rail target from any direction it will be `nil`. If rail has to be reached from specific direction, this value allows to choose the direction. This value corresponds to {@link LuaEntity::connected_rail_direction | LuaEntity::connected_rail_direction} of a TrainStop.
|
|
2748
|
+
* When a train is allowed to reach rail target from any direction it will be `nil`. If rail has to be reached from specific direction, this value allows to choose the direction. This value corresponds to {@link LuaEntity::connected_rail_direction | runtime:LuaEntity::connected_rail_direction} of a TrainStop.
|
|
2711
2749
|
*/
|
|
2712
2750
|
rail_direction?: defines.rail_direction,
|
|
2713
2751
|
|
|
@@ -2977,7 +3015,7 @@ interface DefaultAchievementPrototypeFilter extends BaseAchievementPrototypeFilt
|
|
|
2977
3015
|
interface BaseAttackParameters {
|
|
2978
3016
|
|
|
2979
3017
|
/**
|
|
2980
|
-
* List of the names of compatible {@link LuaAmmoCategoryPrototypes | LuaAmmoCategoryPrototype}.
|
|
3018
|
+
* List of the names of compatible {@link LuaAmmoCategoryPrototypes | runtime:LuaAmmoCategoryPrototype}.
|
|
2981
3019
|
*/
|
|
2982
3020
|
ammo_categories?: string[],
|
|
2983
3021
|
|
|
@@ -3091,7 +3129,7 @@ interface CapsuleActionArtilleryRemote extends BaseCapsuleAction {
|
|
|
3091
3129
|
type: 'artillery-remote',
|
|
3092
3130
|
|
|
3093
3131
|
/**
|
|
3094
|
-
* Name of the {@link flare prototype | LuaEntityPrototype}.
|
|
3132
|
+
* Name of the {@link flare prototype | runtime:LuaEntityPrototype}.
|
|
3095
3133
|
*/
|
|
3096
3134
|
flare: string
|
|
3097
3135
|
}
|
|
@@ -3115,7 +3153,7 @@ interface CapsuleActionEquipmentRemote extends BaseCapsuleAction {
|
|
|
3115
3153
|
type: 'equipment-remote',
|
|
3116
3154
|
|
|
3117
3155
|
/**
|
|
3118
|
-
* Name of the {@link LuaEquipmentPrototype | LuaEquipmentPrototype}.
|
|
3156
|
+
* Name of the {@link LuaEquipmentPrototype | runtime:LuaEquipmentPrototype}.
|
|
3119
3157
|
*/
|
|
3120
3158
|
equipment: string
|
|
3121
3159
|
}
|
|
@@ -3452,7 +3490,7 @@ interface EntityPrototypeFilterFlag extends BaseEntityPrototypeFilter {
|
|
|
3452
3490
|
filter: 'flag',
|
|
3453
3491
|
|
|
3454
3492
|
/**
|
|
3455
|
-
* One of the values in {@link EntityPrototypeFlags | EntityPrototypeFlags}.
|
|
3493
|
+
* One of the values in {@link EntityPrototypeFlags | runtime:EntityPrototypeFlags}.
|
|
3456
3494
|
*/
|
|
3457
3495
|
flag: string
|
|
3458
3496
|
}
|
|
@@ -3657,7 +3695,7 @@ interface FluidPrototypeFilterSubgroup extends BaseFluidPrototypeFilter {
|
|
|
3657
3695
|
filter: 'subgroup',
|
|
3658
3696
|
|
|
3659
3697
|
/**
|
|
3660
|
-
* A {@link LuaGroup | LuaGroup} (subgroup) name
|
|
3698
|
+
* A {@link LuaGroup | runtime:LuaGroup} (subgroup) name
|
|
3661
3699
|
*/
|
|
3662
3700
|
subgroup: string
|
|
3663
3701
|
}
|
|
@@ -3828,7 +3866,7 @@ interface ItemPrototypeFilterFlag extends BaseItemPrototypeFilter {
|
|
|
3828
3866
|
filter: 'flag',
|
|
3829
3867
|
|
|
3830
3868
|
/**
|
|
3831
|
-
* One of the values in {@link ItemPrototypeFlags | ItemPrototypeFlags}.
|
|
3869
|
+
* One of the values in {@link ItemPrototypeFlags | runtime:ItemPrototypeFlags}.
|
|
3832
3870
|
*/
|
|
3833
3871
|
flag: string
|
|
3834
3872
|
}
|
|
@@ -3855,7 +3893,7 @@ interface ItemPrototypeFilterFuelCategory extends BaseItemPrototypeFilter {
|
|
|
3855
3893
|
filter: 'fuel-category',
|
|
3856
3894
|
|
|
3857
3895
|
/**
|
|
3858
|
-
* A {@link LuaFuelCategoryPrototype | LuaFuelCategoryPrototype} name
|
|
3896
|
+
* A {@link LuaFuelCategoryPrototype | runtime:LuaFuelCategoryPrototype} name
|
|
3859
3897
|
*/
|
|
3860
3898
|
'fuel-category': string
|
|
3861
3899
|
}
|
|
@@ -3976,7 +4014,7 @@ interface ItemPrototypeFilterSubgroup extends BaseItemPrototypeFilter {
|
|
|
3976
4014
|
filter: 'subgroup',
|
|
3977
4015
|
|
|
3978
4016
|
/**
|
|
3979
|
-
* A {@link LuaGroup | LuaGroup} (subgroup) name
|
|
4017
|
+
* A {@link LuaGroup | runtime:LuaGroup} (subgroup) name
|
|
3980
4018
|
*/
|
|
3981
4019
|
subgroup: string
|
|
3982
4020
|
}
|
|
@@ -4110,7 +4148,7 @@ interface LuaEntityDamagedEventFilterDamageType extends BaseLuaEntityDamagedEven
|
|
|
4110
4148
|
filter: 'damage-type',
|
|
4111
4149
|
|
|
4112
4150
|
/**
|
|
4113
|
-
* A {@link LuaDamagePrototype | LuaDamagePrototype} name
|
|
4151
|
+
* A {@link LuaDamagePrototype | runtime:LuaDamagePrototype} name
|
|
4114
4152
|
*/
|
|
4115
4153
|
type: string
|
|
4116
4154
|
}
|
|
@@ -5783,7 +5821,7 @@ interface RecipePrototypeFilterCategory extends BaseRecipePrototypeFilter {
|
|
|
5783
5821
|
filter: 'category',
|
|
5784
5822
|
|
|
5785
5823
|
/**
|
|
5786
|
-
* A {@link LuaRecipeCategoryPrototype | LuaRecipeCategoryPrototype} name
|
|
5824
|
+
* A {@link LuaRecipeCategoryPrototype | runtime:LuaRecipeCategoryPrototype} name
|
|
5787
5825
|
*/
|
|
5788
5826
|
category: string
|
|
5789
5827
|
}
|
|
@@ -5904,7 +5942,7 @@ interface RecipePrototypeFilterSubgroup extends BaseRecipePrototypeFilter {
|
|
|
5904
5942
|
filter: 'subgroup',
|
|
5905
5943
|
|
|
5906
5944
|
/**
|
|
5907
|
-
* A {@link LuaGroup | LuaGroup} (subgroup) name
|
|
5945
|
+
* A {@link LuaGroup | runtime:LuaGroup} (subgroup) name
|
|
5908
5946
|
*/
|
|
5909
5947
|
subgroup: string
|
|
5910
5948
|
}
|