An equipment grid is for example the inside of a power armor.
LuaEquipmentGridPrototypeunknownfalseuint32unknownfalseWidth of the equipment grid.
uint32unknownfalseHeight of the equipment grid.
Array<LuaEquipment>unknownfalseAll the equipment in this grid.
doubleunknownfalseMaximum energy per tick that can be created by all solar panels in the equipment grid on the current surface. Actual generated energy varies depending on the daylight levels.
doubleunknownfalseThe total energy stored in all batteries in the equipment grid.
doubleunknownfalseTotal energy storage capacity of all batteries in the equipment grid.
floatunknownfalseThe amount of shield hitpoints this equipment grid currently has across all shield equipment.
floatunknownfalseThe maximum amount of shield hitpoints this equipment grid has across all shield equipment.
uint32unknownfalseThe total amount of inventory bonus this equipment grid gives.
doubleunknownfalseThe total amount of movement bonus this equipment grid gives.
Returns 0 if LuaEquipmentGrid::inhibit_movement_bonus is true.
booleanbooleanfalseWhether this grid's equipment movement bonus is active.
uint32unknownfalseUnique identifier of this equipment grid.
LuaEntityunknowntrueThe entity that this equipment grid is owned by (in some inventory or item stack.)
If the owning entity is a character owned by some player and the player is disconnected this will return nil.
LuaPlayerunknowntrueThe player that this equipment grid is owned by (in some inventory or item stack.)
LuaItemStackunknowntrueThe item stack that this equipment grid is owned by.
booleanunknownfalseIs 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.
stringunknownfalseThe 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.
LuaEquipmentGrid.take{ position?: EquipmentPosition, equipment?: LuaEquipment, by_player?: PlayerIdentification } -> ItemWithQualityCount?
equipmentGrid.take{ position=position }
takes_table: truetable_optional: falseRemove an equipment from the grid.
position?: EquipmentPosition — Take the equipment that contains this position in the grid.equipment?: LuaEquipment — Take this exact equipment.by_player?: PlayerIdentification — If provided the action is done 'as' this player and on_player_removed_equipment is triggered.ItemWithQualityCount? — The removed equipment, or nil if no equipment was removed.LuaEquipmentGrid.take_all(by_player?: PlayerIdentification) -> ItemWithQualityCounts
equipmentGrid.take_all()
takes_table: falsetable_optional: falseRemove all equipment from the grid.
by_player?: PlayerIdentification — If provided, the action is done 'as' this player and on_player_removed_equipment is triggered.ItemWithQualityCounts — List of the equipment that has been removed.LuaEquipmentGrid.clear(by_player?: PlayerIdentification)
equipmentGrid.clear()
takes_table: falsetable_optional: falseClear all equipment from the grid, removing it without actually returning it.
by_player?: PlayerIdentification — If provided, the action is done 'as' this player and on_player_removed_equipment is triggered.LuaEquipmentGrid.put{ name: EquipmentID, quality?: QualityID, position?: EquipmentPosition, by_player?: PlayerIdentification, ghost?: boolean } -> LuaEquipment?
equipmentGrid.put{ name="name" }
takes_table: truetable_optional: falseInsert an equipment into the grid.
name: EquipmentID — Equipment prototype namequality?: QualityID — The quality, nil for any or if not provided normal is used.position?: EquipmentPosition — Grid position to put the equipment in.by_player?: PlayerIdentification — If provided the action is done 'as' this player and on_player_placed_equipment is triggered.ghost?: boolean — If true, place the equipment as a ghost.LuaEquipment? — The newly-added equipment, or nil if the equipment could not be added.LuaEquipmentGrid.can_move{ equipment: LuaEquipment, position: EquipmentPosition } -> boolean
equipmentGrid.can_move{ equipment=equipment, position=position }
takes_table: truetable_optional: falseCheck whether moving an equipment would succeed.
equipment: LuaEquipment — The equipment to moveposition: EquipmentPosition — Where to put itbooleanLuaEquipmentGrid.move{ equipment: LuaEquipment, position: EquipmentPosition } -> boolean
equipmentGrid.move{ equipment=equipment, position=position }
takes_table: truetable_optional: falseMove an equipment within this grid.
equipment: LuaEquipment — The equipment to moveposition: EquipmentPosition — Where to put itboolean — true if the equipment was successfully moved.LuaEquipmentGrid.get(position: EquipmentPosition) -> LuaEquipment?
equipmentGrid.get(position)
takes_table: falsetable_optional: falseFind equipment in the Equipment Grid colliding with this position.
position: EquipmentPosition — The positionLuaEquipment? — The found equipment, or nil if equipment occupying the given position could not be found.LuaEquipmentGrid.get_contents() -> Array<EquipmentWithQualityCounts>
equipmentGrid.get_contents()
takes_table: falsetable_optional: falseGet counts of all equipment in this grid.
Array<EquipmentWithQualityCounts> — List of all equipment in the grid.LuaEquipmentGrid.get_generator_energy(quality?: QualityID) -> double
equipmentGrid.get_generator_energy()
takes_table: falsetable_optional: falseTotal energy per tick generated by the equipment inside this grid.
quality?: QualityID — Defaults to "normal".doubleLuaEquipmentGrid.find(equipment: EquipmentWithQualityID, search_ghosts?: boolean) -> LuaEquipment?
equipmentGrid.find(equipment, true)
takes_table: falsetable_optional: falseFind equipment by name.
equipment: EquipmentWithQualityID — Prototype of the equipment to find.search_ghosts?: boolean — If ghosts inner equipment should be searched. Defaults to falseLuaEquipment? — The first found equipment, or nil if equipment could not be found.LuaEquipmentGrid.count(equipment?: EquipmentWithQualityID) -> uint32
equipmentGrid.count()
takes_table: falsetable_optional: falseGet the number of all or some equipment in this grid.
equipment?: EquipmentWithQualityID — The equipment to count. If not specified, count all equipment.uint32LuaEquipmentGrid.revive(equipment: LuaEquipment) -> LuaEquipment
equipmentGrid.revive(equipment)
takes_table: falsetable_optional: falseRevives the given equipment ghost if possible.
equipment: LuaEquipment — The equipment ghost to revive.LuaEquipmentLuaEquipmentGrid.order_removal(equipment: LuaEquipment) -> boolean
equipmentGrid.order_removal(equipment)
takes_table: falsetable_optional: falseMarks the given equipment for removal. If the given equipment is a ghost it is removed.
equipment: LuaEquipmentboolean — If the equipment was successfully marked for removal (or in the case of a ghost; removed.)LuaEquipmentGrid.cancel_removal(equipment: LuaEquipment) -> boolean
equipmentGrid.cancel_removal(equipment)
takes_table: falsetable_optional: falseCancels removal for the given equipment.
equipment: LuaEquipmentboolean — If the equipment removal was successfully cancelled.