PrototypeBase: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Bilka moved page Prototype to PrototypeBase: Renamed in the code)
(Migrated prototype doc to separate website)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{about|the abstract base of all prototypes|a list of all available prototype types|prototype definitions|a list of vanilla prototypes|data.raw}}
<div class="stub"><p>'''The prototype docs have moved to a new website with an improved format.''' This documentation page can now be found here: [https://lua-api.factorio.com/latest/prototypes/PrototypeBase.html https://lua-api.factorio.com/latest/prototypes/PrototypeBase.html]
== Basics ==
This type is abstract and cannot be created directly.


The abstract base for all prototypes. All prototypes inherit from this prototype.
</p><p>This wiki page is no longer updated and '''will be removed at some point in the future''', so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback [https://forums.factorio.com/viewforum.php?f=233 on the forums].</p></div>
 
 
 
{{Prototype parent}}
The abstract base for prototypes. PrototypeBase defines the common features of prototypes, such as localization and order.
 
{{Prototype TOC|''abstract''}}


== Mandatory properties ==
== Mandatory properties ==
=== type ===
'''Type''': [[Types/string]]


{{Prototype_property|type|[[Types/string|string]]}}
Specification of the type of the prototype.
Specification of the type of the prototype.


For a list of all available types and their properties, see [[prototype definitions]]. For a list of all types used in vanilla, see [[data.raw]].
For a list of all available types and their properties, see [[prototype definitions]]. For a list of all types used in vanilla, see [[data.raw]].


=== name ===
{{Prototype_property|name|[[Types/string|string]]}}
'''Type''': [[Types/string]]
 
Unique textual identification of the prototype.
Unique textual identification of the prototype.


Line 23: Line 25:


== Optional properties ==
== Optional properties ==
=== order ===
'''Type''': [[Types/Order]]


Used to order items in inventory, recipes and GUI's.
{{Prototype_property|order|[[Types/Order|Order]]|""|optional=true}}
Used to order prototypes in inventory, recipes and GUI's.


May not exceed a length of 200 characters.
May not exceed a length of 200 characters.


=== localised_name ===
{{Prototype_property|localised_name|[[Types/LocalisedString|LocalisedString]]|optional=true}}
'''Type''': [[Types/LocalisedString]]
Overwrites the name set in the [[Tutorial:Localisation#Localising_simple_strings|locale file]]. Can be used to easily set a procedurally-generated name because the LocalisedString format allows to insert parameters into the name directly from the Lua script.


=== localised_description ===
{{Prototype_property|localised_description|[[Types/LocalisedString|LocalisedString]]|optional=true}}
'''Type''': [[Types/LocalisedString]]
Overwrites the description set in the [[Tutorial:Localisation#Localising_simple_strings|locale file]]. The description is usually shown in the tooltip of the prototype.

Latest revision as of 10:40, 21 September 2023

The prototype docs have moved to a new website with an improved format. This documentation page can now be found here: https://lua-api.factorio.com/latest/prototypes/PrototypeBase.html

This wiki page is no longer updated and will be removed at some point in the future, so please update your browser bookmarks or other links that sent you here. If you'd like to contribute to the new docs, you can leave your feedback on the forums.


Prototype definitions » PrototypeBase


The abstract base for prototypes. PrototypeBase defines the common features of prototypes, such as localization and order.


PrototypeBase — abstract
name::string
type::string
localised_description::LocalisedString (optional)
localised_name::LocalisedString (optional)
order::Order (optional)

Mandatory properties

type

Type: string
Specification of the type of the prototype.

For a list of all available types and their properties, see prototype definitions. For a list of all types used in vanilla, see data.raw.

name

Type: string
Unique textual identification of the prototype.

For a list of all names used in vanilla, see data.raw.

May not contain ., may not exceed a length of 200 characters.

Optional properties

order

Type: Order
Default: ""
Used to order prototypes in inventory, recipes and GUI's.

May not exceed a length of 200 characters.

localised_name

Type: LocalisedString
Overwrites the name set in the locale file. Can be used to easily set a procedurally-generated name because the LocalisedString format allows to insert parameters into the name directly from the Lua script.

localised_description

Type: LocalisedString
Overwrites the description set in the locale file. The description is usually shown in the tooltip of the prototype.