Factorio API Docs

1.1.63 <>

Class LuaEntityPrototype

Prototype of an entity.

has_flag(flag)
boolean

Test whether this entity prototype has a certain flag set.


uint?

Gets the base size of the given inventory on this entity or nil if the given inventory doesn't exist.


help()
string

All methods and properties that this object supports.


:: string
[R]

Type of this prototype.


:: string
[R]

Name of this prototype.




:: float
[R]

Max health of this entity.


:: boolean?
[R]

Whether this resource is infinite.


:: uint?
[R]

Minimum amount of this resource.


:: uint?
[R]

The normal amount for this resource.


:: uint?
[R]

Every time this infinite resource 'ticks' down, it is reduced by this amount.


:: string?
[R]

Name of the category of this resource.


:: table
[R]

Whether this entity is minable and what can be obtained by mining it.


:: array[SimpleItemStack]?
[R]

Items that when placed will produce this entity, if any.


[R]

The bounding box used for collision checking.


[R]

The secondary bounding box used for collision checking, if any.


[R]

The bounding box used for map generator collision checking.


[R]

The bounding box used for drawing selection.


[R]

The bounding box used for drawing the entity icon.


[R]

The bounding box used to attach sticker type entities.


[R]

The collision masks this entity uses



[R]

The hardcoded default collision mask (with flags) for this entity prototype type.


:: string
[R]

The string used to alphabetically sort these prototypes.


[R]

Group of this entity.


[R]

Subgroup of this entity.


:: float?
[R]

Amount this entity can heal per tick, if any.


:: double
[R]

Amount of pollution emissions per second this entity will create.


:: dictionary[stringLuaEntityPrototype]?
[R]

Corpses used when this entity is destroyed.


:: boolean
[R]

Is this entity selectable?


:: uint
[R]

The selection priority of this entity - a value between 0 and 255


:: double?
[R]

The weight of this vehicle prototype.


:: dictionary[stringResistance]?
[R]

List of resistances towards each damage type.


:: string?
[R]

The group of mutually fast-replaceable entities, if any.


[R]

The next upgrade for this entity, if any.


:: array[Loot]?
[R]

Loot that will be dropped when this entity is killed, if any.


:: uint?
[R]

Repair-speed modifier for this entity, if any.


:: uint?
[R]

The range of this turret.


[R]

Autoplace specification for this entity prototype, if any.


:: double?
[R]

The speed of this transport belt.


:: array[UnitSpawnDefinition]?
[R]

The result units and spawn points with weight and evolution factor for a biter spawner entity.


:: array[TriggerItem]?
[R]

The attack result of this entity, if any.


:: array[TriggerItem]?
[R]

The final attack result for this projectile.


[R]

The attack parameters for this entity, if any.


:: table?
[R]

The spawning cooldown for this enemy spawner prototype.


:: double?
[R]

The mining radius of this mining drill prototype.


:: double?
[R]

The mining speed of this mining drill/character prototype.


:: string?
[R]

The logistic mode of this logistic container.


:: uint8?
[R]

The max underground distance for underground belts and underground pipes.


[R]

The flags for this entity prototype.


:: array[LuaEntityPrototype]
[R]

The remains left behind when this entity is mined.


:: array[LuaEntityPrototype]
[R]

Entities this entity can be pasted onto in addition to the normal allowed ones.


:: boolean
[R]

When false copy-paste is not allowed for this entity.


:: double
[R]

The cursor size used when shooting at this entity.


:: table?
[R]

The smoke trigger run when this entity is built, if any.


:: array[TriggerItem]?
[R]

The trigger to run when this entity is created, if any.


:: Color?
[R]

The map color used when charting this entity if a friendly or enemy color isn't defined, if any.


:: Color
[R]

The friendly map color used when charting this entity.


:: Color
[R]

The enemy map color used when charting this entity.


:: double
[R]

The evolution requirement to build this entity as a base when expanding enemy bases.


[R]

The instruments for this programmable speaker.


:: uint?
[R]

The maximum polyphony for this programmable speaker.


:: uint?
[R]

The module inventory size.


:: uint?
[R]

The max number of ingredients this crafting machine prototype supports.


:: double?
[R]

The crafting speed..


:: dictionary[stringboolean]?
[R]

The crafting categories this entity prototype supports.


:: dictionary[stringboolean]?
[R]

The resource categories this character or mining drill supports.


:: double?
[R]

The supply area of this electric pole or beacon prototype.


:: double
[R]

The maximum wire distance for this entity.


:: double
[R]

The maximum circuit wire distance for this entity.


:: double?
[R]

The direct energy usage of this entity, if any.


:: double
[R]

The theoretical maximum energy usage for this entity.


:: double
[R]

The theoretical maximum energy production for this this entity.


:: double?
[R]

The effectivity of this car prototype, generator prototype.


:: double?
[R]

The energy consumption of this car prototype.


:: double?
[R]

The friction of this vehicle prototype.


:: double?
[R]

The braking force of this vehicle prototype.


:: double?
[R]

The air resistance of this rolling stock prototype.


:: boolean?
[R]

If this car prototype uses tank controls to drive.


:: double?
[R]

The rotation speed of this car prototype.


:: double?
[R]

The turret rotation speed of this car prototype.


:: dictionary[stringLuaItemPrototype]?
[R]

A mapping of the gun name to the gun prototype this prototype uses.


:: array[LuaItemPrototype]?
[R]

