Modding/Door Locations

From Cosmoteer Wiki
(Redirected from Door Locations)
Jump to navigation Jump to search

When creating custom parts that should be walkable by Crew, you need to specify where doors may be placed. These locations are defined in the .rules file for your part. Allowed door locations are specified as a list of [x,y] coordinates called AllowedDoorLocations.

Coordinate System and Door Locations

Each door location is defined using [x, y] coordinates where:

  • The origin (0, 0) is the top-left corner of the part.
  • Positive x moves right, and positive y moves downward.
  • Coordinates outside the part allow doors between the part and adjacent blocks (e.g., [-1,1]).

Example

Following is an example of how the coordinate system works. Coordinates are counted with x to the right and y downwards from the top-left cell of your unrotated part.

Color Key

  • **Green Coordinates**: User-specified coordinates where doors can be placed.
  • **Red Sections**: Actual door placement areas based on the specified coordinates.
  • **Black Outline**: Represents the part’s outline.
  • **Purple Coordinates**: Sample coordinates that help illustrate how the system works.

AllowedDoorLocations tutorial.png

Source Code Example

In source code, the locations would look like this:

AllowedDoorLocations
[
    [3, -1]
    [-1, 4]
    [5, 4]
    [1, 6]
    [2, 6]
    [3, 6]
]

Important Notes

  • **Specifying outside cells**: You must specify the coordinates of cells adjacent to the part (e.g., [-1,1]) to allow doors between the part and surroundings.
  • **Default behavior**: If `AllowedDoorLocations` is not specified, doors will be allowed on every edge of the part by default.