StaticItem
classItem prototype
- read-only Assigning to the field raises an error.
- load-only Usable only while mods load. The game seals these members once loading finishes, so a call or a write from a running world raises an error.
Fields
| Name | Type | Description | |
|---|---|---|---|
| image | Texture2D | Item image in UI | |
| image_path | string | Icon path relative to the owning mod folder | |
| stack_size | integer | Size of item stack | |
| sim_id | read-only | integer | Number of the item in this session only, from 1 by name after init; another set of mods shifts it. What --!sim code compares; never save it |
| tier | integer | Item unlock tier | |
| type | load-only | string | What the item is: "solid", "fluid" or "abstract" |
| unit_mul | number | multiplier for UI | |
| mesh | StaticMesh | Mesh for item rendering in world | |
| block | StaticBlock | Buildable object pointer for this item | |
| custom_data | boolean | Is item instance contains CustomData | |
| logic | Class | Class for item while in hand | |
| lua | table? | Lua prototype table | |
| tags | string | Space separated search tags | |
| category | string | In-game database category | |
| equipment_slot | string | Equipment slot this item fits (Jetpack, Light) | |
| label | Loc | Localized item name | |
| description_parts | Loc[] | Localized description paragraphs | |
Functions
StaticItem:copy(name, spec) load-only
Register a copy of this item under a new name; its block stays the block of the original until item.block is set
| name | string | Name of the new prototype |
| spec | StaticItem.spec? | Fields set on the copy, as in reg |
returns StaticItem The copy, nil when the name is taken
Standard members (5)
These members are available on all classes of this kind.
| StaticItem.cast(object) | Trying to cast Object into StaticItem |
| StaticItem.get_class() | Return StaticItem class object |
| StaticItem.find(name) | Looks StaticItem up in db, nil when there is none |
| StaticItem.get(name) | Takes StaticItem from db, reports a miss to the log |
| StaticItem.reg(name, spec) load-only | Register a new StaticItem static object, or take the registered one of that name |
Inherited from Prototype (2)
- name read-only Object name
- Prototype:is_valid() Returns false once the underlying engine object has been destroyed
Inherited from Object (1)
- Object:get_class() Class of this object
Subclasses
Used by
- AbstractCrafter.select_recipe_by_output param
- Dimension.get_produced param
- Dimension.get_consumed param
- ExtractionData.item field
- InventoryAccess.add param
- InventoryAccess.sub param
- InventoryAccess.add_at param
- InventoryAccess.sub_at param
- InventoryReader.find param
- ItemData.item field
- ItemData.new param
- ItemData.new_zero param
- ItemGroup.members field
- ItemGroup.matches param
- LogicExportOption.signal field
- LogicImportOption.signal field
- Player.hotbar_has param
- Railway.place_train param
- Recipe.icon field
- RecipeDictionary.machines field
- RecipeDictionary.used_in param
- RecipeInventory.add param
- ResourceInventory.item field
- SingleSlotInventory.set_simple_filter param
- SourceData.item field
- StaticBlock.energy_consumption_item field
- StaticBlock.energy_production_item field
- StaticItemPanel.items field
- StaticItemPanel.add_context param
- StaticObject.item field
- StaticObject.mined_item field
- StaticPlayer.hotbar field
- StaticPlayer.tools field
- StaticPlayer.light field
- StaticPlayer.blueprint_item field
- StaticQuest.add_context param
- StaticResearchDecorationUnlock.decorations field
- StaticResearchToolUnlock.tool field
- StaticTip.add_context param
- Train.cars field
- WorldGenerator.stone_source field
- WorldGenerator.water_source field