A vector of the gun prototypes of this car, spider vehicule, or artillery wagon or turret.


:: double?
[R]

The default speed of this flying robot, rolling stock or unit.


:: float?
[R]

The speed multiplier when this flying robot is out of energy.


:: uint?
[R]

The max payload size of this logistics or construction robot.


:: boolean?
[R]

Whether this logistics or construction robot renders its cargo when flying.


:: double?
[R]

The energy consumed per tile moved for this flying robot.


:: double?
[R]

The energy consumed per tick for this flying robot.


:: double?
[R]

The max energy for this flying robot.


:: float?
[R]

The minimum energy for this flying robot before it tries to recharge.


:: float?
[R]

The maximum energy for this flying robot above which it won't try to recharge when stationing.


[R]

The burner energy source prototype this entity uses, if any.


[R]

The electric energy source prototype this entity uses, if any.


[R]

The heat energy source prototype this entity uses, if any.


[R]

The fluid energy source prototype this entity uses, if any.


[R]

The void energy source prototype this entity uses, if any.


[R]

The heat buffer prototype this entity uses, if any.


:: uint
[R]

The log2 of grid size of the building


:: double?
[R]

The fluid usage of this generator prototype.


:: double?
[R]

The maximum fluid temperature of this generator prototype.


:: boolean?
[R]

Whether this generator prototype burns fluid.


:: boolean?
[R]

Whether this generator prototype scales fluid usage.


:: boolean?
[R]

Whether this generator prototype destroys non-fuel fluids.


:: double?
[R]

The default maximum power output of this generator prototype.


:: double?
[R]

The target temperature of this boiler prototype.


[R]

The fluid this offshore pump produces.


:: double
[R]

The fluid capacity of this entity or 0 if this entity doesn't support fluids.


:: double?
[R]

The pumping speed of this offshore or normal pump.


:: boolean?
[R]

Whether this inserter is a stack-type.


:: boolean?
[R]

Whether this inserter allows custom pickup and drop vectors.


:: boolean?
[R]

Whether this inserter allows burner leeching.


:: double?
[R]

The extension speed of this inserter.


:: double?
[R]

The rotation speed of this inserter.


:: Vector?
[R]

The pickup position for this inserter.


:: Vector?
[R]

The drop position for this inserter.


:: boolean?
[R]

True if this inserter chases items on belts for pickup.


:: boolean?
[R]

If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.


:: uint?
[R]

The filter count of this inserter, loader, or logistic chest.


:: uint
[R]

The time to live for this prototype or 0 if prototype doesn't have time_to_live or time_before_removed.


:: double?
[R]

The distribution effectivity for this beacon prototype.


:: double?
[R]

Whether this explosion has a beam.


:: double?
[R]

Whether this explosion rotates.


:: uint8?
[R]

If it is a tree, return the number of colors it supports.


:: boolean?
[R]

Whether this entity raises an alert when damaged.


:: boolean?
[R]

Whether this turret raises an alert when attacking


:: Color?
[R]

The color of the prototype, if any.


:: boolean
[R]

Does this prototype collision mask collide with itself?


:: boolean
[R]

Does this prototype collision mask collide with tiles only?


:: boolean
[R]

Does this prototype collision mask consider tile transitions?


:: dictionary[stringboolean]?
[R]

The allowed module effects for this entity, if any.


:: uint?
[R]

The rocket parts required for this rocket silo prototype.


:: uint8?
[R]

The rocket rising delay for this rocket silo prototype.


:: uint8?
[R]

The rocket launch delay for this rocket silo prototype.


:: double?
[R]

The light blinking speed for this rocket silo prototype.


:: double?
[R]

The door opening speed for this rocket silo prototype.


:: double?
[R]

The rising speed for this rocket silo rocket prototype.


:: double?
[R]

The engine starting speed for this rocket silo rocket prototype.


:: double?
[R]

The flying speed for this rocket silo rocket prototype.


:: double?
[R]

The flying acceleration for this rocket silo rocket prototype.


:: string?
[R]

The fixed recipe name for this assembling machine prototype, if any.


:: double?
[R]

The construction radius for this roboport prototype.


:: double?
[R]

The logistic radius for this roboport prototype.


:: double?
[R]

The energy used per hitpoint taken for this vehicle during collisions.


:: boolean
[R]

If this prototype will attempt to create a ghost of itself on death.


:: uint?
[R]

The time it takes this land mine to arm.


[R]

The collision mask entities must collide with to make this landmine blow up.


[R]

The fluidbox prototypes for this entity.







:: uint?
[R]

The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret.


:: double?
[R]

The max speed of this projectile or flying robot prototype.


:: float?
[R]

Value between 0 and 1 darkness where all lamps of this lamp prototype are on.


:: float?
[R]

Value between 0 and 1 darkness where all lamps of this lamp prototype are off.


:: boolean?
[R]

Whether the lamp is always on (except when out of power or turned off by the circuit network).


:: float?
[R]

The minimum darkness at which this unit spawner can spawn entities.


:: float?
[R]

The maximum darkness at which this unit spawner can spawn entities.



:: double?
[R]

Count of enemies this spawner can sustain.


:: double?
[R]

How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.


:: double?
[R]

How far from the spawner can the units be spawned.


:: double?
[R]

What spaces should be between the spawned units.


:: double
[R]

The radius of this entity prototype.


:: string?
[R]

The item prototype name used to destroy this cliff.


[R]

