Types/EquipmentShape: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(0.17.51)
(Updated styling of prototype doc migration note)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<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/types/EquipmentShape.html https://lua-api.factorio.com/latest/types/EquipmentShape.html]
</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>
== Basics ==
== Basics ==
The shape and dimensions of an equipment module.
The shape and dimensions of an equipment module.
Line 18: Line 24:
'''Type''': [[Types/table]] (array) of [[Types/table]] (array) of [[Types/uint32]]
'''Type''': [[Types/table]] (array) of [[Types/table]] (array) of [[Types/uint32]]


Only used when when using <code>type</code> "manual". Defines the filled squares of the equipment shape. {0, 0} is the upper left corner of the equipment.
Only used when when using <code>type</code> "manual". Each inner array is a "position" inside width×height of the equipment. Each positions that is defined is a filled squares of the equipment shape. {0, 0} is the upper left corner of the equipment.


<syntaxhighlight lang="lua">-- A set of points which fall within the width/height - can't be empty
<syntaxhighlight lang="lua">-- A set of points which fall within the width/height - can't be empty

Latest revision as of 10:42, 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/types/EquipmentShape.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.


Basics

The shape and dimensions of an equipment module.

Mandatory properties

width

Type: Types/uint32

height

Type: Types/uint32

type

Type: Types/string

The shape. Must be "full" or "manual". When using "manual", points must be defined.

Optional properties

points

Type: Types/table (array) of Types/table (array) of Types/uint32

Only used when when using type "manual". Each inner array is a "position" inside width×height of the equipment. Each positions that is defined is a filled squares of the equipment shape. {0, 0} is the upper left corner of the equipment.

-- A set of points which fall within the width/height - can't be empty
points = {{0, 0}, {1, 0}, {2, 0}, {3, 0},
          {0, 1},                 {3, 1},
          {0, 2},                 {3, 2},
          {0, 3}, {1, 3}, {2, 3}, {3, 3}}