-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.d.tl
3106 lines (2718 loc) · 109 KB
/
classes.d.tl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--[[
Collection of settings for overriding default ai behavior.
]]--
global record LuaAISettings
allow_destroy_when_commands_fail: boolean
allow_try_return_to_spawner: boolean
do_separation: boolean
path_resolution_modifier: int8
end
--[[
Control behavior for accumulators.
]]--
global record LuaAccumulatorControlBehavior
output_signal: SignalID
end
--[[
Prototype of a achievement.
]]--
global record LuaAchievementPrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
allowed_without_fight: boolean
hidden: boolean
end
--[[
Prototype of a ammo category.
]]--
global record LuaAmmoCategoryPrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
bonus_gui_order: string
end
--[[
Control behavior for arithmetic combinators.
]]--
global record LuaArithmeticCombinatorControlBehavior
parameters: ArithmeticCombinatorParameters
end
--[[
Prototype of an autoplace control.
]]--
global record LuaAutoplaceControlPrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
richness: boolean
control_order: string
category: string
end
--[[
Entry point for registering event handlers. It is accessible through the global object named `script` .
]]--
global record LuaBootstrap
on_init: function(f: function(--[[TODO Fill out function params--]]))
on_load: function(f: function(--[[TODO Fill out function params--]]))
on_configuration_changed: function(f: function(--[[TODO Fill out function params--]]))
on_event: function(event: defines.events | {defines.events} | string, f: function(--[[TODO Fill out function params--]]), filters: Filters)
on_nth_tick: function(tick: uint | {uint}, f: function(--[[TODO Fill out function params--]]))
register_on_entity_destroyed: function(entity: LuaEntity): uint64
generate_event_name: function(): uint
get_event_handler: function(event: uint)
get_event_order: function()
set_event_filter: function(event: uint, filters: Filters)
get_event_filter: function(event: uint): table
raise_event: function(event: uint, table: any)
raise_console_chat: function(table: RaiseEventParameters)
raise_player_crafted_item: function(table: RaiseEventParameters)
raise_player_fast_transferred: function(table: RaiseEventParameters)
raise_biter_base_built: function(table: RaiseEventParameters)
raise_market_item_purchased: function(table: RaiseEventParameters)
raise_script_built: function(table: RaiseEventParameters)
raise_script_destroy: function(table: RaiseEventParameters)
raise_script_revive: function(table: RaiseEventParameters)
raise_script_set_tiles: function(table: RaiseEventParameters)
mod_name: string
level: table
active_mods: {string: string}
object_name: string
end
--[[
A reference to the burner energy source owned by a specific [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) or [LuaEquipment](https://lua-api.factorio.com/latest/LuaEquipment.html) .
]]--
global record LuaBurner
owner: LuaEntity | LuaEquipment
inventory: LuaInventory
burnt_result_inventory: LuaInventory
heat: double
heat_capacity: double
remaining_burning_fuel: double
currently_burning: LuaItemPrototype
fuel_categories: {string: string}
end
--[[
Prototype of a burner energy source.
]]--
global record LuaBurnerPrototype
emissions: double
render_no_network_icon: boolean
render_no_power_icon: boolean
effectivity: double
fuel_inventory_size: uint
burnt_inventory_size: uint
smoke: {SmokeSource}
light_flicker: table
fuel_categories: {string: string}
end
--[[
A chunk iterator can be used for iterating chunks coordinates of a surface.
The returned type is a [ChunkPositionAndArea](https://lua-api.factorio.com/latest/Concepts.html#ChunkPositionAndArea) containing the chunk coordinates and its area.
Example `for chunk in some_surface.get_chunks() do game.player.print("x: " .. chunk.x .. ", y: " .. chunk.y) game.player.print("area: " .. serpent.line(chunk.area)) end`
]]--
global record LuaChunkIterator
operator : function(): ChunkPositionAndArea
end
--[[
A circuit network associated with a given entity, connector, and wire type.
]]--
global record LuaCircuitNetwork
get_signal: function(signal: SignalID): int
entity: LuaEntity
wire_type: defines.wire_type
circuit_connector_id: defines.circuit_connector_id
signals: {Signal}
network_id: uint
connected_circuit_count: uint
end
--[[
]]--
global record LuaCombinatorControlBehavior
get_signal_last_tick: function(signal: SignalID): int
signals_last_tick: {Signal}
end
--[[
Allows for the registration of custom console commands. Similarly to [event subscriptions](https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_event) , these don't persist through a save-and-load cycle.
]]--
global record LuaCommandProcessor
add_command: function(name: string, help: LocalisedString, function_: function(--[[TODO Fill out function params--]]))
remove_command: function(name: string): boolean
commands: {string: string}
game_commands: {string: string}
object_name: string
end
--[[
Control behavior for constant combinators.
]]--
global record LuaConstantCombinatorControlBehavior
set_signal: function(index: uint, signal: Signal)
get_signal: function(index: uint): Signal
parameters: ConstantCombinatorParameters
enabled: boolean
signals_count: uint
end
--[[
Control behavior for container entities.
]]--
global record LuaContainerControlBehavior
end
--[[
This is an abstract base class containing the common functionality between [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) and entities
(see [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) ). When accessing player-related functions through a [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) , it must refer to a character
entity.
]]--
global record LuaControl
get_inventory: function(inventory: defines.inventory): LuaInventory
get_main_inventory: function(): LuaInventory
can_insert: function(items: ItemStackSpecification): boolean
insert: function(items: ItemStackSpecification): uint
set_gui_arrow: function(luaControlset_gui_arrow_param: LuaControlset_gui_arrow_param)
clear_gui_arrow: function()
get_item_count: function(item: string): uint
has_items_inside: function(): boolean
can_reach_entity: function(entity: LuaEntity): boolean
clear_items_inside: function()
remove_item: function(items: ItemStackSpecification): uint
teleport: function(position: Position, surface: SurfaceSpecification): boolean
update_selected_entity: function(position: Position)
clear_selected_entity: function()
disable_flashlight: function()
enable_flashlight: function()
is_flashlight_enabled: function()
get_craftable_count: function(recipe: string | LuaRecipe): uint
begin_crafting: function(luaControlbegin_crafting_param: LuaControlbegin_crafting_param): uint
cancel_crafting: function(options: any)
mine_entity: function(entity: LuaEntity, force: boolean): boolean
mine_tile: function(tile: LuaTile): boolean
is_player: function(): boolean
open_technology_gui: function(technology: TechnologySpecification)
set_personal_logistic_slot: function(slot_index: uint, value: PersonalLogisticParameters): boolean
set_vehicle_logistic_slot: function(slot_index: uint, value: PersonalLogisticParameters): boolean
get_personal_logistic_slot: function(slot_index: uint): PersonalLogisticParameters
get_vehicle_logistic_slot: function(slot_index: uint): PersonalLogisticParameters
clear_personal_logistic_slot: function(slot_index: uint)
clear_vehicle_logistic_slot: function(slot_index: uint)
is_cursor_blueprint: function(): boolean
get_blueprint_entities: function(): {BlueprintEntity}
surface: LuaSurface
position: Position
vehicle: LuaEntity
force: ForceSpecification
selected: LuaEntity
opened: LuaEntity | LuaItemStack | LuaEquipment | LuaEquipmentGrid | LuaPlayer | LuaGuiElement | defines.gui_type
crafting_queue_size: uint
crafting_queue_progress: double
walking_state: table
riding_state: RidingState
mining_state: table
shooting_state: table
picking_state: boolean
repair_state: table
cursor_stack: LuaItemStack
cursor_ghost: ItemPrototypeSpecification
driving: boolean
crafting_queue: {CraftingQueueItem}
following_robots: {LuaEntity}
cheat_mode: boolean
character_crafting_speed_modifier: double
character_mining_speed_modifier: double
character_additional_mining_categories: {string}
character_running_speed_modifier: double
character_build_distance_bonus: uint
character_item_drop_distance_bonus: uint
character_reach_distance_bonus: uint
character_resource_reach_distance_bonus: uint
character_item_pickup_distance_bonus: uint
character_loot_pickup_distance_bonus: uint
character_inventory_slots_bonus: uint
character_trash_slot_count_bonus: uint
character_maximum_following_robot_count_bonus: uint
character_health_bonus: float
character_personal_logistic_requests_enabled: boolean
vehicle_logistic_requests_enabled: boolean
opened_gui_type: defines.gui_type
build_distance: uint
drop_item_distance: uint
reach_distance: uint
item_pickup_distance: double
loot_pickup_distance: double
resource_reach_distance: double
in_combat: boolean
character_running_speed: double
character_mining_progress: double
end
--[[
The control behavior for an entity. Inserters have logistic network and circuit network behavior logic, lamps have circuit logic and so on. This is an abstract base class that concrete control behaviors inherit.
**Note:** An control reference becomes invalid once the control behavior is removed or the
entity (see [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) ) it resides in is destroyed.
]]--
global record LuaControlBehavior
get_circuit_network: function(wire: defines.wire_type, circuit_connector: defines.circuit_connector_id): LuaCircuitNetwork
type: defines.control_behavior.type
entity: LuaEntity
end
--[[
A custom tag that shows on the map view.
]]--
global record LuaCustomChartTag
destroy: function()
icon: SignalID
last_user: LuaPlayer
position: Position
text: string
tag_number: uint
force: LuaForce
surface: LuaSurface
end
--[[
Prototype of a custom input.
]]--
global record LuaCustomInputPrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
key_sequence: string
alternative_key_sequence: string
linked_game_control: string
consuming: string
action: string
enabled: boolean
enabled_while_spectating: boolean
enabled_while_in_cutscene: boolean
include_selected_prototype: boolean
item_to_spawn: LuaItemPrototype
end
--[[
Lazily evaluated table.
For performance reasons, we sometimes return a custom table-like type instead of a native Lua table. This custom
type lazily constructs the necessary Lua wrappers of the corresponding C++ objects, therefore preventing their
unnecessary construction in some cases.
There are some notable consequences to the usage of a custom table type rather than the native Lua table type:
Iterating a custom table is only possible using the `pairs` Lua function; `ipairs` won't work. Another key
difference is that custom tables cannot be serialised into a game save file -- if saving the game would require
serialisation of a custom table, an error will be displayed and the game will not be saved.
Example In previous versions of Factorio, this would create a [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instance for every player in the game,
even though only one such wrapper is needed. In the current version, accessing [game.players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players) by itself does not create any [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instances; they are
created lazily when accessed. Therefore, this example only constructs one [LuaPlayer](https://lua-api.factorio.com/latest/LuaPlayer.html) instance, no matter
how many elements there are in `game.players` .
Example `game.players["Oxyd"].character.die()`
Example Custom tables may be iterated using `pairs` . `for _, p in pairs(game.players) do game.player.print(p.name); end`
Example The following will produce no output because `ipairs` is not supported with custom tables. `for _, p in ipairs(game.players) do game.player.print(p.name); end -- incorrect; use pairs instead`
Example This statement will execute successfully and `global.p` will be useable as one might expect. However, as soon
as the user tries to save the game, a "LuaCustomTable cannot be serialized" error will be shown. The game will
remain unsaveable so long as `global.p` refers to an instance of a custom table. `global.p = game.players -- This has high potential to make the game unsaveable`
]]--
global record LuaCustomTable
{any}
end
--[[
Prototype of a damage.
]]--
global record LuaDamagePrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
hidden: boolean
end
--[[
Control behavior for decider combinators.
]]--
global record LuaDeciderCombinatorControlBehavior
parameters: DeciderCombinatorParameters
end
--[[
Prototype of an optimized decorative.
]]--
global record LuaDecorativePrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
collision_box: BoundingBox
collision_mask: CollisionMask
collision_mask_with_flags: CollisionMaskWithFlags
autoplace_specification: AutoplaceSpecification
end
--[[
Prototype of an electric energy source.
]]--
global record LuaElectricEnergySourcePrototype
buffer_capacity: double
usage_priority: string
input_flow_limit: double
output_flow_limit: double
drain: double
emissions: double
render_no_network_icon: boolean
render_no_power_icon: boolean
end
--[[
The primary interface for interacting with entities through the Lua API.
Entity is everything on the map except tiles.
]]--
global record LuaEntity
get_output_inventory: function(): LuaInventory
get_module_inventory: function(): LuaInventory
get_fuel_inventory: function(): LuaInventory
get_burnt_result_inventory: function(): LuaInventory
damage: function(damage: float, force: ForceSpecification, type: string, dealer: LuaEntity): float
can_be_destroyed: function(): boolean
destroy: function(opts: any): boolean
set_command: function(command: Command)
has_command: function(): boolean
die: function(force: ForceSpecification, cause: LuaEntity): boolean
has_flag: function(flag: string): boolean
ghost_has_flag: function(flag: string): boolean
add_market_item: function(offer: Offer)
remove_market_item: function(offer: uint): boolean
get_market_items: function(): {Offer}
clear_market_items: function()
connect_neighbour: function(target: LuaEntity | table): boolean
disconnect_neighbour: function(target: defines.wire_type | LuaEntity | table)
order_deconstruction: function(force: ForceSpecification, player: PlayerSpecification): boolean
cancel_deconstruction: function(force: ForceSpecification, player: PlayerSpecification)
to_be_deconstructed: function(): boolean
order_upgrade: function(luaEntityorder_upgrade_param: LuaEntityorder_upgrade_param): boolean
cancel_upgrade: function(force: ForceSpecification, player: PlayerSpecification): boolean
to_be_upgraded: function(): boolean
get_request_slot: function(slot: uint): SimpleItemStack
set_request_slot: function(request: ItemStackSpecification, slot: uint): boolean
clear_request_slot: function(slot: uint)
is_crafting: function(): boolean
is_opened: function(): boolean
is_opening: function(): boolean
is_closed: function(): boolean
is_closing: function(): boolean
request_to_open: function(force: ForceSpecification, extra_time: uint)
request_to_close: function(force: ForceSpecification)
get_transport_line: function(index: uint): LuaTransportLine
get_max_transport_line_index: function(): uint
launch_rocket: function(): boolean
revive: function(opts: any): {string: string}
silent_revive: function(opts: any): {string: string}
get_connected_rail: function(luaEntityget_connected_rail_param: LuaEntityget_connected_rail_param): LuaEntity
get_connected_rails: function(): {LuaEntity}
get_rail_segment_entity: function(direction: defines.rail_direction, in_else_out: boolean): LuaEntity
get_rail_segment_end: function(direction: defines.rail_direction): LuaEntity
get_rail_segment_length: function(): double
get_rail_segment_overlaps: function(): {LuaEntity}
get_filter: function(uint: any): string
set_filter: function(uint: any, string: any)
get_infinity_container_filter: function(index: uint): InfinityInventoryFilter
set_infinity_container_filter: function(index: uint, filter: InfinityInventoryFilter)
get_infinity_pipe_filter: function(): InfinityPipeFilter
set_infinity_pipe_filter: function(filter: InfinityPipeFilter)
get_heat_setting: function(): HeatSetting
set_heat_setting: function(filter: HeatSetting)
get_control_behavior: function(): LuaControlBehavior
get_or_create_control_behavior: function(): LuaControlBehavior
get_circuit_network: function(wire: defines.wire_type, circuit_connector: defines.circuit_connector_id): LuaCircuitNetwork
get_merged_signal: function(signal: SignalID, circuit_connector: defines.circuit_connector_id): int
get_merged_signals: function(circuit_connector: defines.circuit_connector_id): {Signal}
supports_backer_name: function(): boolean
copy_settings: function(entity: LuaEntity, by_player: PlayerSpecification): {string: string}
get_logistic_point: function(index: any): LuaLogisticPoint | {LuaLogisticPoint}
play_note: function(instrument: uint, note: uint): boolean
connect_rolling_stock: function(direction: defines.rail_direction): boolean
disconnect_rolling_stock: function(direction: defines.rail_direction): boolean
update_connections: function()
get_recipe: function(): LuaRecipe
set_recipe: function(recipe: string | LuaRecipe): {string: string}
rotate: function(options: any): boolean
get_driver: function(): LuaEntity | LuaPlayer
set_driver: function(driver: LuaEntity | PlayerSpecification)
get_passenger: function(): LuaEntity | LuaPlayer
set_passenger: function(passenger: LuaEntity | PlayerSpecification)
is_connected_to_electric_network: function(): boolean
get_train_stop_trains: function(): {LuaTrain}
get_stopped_train: function(): LuaTrain
clone: function(luaEntityclone_param: LuaEntityclone_param): LuaEntity
get_fluid_count: function(fluid: string): double
get_fluid_contents: function(): {string: string}
remove_fluid: function(luaEntityremove_fluid_param: LuaEntityremove_fluid_param): double
insert_fluid: function(fluid: Fluid): double
clear_fluid_inside: function()
get_beam_source: function(): BeamTarget
set_beam_source: function(source: LuaEntity | Position)
get_beam_target: function(): BeamTarget
set_beam_target: function(target: LuaEntity | Position)
get_radius: function(): double
get_health_ratio: function(): float
create_build_effect_smoke: function()
release_from_spawner: function()
toggle_equipment_movement_bonus: function()
can_shoot: function(target: LuaEntity, position: Position): boolean
start_fading_out: function()
get_upgrade_target: function(): LuaEntityPrototype
get_upgrade_direction: function(): defines.direction
get_damage_to_be_taken: function(): float
deplete: function()
mine: function(options: any): boolean
spawn_decorations: function()
can_wires_reach: function(entity: LuaEntity): boolean
get_connected_rolling_stock: function(direction: defines.rail_direction): LuaEntity
is_registered_for_construction: function(): boolean
is_registered_for_deconstruction: function(force: ForceSpecification): boolean
is_registered_for_upgrade: function(): boolean
is_registered_for_repair: function(): boolean
add_autopilot_destination: function()
connect_linked_belts: function(neighbour: LuaEntity)
disconnect_linked_belts: function()
name: string
ghost_name: string
localised_name: LocalisedString
localised_description: LocalisedString
ghost_localised_name: LocalisedString
ghost_localised_description: LocalisedString
type: string
ghost_type: string
active: boolean
destructible: boolean
minable: boolean
rotatable: boolean
operable: boolean
health: float
direction: defines.direction
supports_direction: boolean
orientation: float
cliff_orientation: string
relative_turret_orientation: float
torso_orientation: float
amount: uint
initial_amount: uint
effectivity_modifier: float
consumption_modifier: float
friction_modifier: float
driver_is_gunner: boolean
vehicle_automatic_targeting_parameters: VehicleAutomaticTargetingParameters
speed: float
effective_speed: float
stack: LuaItemStack
prototype: LuaEntityPrototype
ghost_prototype: LuaEntityPrototype | LuaTilePrototype
drop_position: Position
pickup_position: Position
drop_target: LuaEntity
pickup_target: LuaEntity
selected_gun_index: uint
energy: double
temperature: double
previous_recipe: LuaRecipe
held_stack: LuaItemStack
held_stack_position: Position
train: LuaTrain
neighbours: {string: string} | {{LuaEntity}} | LuaEntity
belt_neighbours: {string: string}
fluidbox: LuaFluidBox
backer_name: string
entity_label: string
time_to_live: uint
color: Color
text: LocalisedString
signal_state: defines.signal_state
chain_signal_state: defines.chain_signal_state
to_be_looted: boolean
crafting_speed: double
crafting_progress: float
bonus_progress: double
productivity_bonus: double
pollution_bonus: double
speed_bonus: double
consumption_bonus: double
belt_to_ground_type: string
loader_type: string
rocket_parts: uint
logistic_network: LuaLogisticNetwork
logistic_cell: LuaLogisticCell
item_requests: {string: string}
player: LuaPlayer
unit_group: LuaUnitGroup
damage_dealt: double
kills: uint
last_user: LuaPlayer
electric_buffer_size: double
electric_input_flow_limit: double
electric_output_flow_limit: double
electric_drain: double
electric_emissions: double
unit_number: uint
ghost_unit_number: uint
mining_progress: double
bonus_mining_progress: double
power_production: double
power_usage: double
bounding_box: BoundingBox
secondary_bounding_box: BoundingBox
selection_box: BoundingBox
secondary_selection_box: BoundingBox
mining_target: LuaEntity
circuit_connected_entities: table
circuit_connection_definitions: {CircuitConnectionDefinition}
request_slot_count: uint
filter_slot_count: uint
loader_container: LuaEntity
grid: LuaEquipmentGrid
graphics_variation: uint8
tree_color_index: uint8
tree_color_index_max: uint8
tree_stage_index: uint8
tree_stage_index_max: uint8
tree_gray_stage_index: uint8
tree_gray_stage_index_max: uint8
burner: LuaBurner
shooting_target: LuaEntity
proxy_target: LuaEntity
stickers: {LuaEntity}
sticked_to: LuaEntity
parameters: ProgrammableSpeakerParameters
alert_parameters: ProgrammableSpeakerAlertParameters
electric_network_statistics: LuaFlowStatistics
inserter_stack_size_override: uint
products_finished: uint
spawner: LuaEntity
units: {LuaEntity}
power_switch_state: boolean
effects: Effects
infinity_container_filters: {InfinityInventoryFilter}
remove_unfiltered_items: boolean
character_corpse_player_index: uint
character_corpse_tick_of_death: uint
character_corpse_death_cause: LocalisedString
associated_player: LuaPlayer
tick_of_last_attack: uint
tick_of_last_damage: uint
splitter_filter: LuaItemPrototype
inserter_filter_mode: string
splitter_input_priority: string
splitter_output_priority: string
armed: boolean
recipe_locked: boolean
connected_rail: LuaEntity
trains_in_block: uint
timeout: uint
neighbour_bonus: double
ai_settings: LuaAISettings
highlight_box_type: string
highlight_box_blink_interval: uint
status: defines.entity_status
enable_logistics_while_moving: boolean
render_player: LuaPlayer
render_to_forces: {ForceSpecification}
pump_rail_target: LuaEntity
moving: boolean
electric_network_id: uint
allow_dispatching_robots: boolean
auto_launch: boolean
energy_generated_last_tick: double
storage_filter: LuaItemPrototype
request_from_buffers: boolean
corpse_expires: boolean
corpse_immune_to_entity_placement: boolean
tags: Tags
command: Command
distraction_command: Command
time_to_next_effect: uint
autopilot_destination: Position
autopilot_destinations: {Position}
trains_count: uint
trains_limit: uint
is_entity_with_force: boolean
is_entity_with_owner: boolean
is_entity_with_health: boolean
combat_robot_owner: LuaEntity
link_id: uint
follow_target: LuaEntity
follow_offset: Position
linked_belt_type: string
linked_belt_neighbour: LuaEntity
end
--[[
Prototype of an entity.
]]--
global record LuaEntityPrototype
has_flag: function(flag: string): boolean
get_inventory_size: function(index: defines.inventory): uint
type: string
name: string
localised_name: LocalisedString
localised_description: LocalisedString
max_health: float
infinite_resource: boolean
minimum_resource_amount: uint
normal_resource_amount: uint
infinite_depletion_resource_amount: uint
resource_category: string
mineable_properties: table
items_to_place_this: {SimpleItemStack}
collision_box: BoundingBox
secondary_collision_box: BoundingBox
map_generator_bounding_box: BoundingBox
selection_box: BoundingBox
drawing_box: BoundingBox
sticker_box: BoundingBox
collision_mask: CollisionMask
collision_mask_with_flags: CollisionMaskWithFlags
default_collision_mask_with_flags: CollisionMaskWithFlags
order: string
group: LuaGroup
subgroup: LuaGroup
healing_per_tick: float
emissions_per_second: double
corpses: {string: string}
selectable_in_game: boolean
selection_priority: uint
weight: double
resistances: Resistances
fast_replaceable_group: string
next_upgrade: LuaEntityPrototype
loot: Loot
repair_speed_modifier: uint
turret_range: uint
autoplace_specification: AutoplaceSpecification
belt_speed: double
result_units: {UnitSpawnDefinition}
attack_result: Trigger
final_attack_result: Trigger
attack_parameters: AttackParameters
spawn_cooldown: table
mining_drill_radius: double
mining_speed: double
logistic_mode: string
max_underground_distance: uint8
flags: EntityPrototypeFlags
remains_when_mined: {LuaEntityPrototype}
additional_pastable_entities: {LuaEntityPrototype}
allow_copy_paste: boolean
shooting_cursor_size: double
created_smoke: table
created_effect: Trigger
map_color: Color
friendly_map_color: Color
enemy_map_color: Color
build_base_evolution_requirement: double
instruments: {ProgrammableSpeakerInstrument}
max_polyphony: uint
module_inventory_size: uint
ingredient_count: uint
crafting_speed: double
crafting_categories: {string: string}
resource_categories: {string: string}
supply_area_distance: double
max_wire_distance: double
max_circuit_wire_distance: double
energy_usage: double
max_energy_usage: double
max_energy_production: double
effectivity: double
consumption: double
friction_force: double
braking_force: double
tank_driving: boolean
rotation_speed: double
turret_rotation_speed: double
guns: {string: string}
speed: double
speed_multiplier_when_out_of_energy: float
max_payload_size: uint
draw_cargo: boolean
energy_per_move: double
energy_per_tick: double
max_energy: double
min_to_charge: float
max_to_charge: float
burner_prototype: LuaBurnerPrototype
electric_energy_source_prototype: LuaElectricEnergySourcePrototype
heat_energy_source_prototype: LuaHeatEnergySourcePrototype
fluid_energy_source_prototype: LuaFluidEnergySourcePrototype
void_energy_source_prototype: LuaVoidEnergySourcePrototype
building_grid_bit_shift: uint
fluid_usage_per_tick: double
maximum_temperature: double
target_temperature: double
fluid: LuaFluidPrototype
fluid_capacity: double
pumping_speed: double
stack: boolean
allow_custom_vectors: boolean
allow_burner_leech: boolean
inserter_extension_speed: double
inserter_rotation_speed: double
inserter_pickup_position: Vector
inserter_drop_position: Vector
inserter_chases_belt_items: boolean
count_as_rock_for_filtered_deconstruction: boolean
filter_count: uint
time_to_live: uint
distribution_effectivity: double
explosion_beam: double
explosion_rotate: double
tree_color_count: uint8
alert_when_damaged: boolean
alert_when_attacking: boolean
color: Color
collision_mask_collides_with_self: boolean
collision_mask_collides_with_tiles_only: boolean
collision_mask_considers_tile_transitions: boolean
allowed_effects: {string: string}
rocket_parts_required: uint
rocket_rising_delay: uint8
launch_wait_time: uint8
light_blinking_speed: double
door_opening_speed: double
rising_speed: double
engine_starting_speed: double
flying_speed: double
flying_acceleration: double
fixed_recipe: string
construction_radius: double
logistic_radius: double
energy_per_hit_point: double
create_ghost_on_death: boolean
timeout: uint
fluidbox_prototypes: {LuaFluidBoxPrototype}
neighbour_bonus: double
neighbour_collision_increase: double
container_distance: double
belt_distance: double
belt_length: double
is_building: boolean
automated_ammo_count: uint
max_speed: double
darkness_for_all_lamps_on: float
darkness_for_all_lamps_off: float
always_on: boolean
min_darkness_to_spawn: float
max_darkness_to_spawn: float
call_for_help_radius: double
max_count_of_owned_units: double
max_friends_around_to_spawn: double
spawning_radius: double
spawning_spacing: double
radius: double
cliff_explosive_prototype: string
rocket_entity_prototype: LuaEntityPrototype
has_belt_immunity: boolean
vision_distance: double
pollution_to_join_attack: float
min_pursue_time: uint
max_pursue_distance: double
radar_range: uint
move_while_shooting: boolean
can_open_gates: boolean
affected_by_tiles: boolean
distraction_cooldown: uint
spawning_time_modifier: double
alert_icon_shift: Vector
lab_inputs: {string}
researching_speed: double
item_slot_count: uint
base_productivity: double
allow_access_to_all_forces: boolean
supports_direction: boolean
terrain_friction_modifier: float
allow_passengers: boolean
max_distance_of_sector_revealed: uint
max_distance_of_nearby_sector_revealed: uint
adjacent_tile_collision_box: BoundingBox
adjacent_tile_collision_mask: CollisionMask
adjacent_tile_collision_test: CollisionMask
center_collision_mask: CollisionMask
grid_prototype: LuaEquipmentGridPrototype
remove_decoratives: string
running_speed: double
maximum_corner_sliding_distance: double
build_distance: uint
drop_item_distance: uint
reach_distance: uint
reach_resource_distance: double
item_pickup_distance: double
loot_pickup_distance: double
enter_vehicle_distance: double
ticks_to_keep_gun: uint
ticks_to_keep_aiming_direction: uint
ticks_to_stay_in_combat: uint
respawn_time: uint
damage_hit_tint: Color
character_corpse: LuaEntityPrototype
end
--[[
An item in a [LuaEquipmentGrid](https://lua-api.factorio.com/latest/LuaEquipmentGrid.html) , for example one's power armor.
**Note:** An equipment reference becomes invalid once the equipment is removed or the
equipment grid it resides in is destroyed.
]]--
global record LuaEquipment
name: string
type: string
position: Position
shape: table
shield: double
max_shield: double
max_solar_power: double
movement_bonus: double
generator_power: double
energy: double
max_energy: double
prototype: LuaEquipmentPrototype
burner: LuaBurner
end
--[[
Prototype of a equipment category.
]]--
global record LuaEquipmentCategoryPrototype
name: string
order: string
localised_name: LocalisedString
localised_description: LocalisedString
end
--[[
An equipment grid is for example the inside of a power armor.
]]--
global record LuaEquipmentGrid
take: function(luaEquipmentGridtake_param: LuaEquipmentGridtake_param): SimpleItemStack
take_all: function(by_player: PlayerSpecification): {string: string}
clear: function(by_player: PlayerSpecification)
put: function(luaEquipmentGridput_param: LuaEquipmentGridput_param): LuaEquipment
can_move: function(luaEquipmentGridcan_move_param: LuaEquipmentGridcan_move_param): boolean
move: function(luaEquipmentGridmove_param: LuaEquipmentGridmove_param): boolean
get: function(position: Position): LuaEquipment
get_contents: function(): {string: string}
prototype: LuaEquipmentGridPrototype
width: uint
height: uint
equipment: {LuaEquipment}
generator_energy: double
max_solar_energy: double
available_in_batteries: double
battery_capacity: double
shield: float
max_shield: float
inhibit_movement_bonus: boolean
end