The rocket entity prototype associated with this rocket silo prototype.


:: boolean?
[R]

Whether this unit, car, or character prototype has belt immunity.


:: double?
[R]

The vision distance of this unit prototype.


:: float?
[R]

The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.


:: uint?
[R]

The minimum pursue time of this unit prototype.


:: double?
[R]

The maximum pursue distance of this unit prototype.


:: uint?
[R]

The radar range of this unit prototype.


:: boolean?
[R]

Whether this unit prototype can move while shooting.


:: boolean?
[R]

Whether this unit prototype can open gates.


:: boolean?
[R]

Whether this unit prototype is affected by tile walking speed modifiers.


:: uint?
[R]

The distraction cooldown of this unit prototype.


:: double?
[R]

The spawning time modifier of this unit prototype.


:: Vector
[R]

The alert icon shift of this entity prototype.


:: array[string]?
[R]

The item prototype names that are the inputs of this lab prototype.


:: double?
[R]

The base researching speed of this lab prototype.


:: uint?
[R]

The item slot count of this constant combinator prototype.


:: double?
[R]

The base productivity of this crafting machine, lab, or mining drill.


:: boolean?
[R]

Whether this market allows access to all forces or just friendly ones.


:: boolean
[R]

Whether this entity prototype could possibly ever be rotated.


:: float?
[R]

The terrain friction modifier for this vehicle.


:: boolean?
[R]

Whether this vehicle allows passengers.


:: uint?
[R]

The radius of the area this radar can chart, in chunks.


:: uint?
[R]

The radius of the area constantly revealed by this radar, in chunks.


[R]

The bounding box that specifies which tiles adjacent to the offshore pump should be checked.


[R]

Tiles adjacent to the offshore pump must not collide with this collision mask.


[R]

If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.


[R]

The collision mask used only for collision test with tile directly at offshore pump position.


[R]

The equipment grid prototype for this entity, if any.




:: double?
[R]

The built-in stack size bonus of this inserter prototype.


:: boolean
[R]

True if this entity prototype should be included during tile collision checks with LuaTilePrototype::check_collision_with_entities enabled.


:: boolean
[R]

True if this is entity-with-owner


:: boolean?
[R]

True if this entity-with-owner is military target


:: boolean?
[R]

True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)


:: table?
[R]

The logistic parameters for this roboport.


:: double?
[R]

The height of this spider vehicle prototype.


:: double?
[R]

The torso rotation speed of this spider vehicle prototype.


:: boolean?
[R]

Whether this spider vehicle prototoype automatically cycles weapons.


:: double?
[R]

The chain shooting cooldown modifier of this spider vehicle prototype.


:: double?
[R]

The chunk exploration radius of this spider vehicle prototype.


:: double?
[R]

The animation speed coefficient of this belt connectable prototype.


:: double?
[R]

The manual range modifier for this artillery turret or wagon prototype.


:: float?
[R]

The dying time of this corpse prototype.


:: double?
[R]

The active energy usage of this rocket silo or combinator prototype.


:: double?
[R]

The idle energy usage of this rocket silo prototype.


:: double?
[R]

The lamp energy usage of this rocket silo prototype.


:: boolean?
[R]

Whether this logistic container prototype uses exact mode


:: double?
[R]

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.













:: uint?
[R]



:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Methods

has_flag(flag) → boolean

Test whether this entity prototype has a certain flag set.

Parameters

flag
:: string

The flag to test. See EntityPrototypeFlags for a list of flags.

Return values

:: boolean

true if this prototype has the given flag set.


get_inventory_size(index) → uint?

Gets the base size of the given inventory on this entity or nil if the given inventory doesn't exist.

Parameters


help() → string

All methods and properties that this object supports.

Attributes

type :: string [Read]

Type of this prototype.


name :: string [Read]

Name of this prototype.


localised_name :: LocalisedString [Read]


localised_description :: LocalisedString [Read]


max_health :: float [Read]

Max health of this entity. Will be 0 if this is not an entity with health.


infinite_resource :: boolean? [Read]

Whether this resource is infinite.

Can only be used if this is ResourceEntity

minimum_resource_amount :: uint? [Read]

Minimum amount of this resource.

Can only be used if this is ResourceEntity

normal_resource_amount :: uint? [Read]

The normal amount for this resource.

Can only be used if this is ResourceEntity

infinite_depletion_resource_amount :: uint? [Read]

Every time this infinite resource 'ticks' down, it is reduced by this amount. Meaningless if this isn't an infinite resource.

Can only be used if this is ResourceEntity

resource_category :: string? [Read]

Name of the category of this resource.

Note

During data stage, this property is named "category".

Can only be used if this is ResourceEntity

mineable_properties :: table [Read]

Whether this entity is minable and what can be obtained by mining it.

Table fields

minable
:: boolean

Is this entity mineable at all?


mining_time
:: double

Energy required to mine an entity.


mining_particle
:: string?

Prototype name of the particle produced when mining this entity. Will only be present if this entity produces any particle during mining.


products
:: array[Product]?

Products obtained by mining this entity.


fluid_amount
:: double?

The required fluid amount if any.


required_fluid
:: string?

The prototype name of the required fluid if any.


mining_trigger
:: array[TriggerItem]?

The mining trigger if any.


items_to_place_this :: array[SimpleItemStack]? [Read]

Items that when placed will produce this entity, if any. Construction bots will always choose the first item in this list to build this entity.


collision_box :: BoundingBox [Read]

