Home

LuaItemPrototype

Prototype of an item. For example, an item prototype can be obtained from LuaPrototypes::item by its name: prototypes.item["iron-plate"].

Parent

Attributes

place_result

Prototype of the entity that will be created by placing this item, if any.

place_as_equipment_result

Prototype of the equipment that will be created by placing this item in an equipment grid, if any.

place_as_tile_result

The place-as-tile result if one is defined, if any.

stackable

Is this item allowed to stack at all?

stack_size

Maximum stack size of the item specified by this prototype.

fuel_category

The fuel category, if any.

burnt_result

The result of burning this item as fuel, if any.

fuel_value

Fuel value when burned.

fuel_acceleration_multiplier

The acceleration multiplier when this item is used as fuel in a vehicle.

fuel_top_speed_multiplier

The fuel top speed multiplier when this item is used as fuel in a vehicle.

fuel_emissions_multiplier

The emissions multiplier if this is used as fuel.

fuel_acceleration_multiplier_quality_bonus

Additional fuel acceleration multiplier per quality level.

fuel_top_speed_multiplier_quality_bonus

Additional fuel top speed multiplier per quality level.

flags

The flags for this item prototype.

rocket_launch_products

The results of launching this item in a rocket.

send_to_orbit_mode

How this item interacts when being sent to orbit.

can_be_mod_opened

If this item can be mod-opened.

spoil_result

The spoil result of this item, if any

plant_result

The result entity when planting this item as a seed.

spoil_to_trigger_result

destroyed_by_dropping_trigger

weight

Weight of this item. More information on how item weight is determined can be found on its auxiliary page.

ingredient_to_weight_coefficient

fuel_glow_color

default_import_location

factoriopedia_alternative

An alternative prototype that will be used to display info about this prototype in Factoriopedia.

moved_to_hub_when_building

ammo_category

magazine_size

Size of full magazine.

reload_time

Amount of extra time (in ticks) it takes to reload the weapon after depleting the magazine.

equipment_grid

The prototype of this armor's equipment grid, if any.

resistances

Resistances of this armor item, if any, indexed by damage type name.

collision_box

The collision box used by character entities when wearing this armor.

drawing_box

The drawing box used by character entities when wearing this armor.

provides_flight

If this armor provides flight to character entities when worm.

capsule_action

The capsule action for this capsule item prototype.

radius_color

attack_parameters

The gun attack parameters.

inventory_size

The main inventory size for item-with-inventory-prototype.

item_filters

item_group_filters

item_subgroup_filters

filter_mode

The filter mode used by this item with inventory.

localised_filter_message

The localised string used when the player attempts to put items into this item with inventory that aren't allowed.

default_label_color

The default label color used for this item with label, if any.

draw_label_for_cursor_render

If true, and this item with label has a label it is drawn in place of the normal number when held in the cursor.

speed

The repairing speed if this is a repairing tool.

module_effects

Effects of this module.

category

The name of a LuaModuleCategoryPrototype. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules of the same category with higher tier modules.

tier

Tier of the module inside its category. Used when upgrading modules: Ctrl + click modules into an entity and it will replace lower tier modules with higher tier modules if they have the same category.

requires_beacon_alt_mode

beacon_tint

rails

Prototypes of all rails possible to be used by this rail planner prototype.

support

The rail support used by this rail planner.

manual_length_limit

always_include_tiles

If tiles area always included when doing selection with this selection tool prototype.

skip_fog_of_war

If this selection tool skips things covered by fog of war.

entity_filter_slots

The number of entity filters this deconstruction item has.

tile_filter_slots

The number of tile filters this deconstruction item has.

durability_description_key

The durability message key used when displaying the durability of this tool.

factoriopedia_durability_description_key

The durability message key used when displaying the durability of this tool in Factoriopedia.

durability_description_value

The durability message value used when displaying the durability of this tool.

infinite

If this tool item has infinite durability.

trigger

surface

create_electric_network

tiles

