Prototype/Rail

From Official Factorio Wiki
Revision as of 17:52, 16 August 2023 by BilkaBot (talk | contribs) (Migrated prototype doc to separate website)
Jump to navigation Jump to search

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/RailPrototype.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.


Template:Prototype parent The abstract base of both rail prototypes.

Template:Prototype TOC

Extensions

Mandatory properties

This prototype inherits all the properties from Prototype/EntityWithOwner.

Template:Prototype property Table with the following mandatory members:

Optional properties

Template:Prototype property Sound played when a character walks over this rail.

Mandatory values

All rail collision_boxes are hardcoded and cannot be modified. The hardcoded values are:

  • straight_rail_primary_bounding_box = {-0.7, -0.99, 0.7, 0.99}
  • diagonal_straight_rail_primary_bounding_box = {-0.65, -0.7, 0.65, 0.7}
  • curved_rail_primary_bounding_box = {-0.75, -0.55, 0.75, 1.6}
  • secondary_bounding_box = {-0.68, -2.7, 0.68, 2.7}

Furthermore, the selection_boxes are automatically calculated from the bounding boxes, so effectively also hardcoded.