The bounding box used for collision checking.


secondary_collision_box :: BoundingBox? [Read]

The secondary bounding box used for collision checking, if any. This is only used in rails and rail remnants.


map_generator_bounding_box :: BoundingBox [Read]

The bounding box used for map generator collision checking.


selection_box :: BoundingBox [Read]

The bounding box used for drawing selection.


drawing_box :: BoundingBox [Read]

The bounding box used for drawing the entity icon.


sticker_box :: BoundingBox [Read]

The bounding box used to attach sticker type entities.


collision_mask :: CollisionMask [Read]

The collision masks this entity uses


collision_mask_with_flags :: CollisionMaskWithFlags [Read]


default_collision_mask_with_flags :: CollisionMaskWithFlags [Read]

The hardcoded default collision mask (with flags) for this entity prototype type.


order :: string [Read]

The string used to alphabetically sort these prototypes. It is a simple string that has no additional semantic meaning.


group :: LuaGroup [Read]

Group of this entity.


subgroup :: LuaGroup [Read]

Subgroup of this entity.


healing_per_tick :: float? [Read]

Amount this entity can heal per tick, if any.


emissions_per_second :: double [Read]

Amount of pollution emissions per second this entity will create.


corpses :: dictionary[stringLuaEntityPrototype]? [Read]

Corpses used when this entity is destroyed. It is a dictionary indexed by the corpse's prototype name.

Can only be used if this is EntityWithHealth

selectable_in_game :: boolean [Read]

Is this entity selectable?


selection_priority :: uint [Read]

The selection priority of this entity - a value between 0 and 255


weight :: double? [Read]

The weight of this vehicle prototype.

Can only be used if this is Vehicle

resistances :: dictionary[stringResistance]? [Read]

List of resistances towards each damage type. It is a dictionary indexed by damage type names (see data/base/prototypes/damage-type.lua).

Can only be used if this is EntityWithHealth

fast_replaceable_group :: string? [Read]

The group of mutually fast-replaceable entities, if any.


next_upgrade :: LuaEntityPrototype? [Read]

The next upgrade for this entity, if any.


loot :: array[Loot]? [Read]

Loot that will be dropped when this entity is killed, if any.

Can only be used if this is EntityWithHealth

repair_speed_modifier :: uint? [Read]

Repair-speed modifier for this entity, if any. Actual repair speed will be tool_repair_speed * entity_repair_speed_modifier.

Can only be used if this is EntityWithHealth

turret_range :: uint? [Read]

The range of this turret.

Can only be used if this is Turret

autoplace_specification :: AutoplaceSpecification? [Read]

Autoplace specification for this entity prototype, if any.


belt_speed :: double? [Read]

The speed of this transport belt.

Can only be used if this is TransportBeltConnectable

result_units :: array[UnitSpawnDefinition]? [Read]

The result units and spawn points with weight and evolution factor for a biter spawner entity.

Can only be used if this is Spawner

attack_result :: array[TriggerItem]? [Read]

The attack result of this entity, if any.


final_attack_result :: array[TriggerItem]? [Read]

The final attack result for this projectile.

Can only be used if this is Projectile

attack_parameters :: AttackParameters? [Read]

The attack parameters for this entity, if any.


spawn_cooldown :: table? [Read]

The spawning cooldown for this enemy spawner prototype.

Table fields

min
:: double

max
:: double
Can only be used if this is Spawner

mining_drill_radius :: double? [Read]

The mining radius of this mining drill prototype.

Can only be used if this is MiningDrill

mining_speed :: double? [Read]

The mining speed of this mining drill/character prototype.

Can only be used if this is MiningDrill or Character

logistic_mode :: string? [Read]

The logistic mode of this logistic container. One of "requester", "active-provider", "passive-provider", "buffer", "storage", "none".

Can only be used if this is LogisticContainer

max_underground_distance :: uint8? [Read]

The max underground distance for underground belts and underground pipes.

Can only be used if this is UndergroundBelt or PipeToGround

flags :: EntityPrototypeFlags [Read]

The flags for this entity prototype.


remains_when_mined :: array[LuaEntityPrototype] [Read]

The remains left behind when this entity is mined.


additional_pastable_entities :: array[LuaEntityPrototype] [Read]

Entities this entity can be pasted onto in addition to the normal allowed ones.


allow_copy_paste :: boolean [Read]

When false copy-paste is not allowed for this entity.


shooting_cursor_size :: double [Read]

The cursor size used when shooting at this entity.


created_smoke :: table? [Read]

The smoke trigger run when this entity is built, if any.

Table fields

smoke_name
:: string

offsets
:: array[Vector]

offset_deviation

initial_height
:: float

max_radius
:: float?

speed
:: Vector

speed_multiplier
:: float

speed_multiplier_deviation
:: float

starting_frame
:: float

starting_frame_deviation
:: float

starting_frame_speed
:: float

starting_frame_speed_deviation
:: float

speed_from_center
:: float

speed_from_center_deviation
:: float

created_effect :: array[TriggerItem]? [Read]

The trigger to run when this entity is created, if any.


map_color :: Color? [Read]

The map color used when charting this entity if a friendly or enemy color isn't defined, if any.


friendly_map_color :: Color [Read]

The friendly map color used when charting this entity.


enemy_map_color :: Color [Read]

The enemy map color used when charting this entity.


build_base_evolution_requirement :: double [Read]