initial_items

valid

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

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.

Methods

has_flag

LuaItemPrototype.has_flag(flag: ItemPrototypeFlag) -> boolean

Call As

itemPrototype.has_flag(flag)

Call Convention

Test whether this item prototype has a certain flag set.

Parameters

Returns

get_spoil_ticks

LuaItemPrototype.get_spoil_ticks(quality?: QualityID) -> uint32

Call As

itemPrototype.get_spoil_ticks()

Call Convention

The number of ticks before this item spoils, or 0 if it does not spoil.

Parameters

Returns

get_ammo_type

LuaItemPrototype.get_ammo_type(ammo_source_type?: "default" | "player" | "turret" | "vehicle") -> AmmoType?

Call As

itemPrototype.get_ammo_type()

Call Convention

The type of this ammo prototype.

Parameters

Returns

get_inventory_size_bonus

LuaItemPrototype.get_inventory_size_bonus(quality?: QualityID) -> uint32?

Call As

itemPrototype.get_inventory_size_bonus()

Call Convention

The inventory size bonus for this armor prototype.

Parameters

Returns

get_module_effects

LuaItemPrototype.get_module_effects(quality?: QualityID) -> ModuleEffects?

Call As

itemPrototype.get_module_effects()

Call Convention

Effects of this module at the specified quality.

Parameters

Returns

get_selection_border_color

LuaItemPrototype.get_selection_border_color(selection_mode: defines.selection_mode) -> Color?

Call As

itemPrototype.get_selection_border_color(selection_mode)

Call Convention

The color used when doing normal selection with this selection tool prototype.

Parameters

Returns

get_selection_mode_flags

LuaItemPrototype.get_selection_mode_flags(selection_mode: defines.selection_mode) -> SelectionModeFlags?

Call As

itemPrototype.get_selection_mode_flags(selection_mode)

Call Convention

Flags that affect which entities will be selected.

Parameters

Returns

get_cursor_box_type

LuaItemPrototype.get_cursor_box_type(selection_mode: defines.selection_mode) -> CursorBoxRenderType?

Call As

itemPrototype.get_cursor_box_type(selection_mode)

Call Convention

Parameters

Returns

get_entity_filter_mode

LuaItemPrototype.get_entity_filter_mode(selection_mode: defines.selection_mode) -> PrototypeFilterMode?

Call As

itemPrototype.get_entity_filter_mode(selection_mode)

Call Convention

The entity filter mode used by this selection tool.

Parameters

Returns

get_tile_filter_mode

LuaItemPrototype.get_tile_filter_mode(selection_mode: defines.selection_mode) -> PrototypeFilterMode?

Call As

itemPrototype.get_tile_filter_mode(selection_mode)

Call Convention

The tile filter mode used by this selection tool.

Parameters

Returns

get_entity_filters

LuaItemPrototype.get_entity_filters(selection_mode: defines.selection_mode) -> Array<LuaEntityPrototype>?

Call As

itemPrototype.get_entity_filters(selection_mode)

Call Convention

The entity filters used by this selection tool.

Parameters

Returns

get_entity_type_filters

LuaItemPrototype.get_entity_type_filters(selection_mode: defines.selection_mode) -> Dict<string, true>?

Call As

itemPrototype.get_entity_type_filters(selection_mode)

Call Convention

The entity type filters used by this selection tool indexed by entity type.

The boolean value is meaningless and is used to allow easy lookup if a type exists in the dictionary.

Parameters

Returns

get_tile_filters

LuaItemPrototype.get_tile_filters(selection_mode: defines.selection_mode) -> Array<LuaTilePrototype>?

Call As

itemPrototype.get_tile_filters(selection_mode)

Call Convention

The tile filters used by this selection tool.

Parameters

Returns

get_durability

LuaItemPrototype.get_durability(quality?: QualityID) -> double?

Call As

itemPrototype.get_durability()

Call Convention

The durability of this tool item prototype.

Parameters

Returns