LuaEntityPrototype

class LuaEntityPrototype
has_flag(flag) → boolean Does this prototype have a flag enabled?
type :: string [R] Type of this prototype.
name :: string [R] Name of this prototype.
localised_name :: LocalisedString [R]
max_health :: float [R] Max health of this entity.
infinite_resource :: boolean [R] Is this resource infinite?
minimum_resource_amount :: uint [R] Minimum amount of this resource.
resource_category :: string [R] Category of this resource.
mineable_properties [R]
items_to_place_this :: dictionary stringLuaItemPrototype [R] Items that when placed will produce this entity.
collision_box :: BoundingBox [R] The bounding box used for collision checking.
selection_box :: BoundingBox [R] The bounding box used for drawing selection.
order :: string [R] Order string of this prototype.
group :: LuaGroup [R] Group of this entity.
subgroup :: LuaGroup [R] Subgroup of this entity.
healing_per_tick :: uint [R] Amount this entity can heal per tick.
emissions_per_tick :: double [R] Amount of pollution emissions per tick this entity will create.
corpses :: dictionary stringLuaEntityPrototype [R] Corpses used when this entity is destroyed.
selectable_in_game :: boolean [R] Is this entity selectable?
weight :: uint [R]
resistances :: Resistances [R]
fast_replaceable_group :: string [R] The group of mutually fast-replaceable entities.
loot :: Loot [R] Loot that will be dropped when this entity is killed.
repair_speed_modifier :: uint [R] Repair-speed modifier for this entity.
turret_range :: uint [R]
autoplace_specification :: AutoplaceSpecification [R] Autoplace specification for this entity prototype.
collision_mask :: array of string [R] The collison masks this entity uses
belt_speed :: double [R] The speed of this transport belt or nil if this isn't a transport belt related prototype.
underground_belt_distance :: uint [R] The max connection distance this underground belt prototype can connect at or nil if this isn't an underground belt prototype.
result_units :: array of UnitSpawnDefinition [R] The result units and spawn points with weight and evolution factor for a biter spawner entity.
attack_result [R] The attack result of this entity if the entity has one else nil.
final_attack_result [R] The final attack result for projectiles nil if not a projectile
spawn_cooldown [R] The spawning cooldown for this enemy spawner prototype or nil.
mining_drill_radius :: double [R] The mining radius of this mining drill prototype or nil if this isn't a mining drill prototype.
logistic_mode :: string [R] The logistic mode of this logistic container or nil if this isn't a logistic container prototype.
valid :: boolean [R] Is this object valid?

Prototype of an entity.

has_flag(flag) → boolean

Does this prototype have a flag enabled?

Parameters
flag :: string: The flag to check. Must be one of
  • "pushable"
  • "placeable-neutral"
  • "placeable-player"
  • "placeable-enemy"
  • "placeable-off-grid"
  • "player-creation"
  • "building-direction-8-way"
  • "filter-directions"
  • "fast-replaceable-no-build-while-moving"
  • "breaths-air"
  • "not-repairable"
  • "not-on-map"
  • "not-blueprintable"
  • "not-deconstructable"
type :: string [Read-only]

Type of this prototype.

name :: string [Read-only]

Name of this prototype.

localised_name :: LocalisedString [Read-only]

max_health :: float [Read-only]

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

infinite_resource :: boolean [Read-only]

Is this resource infinite? Will be nil when used on a non-resource.

minimum_resource_amount :: uint [Read-only]

Minimum amount of this resource. Will be nil when used on a non-resource.

resource_category :: string [Read-only]

Category of this resource. "basic-solid", "basic-fluid" or nil (when not a resource).

mineable_properties [Read-only]

Table with the following fields:
  • minable :: boolean: Is this entity mineable at all?
  • hardness :: double: Mining hardness.
  • miningtime :: double: Energy required to mine an entity.
  • miningparticle :: string (optional): Prototype name of the particle produced when mining this entity. Will only be present if this entity produces any particle during mining.
  • products :: array of Product: Products obtained by mining this entity.

items_to_place_this :: dictionary stringLuaItemPrototype [Read-only]

Items that when placed will produce this entity. It is a dictionary indexed by the item prototype name.

collision_box :: BoundingBox [Read-only]

The bounding box used for collision checking.

selection_box :: BoundingBox [Read-only]

The bounding box used for drawing selection.

order :: string [Read-only]

Order string of this prototype.

group :: LuaGroup [Read-only]

Group of this entity.

subgroup :: LuaGroup [Read-only]

Subgroup of this entity.

healing_per_tick :: uint [Read-only]

Amount this entity can heal per tick.

emissions_per_tick :: double [Read-only]

Amount of pollution emissions per tick this entity will create.

corpses :: dictionary stringLuaEntityPrototype [Read-only]

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

selectable_in_game :: boolean [Read-only]

Is this entity selectable?

weight :: uint [Read-only]

resistances :: Resistances [Read-only]

fast_replaceable_group :: string [Read-only]

The group of mutually fast-replaceable entities. Possibly nil.

loot :: Loot [Read-only]

Loot that will be dropped when this entity is killed. nil if there is no loot.

repair_speed_modifier :: uint [Read-only]

Repair-speed modifier for this entity. Actual repair speed will be tool_repair_speed * entity_repair_speed_modifier. May be nil.

turret_range :: uint [Read-only]

autoplace_specification :: AutoplaceSpecification [Read-only]

Autoplace specification for this entity prototype. nil if none.

collision_mask :: array of string [Read-only]

The collison masks this entity uses

belt_speed :: double [Read-only]

The speed of this transport belt or nil if this isn't a transport belt related prototype.

underground_belt_distance :: uint [Read-only]

The max connection distance this underground belt prototype can connect at or nil if this isn't an underground belt prototype.

result_units :: array of UnitSpawnDefinition [Read-only]

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

Each UnitSpawnDefinition is a table:

  • unit :: string: Prototype name of the unit that would be spawned
  • spawn_points :: array of SpawnPoint: Each SpawnPoint is a table:
    • evolution_factor :: double: Evolution factor for which this weight applies.
    • weight :: double: Probability of spawning this unit at this evolution factor.

attack_result [Read-only]

The attack result of this entity if the entity has one else nil.

final_attack_result [Read-only]

The final attack result for projectiles nil if not a projectile

spawn_cooldown [Read-only]

The spawning cooldown for this enemy spawner prototype or nil.

Table with the following fields:

mining_drill_radius :: double [Read-only]

The mining radius of this mining drill prototype or nil if this isn't a mining drill prototype.

logistic_mode :: string [Read-only]

The logistic mode of this logistic container or nil if this isn't a logistic container prototype.