The evolution requirement to build this entity as a base when expanding enemy bases.


instruments :: array[ProgrammableSpeakerInstrument]? [Read]

The instruments for this programmable speaker.

Can only be used if this is ProgrammableSpeaker

max_polyphony :: uint? [Read]

The maximum polyphony for this programmable speaker.

Can only be used if this is ProgrammableSpeaker

module_inventory_size :: uint? [Read]

The module inventory size. nil if this entity doesn't support modules.


ingredient_count :: uint? [Read]

The max number of ingredients this crafting machine prototype supports.

Can only be used if this is CraftingMachine

crafting_speed :: double? [Read]

The crafting speed..

Can only be used if this is CraftingMachine

crafting_categories :: dictionary[stringboolean]? [Read]

The crafting categories this entity prototype supports.

Note

The value in the dictionary is meaningless and exists just to allow for easy lookup.

Can only be used if this is CraftingMachine Character

resource_categories :: dictionary[stringboolean]? [Read]

The resource categories this character or mining drill supports.

Note

The value in the dictionary is meaningless and exists just to allow for easy lookup.

Can only be used if this is MiningDrill or Character

supply_area_distance :: double? [Read]

The supply area of this electric pole or beacon prototype.

Can only be used if this is ElectricPole or Beacon

max_wire_distance :: double [Read]

The maximum wire distance for this entity. 0 if the entity doesn't support wires.


max_circuit_wire_distance :: double [Read]

The maximum circuit wire distance for this entity. 0 if the entity doesn't support circuit wires.


energy_usage :: double? [Read]

The direct energy usage of this entity, if any.


max_energy_usage :: double [Read]

The theoretical maximum energy usage for this entity.


max_energy_production :: double [Read]

The theoretical maximum energy production for this this entity.


effectivity :: double? [Read]

The effectivity of this car prototype, generator prototype.

Can only be used if this is Car or Generator

consumption :: double? [Read]

The energy consumption of this car prototype.

Can only be used if this is Car

friction_force :: double? [Read]

The friction of this vehicle prototype.

Can only be used if this is Vehicle

braking_force :: double? [Read]

The braking force of this vehicle prototype.

Can only be used if this is Vehicle

air_resistance :: double? [Read]

The air resistance of this rolling stock prototype.

Can only be used if this is RollingStock

tank_driving :: boolean? [Read]

If this car prototype uses tank controls to drive.

Can only be used if this is Car

rotation_speed :: double? [Read]

The rotation speed of this car prototype.

Can only be used if this is Car

turret_rotation_speed :: double? [Read]

The turret rotation speed of this car prototype.

Can only be used if this is Car

guns :: dictionary[stringLuaItemPrototype]? [Read]

A mapping of the gun name to the gun prototype this prototype uses. nil if this entity prototype doesn't use guns.


indexed_guns :: array[LuaItemPrototype]? [Read]

A vector of the gun prototypes of this car, spider vehicule, or artillery wagon or turret.

Can only be used if this is Car or SpiderVehicle or ArtilleryTurret or ArtilleryWagon

speed :: double? [Read]

The default speed of this flying robot, rolling stock or unit. For rolling stocks, this is their max_speed.

Can only be used if this is FlyingRobot or RollingStock or Unit

speed_multiplier_when_out_of_energy :: float? [Read]

The speed multiplier when this flying robot is out of energy.

Can only be used if this is FlyingRobot

max_payload_size :: uint? [Read]

The max payload size of this logistics or construction robot.

Can only be used if this is RobotWithLogisticsInterface

draw_cargo :: boolean? [Read]

Whether this logistics or construction robot renders its cargo when flying.

Can only be used if this is RobotWithLogisticsInterface

energy_per_move :: double? [Read]

The energy consumed per tile moved for this flying robot.

Can only be used if this is FlyingRobot

energy_per_tick :: double? [Read]

The energy consumed per tick for this flying robot.

Can only be used if this is FlyingRobot

max_energy :: double? [Read]

The max energy for this flying robot.

Can only be used if this is FlyingRobot

min_to_charge :: float? [Read]

The minimum energy for this flying robot before it tries to recharge.

Can only be used if this is FlyingRobot

max_to_charge :: float? [Read]

The maximum energy for this flying robot above which it won't try to recharge when stationing.

Can only be used if this is FlyingRobot

burner_prototype :: LuaBurnerPrototype? [Read]

The burner energy source prototype this entity uses, if any.


electric_energy_source_prototype :: LuaElectricEnergySourcePrototype? [Read]

The electric energy source prototype this entity uses, if any.


heat_energy_source_prototype :: LuaHeatEnergySourcePrototype? [Read]

The heat energy source prototype this entity uses, if any.


fluid_energy_source_prototype :: LuaFluidEnergySourcePrototype? [Read]

The fluid energy source prototype this entity uses, if any.


void_energy_source_prototype :: LuaVoidEnergySourcePrototype? [Read]

The void energy source prototype this entity uses, if any.


heat_buffer_prototype :: LuaHeatBufferPrototype? [Read]

The heat buffer prototype this entity uses, if any.


building_grid_bit_shift :: uint [Read]

The log2 of grid size of the building


fluid_usage_per_tick :: double? [Read]

The fluid usage of this generator prototype.

Can only be used if this is Generator

maximum_temperature :: double? [Read]

The maximum fluid temperature of this generator prototype.

Can only be used if this is Generator

burns_fluid :: boolean? [Read]

Whether this generator prototype burns fluid.

Can only be used if this is Generator

scale_fluid_usage :: boolean? [Read]

Whether this generator prototype scales fluid usage.

Can only be used if this is Generator

destroy_non_fuel_fluid :: boolean? [Read]

Whether this generator prototype destroys non-fuel fluids.

Can only be used if this is Generator

max_power_output :: double? [Read]

The default maximum power output of this generator prototype.

Can only be used if this is Generator

target_temperature :: double? [Read]

The target temperature of this boiler prototype.

Can only be used if this is Boiler

fluid :: LuaFluidPrototype? [Read]

The fluid this offshore pump produces.

Can only be used if this is OffshorePump

fluid_capacity :: double [Read]

The fluid capacity of this entity or 0 if this entity doesn't support fluids.

Note

Crafting machines will report 0 due to their fluid capacity being what ever a given recipe needs.


pumping_speed :: double? [Read]

The pumping speed of this offshore or normal pump.

Can only be used if this is OffshorePump or Pump

stack :: boolean? [Read]

Whether this inserter is a stack-type.

Can only be used if this is Inserter

allow_custom_vectors :: boolean? [Read]

Whether this inserter allows custom pickup and drop vectors.

Can only be used if this is Inserter

allow_burner_leech :: boolean? [Read]

Whether this inserter allows burner leeching.

Can only be used if this is Inserter

inserter_extension_speed :: double? [Read]

The extension speed of this inserter.

Can only be used if this is Inserter

inserter_rotation_speed :: double? [Read]

The rotation speed of this inserter.

Can only be used if this is Inserter

inserter_pickup_position :: Vector? [Read]

The pickup position for this inserter.

Can only be used if this is Inserter

inserter_drop_position :: Vector? [Read]

The drop position for this inserter.

Can only be used if this is Inserter

inserter_chases_belt_items :: boolean? [Read]

True if this inserter chases items on belts for pickup.

Can only be used if this is Inserter

count_as_rock_for_filtered_deconstruction :: boolean? [Read]

If this simple-entity is counted as a rock for the deconstruction planner "trees and rocks only" filter.

Can only be used if this is SimpleEntity

filter_count :: uint? [Read]

The filter count of this inserter, loader, or logistic chest. For logistic containers, nil means no limit.

Can only be used if this is Inserter or Loader or LogisticContainer

time_to_live :: uint [Read]

The time to live for this prototype or 0 if prototype doesn't have time_to_live or time_before_removed.


distribution_effectivity :: double? [Read]

The distribution effectivity for this beacon prototype.

Can only be used if this is Beacon

explosion_beam :: double? [Read]

Whether this explosion has a beam.

Can only be used if this is Explosion

explosion_rotate :: double? [Read]

Whether this explosion rotates.

Can only be used if this is Explosion

tree_color_count :: uint8? [Read]

If it is a tree, return the number of colors it supports.

Can only be used if this is Tree

alert_when_damaged :: boolean? [Read]

Whether this entity raises an alert when damaged.

Can only be used if this is EntityWithHealth

alert_when_attacking :: boolean? [Read]

Whether this turret raises an alert when attacking

Can only be used if this is Turret

color :: Color? [Read]

The color of the prototype, if any.


collision_mask_collides_with_self :: boolean [Read]

Does this prototype collision mask collide with itself?


collision_mask_collides_with_tiles_only :: boolean [Read]

Does this prototype collision mask collide with tiles only?


collision_mask_considers_tile_transitions :: boolean [Read]

Does this prototype collision mask consider tile transitions?


allowed_effects :: dictionary[stringboolean]? [Read]

The allowed module effects for this entity, if any.


rocket_parts_required :: uint? [Read]

The rocket parts required for this rocket silo prototype.

Can only be used if this is RocketSilo

rocket_rising_delay :: uint8? [Read]

The rocket rising delay for this rocket silo prototype.

Can only be used if this is RocketSilo

launch_wait_time :: uint8? [Read]

The rocket launch delay for this rocket silo prototype.

Can only be used if this is RocketSilo

light_blinking_speed :: double? [Read]

The light blinking speed for this rocket silo prototype.

Can only be used if this is RocketSilo

door_opening_speed :: double? [Read]

The door opening speed for this rocket silo prototype.

Can only be used if this is RocketSilo

rising_speed :: double? [Read]

The rising speed for this rocket silo rocket prototype.

Can only be used if this is RocketSiloRocket

engine_starting_speed :: double? [Read]

The engine starting speed for this rocket silo rocket prototype.

Can only be used if this is RocketSiloRocket

flying_speed :: double? [Read]

The flying speed for this rocket silo rocket prototype.

Can only be used if this is RocketSiloRocket

flying_acceleration :: double? [Read]

The flying acceleration for this rocket silo rocket prototype.

Can only be used if this is RocketSiloRocket

fixed_recipe :: string? [Read]

The fixed recipe name for this assembling machine prototype, if any.

Can only be used if this is AssemblingMachine

construction_radius :: double? [Read]

The construction radius for this roboport prototype.

Can only be used if this is Roboport

logistic_radius :: double? [Read]

The logistic radius for this roboport prototype.

Can only be used if this is Roboport

energy_per_hit_point :: double? [Read]

The energy used per hitpoint taken for this vehicle during collisions.

Can only be used if this is Vehicle

create_ghost_on_death :: boolean [Read]

If this prototype will attempt to create a ghost of itself on death.

Note

If this is false then a ghost will never be made, if it's true a ghost may be made.


timeout :: uint? [Read]

The time it takes this land mine to arm.

Can only be used if this is LandMine

trigger_collision_mask :: CollisionMaskWithFlags? [Read]

The collision mask entities must collide with to make this landmine blow up.

Can only be used if this is LandMine

fluidbox_prototypes :: array[LuaFluidBoxPrototype] [Read]

The fluidbox prototypes for this entity.


neighbour_bonus :: double? [Read]

Can only be used if this is Reactor

container_distance :: double? [Read]

Can only be used if this is Loader

belt_distance :: double? [Read]

Can only be used if this is Loader

belt_length :: double? [Read]

Can only be used if this is Loader

is_building :: boolean [Read]


automated_ammo_count :: uint? [Read]

The amount of ammo that inserters automatically insert into this ammo-turret or artillery-turret.

Can only be used if this is ArtilleryTurret or AmmoTurret

max_speed :: double? [Read]

The max speed of this projectile or flying robot prototype.

Can only be used if this is Projectile or FlyingRobot

darkness_for_all_lamps_on :: float? [Read]

Value between 0 and 1 darkness where all lamps of this lamp prototype are on.

Can only be used if this is Lamp

darkness_for_all_lamps_off :: float? [Read]

Value between 0 and 1 darkness where all lamps of this lamp prototype are off.

Can only be used if this is Lamp

always_on :: boolean? [Read]

Whether the lamp is always on (except when out of power or turned off by the circuit network).

Can only be used if this is Lamp

min_darkness_to_spawn :: float? [Read]

The minimum darkness at which this unit spawner can spawn entities.

Can only be used if this is Spawner

max_darkness_to_spawn :: float? [Read]

The maximum darkness at which this unit spawner can spawn entities.

Can only be used if this is Spawner

call_for_help_radius :: double? [Read]

Can only be used if this is Spawner

max_count_of_owned_units :: double? [Read]

Count of enemies this spawner can sustain.

Can only be used if this is Spawner

max_friends_around_to_spawn :: double? [Read]

How many friendly units are required within the spawning_radius of this spawner for it to stop producing more units.

Can only be used if this is Spawner

spawning_radius :: double? [Read]

How far from the spawner can the units be spawned.

Can only be used if this is Spawner

spawning_spacing :: double? [Read]

What spaces should be between the spawned units.

Can only be used if this is Spawner

radius :: double [Read]

The radius of this entity prototype.


cliff_explosive_prototype :: string? [Read]

The item prototype name used to destroy this cliff.

Can only be used if this is Cliff

rocket_entity_prototype :: LuaEntityPrototype? [Read]

The rocket entity prototype associated with this rocket silo prototype.

Can only be used if this is RocketSilo

has_belt_immunity :: boolean? [Read]

Whether this unit, car, or character prototype has belt immunity.

Can only be used if this is Unit or Car or Character

vision_distance :: double? [Read]

The vision distance of this unit prototype.

Can only be used if this is Unit

pollution_to_join_attack :: float? [Read]

The amount of pollution that has to be absorbed by the unit's spawner before the unit will leave the spawner and attack the source of the pollution.

Can only be used if this is Unit

min_pursue_time :: uint? [Read]

The minimum pursue time of this unit prototype.

Can only be used if this is Unit

max_pursue_distance :: double? [Read]

The maximum pursue distance of this unit prototype.

Can only be used if this is Unit

radar_range :: uint? [Read]

The radar range of this unit prototype.

Can only be used if this is Unit

move_while_shooting :: boolean? [Read]

Whether this unit prototype can move while shooting.

Can only be used if this is Unit

can_open_gates :: boolean? [Read]

Whether this unit prototype can open gates.

Can only be used if this is Unit

affected_by_tiles :: boolean? [Read]

Whether this unit prototype is affected by tile walking speed modifiers.

Can only be used if this is Unit

distraction_cooldown :: uint? [Read]

The distraction cooldown of this unit prototype.

Can only be used if this is Unit

spawning_time_modifier :: double? [Read]

The spawning time modifier of this unit prototype.

Can only be used if this is Unit

alert_icon_shift :: Vector [Read]

The alert icon shift of this entity prototype.


lab_inputs :: array[string]? [Read]

The item prototype names that are the inputs of this lab prototype.

Can only be used if this is Lab

researching_speed :: double? [Read]

The base researching speed of this lab prototype.

Can only be used if this is Lab

item_slot_count :: uint? [Read]

The item slot count of this constant combinator prototype.

Can only be used if this is ConstantCombinator

base_productivity :: double? [Read]

The base productivity of this crafting machine, lab, or mining drill.

Can only be used if this is CraftingMachine or Lab or MiningDrill

allow_access_to_all_forces :: boolean? [Read]

Whether this market allows access to all forces or just friendly ones.

Can only be used if this is Market

supports_direction :: boolean [Read]

Whether this entity prototype could possibly ever be rotated.


terrain_friction_modifier :: float? [Read]

The terrain friction modifier for this vehicle.

Can only be used if this is Vehicle

allow_passengers :: boolean? [Read]

Whether this vehicle allows passengers.

Can only be used if this is Vehicle

max_distance_of_sector_revealed :: uint? [Read]

The radius of the area this radar can chart, in chunks.

Can only be used if this is Radar

max_distance_of_nearby_sector_revealed :: uint? [Read]

The radius of the area constantly revealed by this radar, in chunks.

Can only be used if this is Radar

adjacent_tile_collision_box :: BoundingBox? [Read]

The bounding box that specifies which tiles adjacent to the offshore pump should be checked.

Can only be used if this is OffshorePump

adjacent_tile_collision_mask :: CollisionMask? [Read]

Tiles adjacent to the offshore pump must not collide with this collision mask.

Can only be used if this is OffshorePump

adjacent_tile_collision_test :: CollisionMask? [Read]

If this mask is not empty, tiles adjacent to the offshore pump must not collide with this collision mask.

Can only be used if this is OffshorePump

center_collision_mask :: CollisionMask? [Read]

The collision mask used only for collision test with tile directly at offshore pump position.

Can only be used if this is OffshorePump

grid_prototype :: LuaEquipmentGridPrototype? [Read]

The equipment grid prototype for this entity, if any.


remove_decoratives :: string [Read]


related_underground_belt :: LuaEntityPrototype? [Read]

Can only be used if this is TransportBelt

inserter_stack_size_bonus :: double? [Read]

The built-in stack size bonus of this inserter prototype.

Can only be used if this is Inserter

protected_from_tile_building :: boolean [Read]

True if this entity prototype should be included during tile collision checks with LuaTilePrototype::check_collision_with_entities enabled.


is_entity_with_owner :: boolean [Read]

True if this is entity-with-owner


is_military_target :: boolean? [Read]

True if this entity-with-owner is military target

Can only be used if this is EntityWithOwner

allow_run_time_change_of_is_military_target :: boolean? [Read]

True if this entity-with-owner's is_military_target can be changed run-time (on the entity, not on the prototype itself)

Can only be used if this is EntityWithOwner

logistic_parameters :: table? [Read]

The logistic parameters for this roboport.

Table fields

spawn_and_station_height
:: float

spawn_and_station_shadow_height_offset
:: float

charge_approach_distance
:: float

logistic_radius
:: float

construction_radius
:: float

charging_station_count
:: uint

charging_distance
:: float

charging_station_shift
:: Vector

charging_energy
:: double

charging_threshold_distance
:: float

robot_vertical_acceleration
:: float

stationing_offset
:: Vector

robot_limit
:: uint

logistics_connection_distance
:: float

robots_shrink_when_entering_and_exiting
:: boolean

Note

Both the charging_station_shift and stationing_offset vectors are tables with x and y keys instead of an array.

Can only be used if this is Roboport

height :: double? [Read]

The height of this spider vehicle prototype.

Can only be used if this is SpiderVehicle

torso_rotation_speed :: double? [Read]

The torso rotation speed of this spider vehicle prototype.

Can only be used if this is SpiderVehicle

automatic_weapon_cycling :: boolean? [Read]

Whether this spider vehicle prototoype automatically cycles weapons.

Can only be used if this is SpiderVehicle

chain_shooting_cooldown_modifier :: double? [Read]

The chain shooting cooldown modifier of this spider vehicle prototype.

Can only be used if this is SpiderVehicle

chunk_exploration_radius :: double? [Read]

The chunk exploration radius of this spider vehicle prototype.

Can only be used if this is SpiderVehicle

animation_speed_coefficient :: double? [Read]

The animation speed coefficient of this belt connectable prototype.

Can only be used if this is BeltConnectable

manual_range_modifier :: double? [Read]

The manual range modifier for this artillery turret or wagon prototype.

subclass(ArtilleryWagon, ArtilleryTurret)


dying_speed :: float? [Read]

The dying time of this corpse prototype.

Can only be used if this is Corpse

active_energy_usage :: double? [Read]

The active energy usage of this rocket silo or combinator prototype.

Can only be used if this is RocketSilo or Combinator

idle_energy_usage :: double? [Read]

The idle energy usage of this rocket silo prototype.

Can only be used if this is RocketSilo

lamp_energy_usage :: double? [Read]

The lamp energy usage of this rocket silo prototype.

Can only be used if this is RocketSilo

use_exact_mode :: boolean? [Read]

Whether this logistic container prototype uses exact mode

Can only be used if this is LogisticContainer

running_speed :: double? [Read]

The current movement speed of this character, including effects from exoskeletons, tiles, stickers and shooting.

Can only be used if this is Character

maximum_corner_sliding_distance :: double? [Read]

Can only be used if this is Character

build_distance :: uint? [Read]

Can only be used if this is Character

drop_item_distance :: uint? [Read]

Can only be used if this is Character

reach_distance :: uint? [Read]

Can only be used if this is Character

reach_resource_distance :: double? [Read]

Can only be used if this is Character

item_pickup_distance :: double? [Read]

Can only be used if this is Character

loot_pickup_distance :: double? [Read]

Can only be used if this is Character

enter_vehicle_distance :: double? [Read]

Can only be used if this is Character

ticks_to_keep_gun :: uint? [Read]

Can only be used if this is Character

ticks_to_keep_aiming_direction :: uint? [Read]

Can only be used if this is Character

ticks_to_stay_in_combat :: uint? [Read]

Can only be used if this is Character

respawn_time :: uint? [Read]

Can only be used if this is Character

damage_hit_tint :: Color? [Read]

Can only be used if this is Character

character_corpse :: LuaEntityPrototype? [Read]

Can only be used if this is Character

valid :: boolean [Read]

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.


object_name :: string [Read]

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.

|<

Classes

Events

Concepts

Defines

Builtin types

>|