Modding Help Adding multiple doors to space station segments

Discussion in 'Starbound Modding' started by VasVadum, Aug 9, 2017.

  1. VasVadum

    VasVadum Cosmic Narwhal

    As you know, the space station expansions use dungeon files. I tried to add multiple doors to a dungeon that is 3x3 segments in size, where each side of the station segment, had 3 doors on it.

    However, t didn't work, the game shown that I was about to expand the station in the proper segment, however it gave me no options that were doable.

    [​IMG]

    So how do I add multiple doors to this 3x3 segment? Currently, yo can see that it shows only one center door on each side. One person even said it was hard coded and impossible, but I don't quite believe that, I just don't think I did it right or missed something.
     
  2. lazarus78

    lazarus78 The Waste of Time

    Got an image of what the section you are trying to add looks like?
     
  3. VasVadum

    VasVadum Cosmic Narwhal

    I'm not entirely sure thats important. I guess I'll go ahead and make an example though.

    I give you a screenshot, and a dungeon file, simply delete .txt at the end of it to open it in Tiled.

    This is just a rough, quick example, not perfectly laid out because the layout is not the issue, its the fact that the game doesn't appear to allow multiple doors on one side.
     

    Attached Files:

  4. lazarus78

    lazarus78 The Waste of Time

    Visuals help me understand what is going on better.


    Did you include all the proper "anchors" in the parts.config for your new part? I'm guessing those are the logical points where new sections will... anchor...
     
  5. VasVadum

    VasVadum Cosmic Narwhal

    Huh, I didn't know a parts config was needed for specifying which part of the dungeon would have these door things. Hmm. I wonder how to go about doing that.
     
  6. lazarus78

    lazarus78 The Waste of Time

    Well the parts config has the info for all the station parts. Crafting material cost, display name, etc, and each one has a section like this:

    Code:
    "anchors" : [
            [[1, 0], [2, 1]],
            [[0, 1], [1, 2]],
            [[-1, 0], [0, 1]],
            [[0, -1], [1, 0]]
          ],
    
    And they seem to line up with the door locations of that particular part. I wouldn't be surprised if this is relevant.
     
  7. VasVadum

    VasVadum Cosmic Narwhal

    How do you know they line up? What is this coordinate system using exactly?
     
  8. lazarus78

    lazarus78 The Waste of Time

    Ok ok, I think I understand it more... give me a second to formulate what I want to say, but I wanted to post this so you know Im looking it over.

    Give me a minute...


    Edit:

    Ok, so the parts config has this "tiles" section:

    Code:
    "tiles" : [
            [0, 2], [1, 2], [2, 2],
            [0, 1], [1, 1], [2, 1],
            [0, 0], [1, 0], [2, 0]
          ],
    
    this seems to be setting up the logical grid for the section part. I am using the large core as an example because it actually has more than just one tile, and deals with doors in all directions like you are trying for.

    Next we have the anchors:
    Code:
    "anchors" : [
            [[1, 0], [2, 1]],
            [[0, 1], [1, 2]],
            [[-1, 0], [0, 1]],
            [[0, -1], [1, 0]]
          ],
    
    Off the bat, it is semi-straight forward. There are 4 sets of coordinates. Each pair represents each direction. (In list order, the first pair tells the direction. Pair 1 is right, pair 2 is up, pair 3 is left, and pair 4 is down). The second cordinate value in each pair seems to pertain to what tile the anchor is in. IE the anchor to the right is in tile 2,1 which is the middle right of the section.

    So if I am correct, and that it works this way, and assuming it isnt hard coded, you should be able to add your new door achnors fairly easily

    Example:
    Code:
    "anchors" : [
            // Right facing doors
            [[1, 0], [2, 2]],
            [[1, 0], [2, 1]],
            [[1, 0], [2, 0]],
           
            // Up facing doors
            [[0, 1], [0, 2]],
            [[0, 1], [1, 2]],
            [[0, 1], [2, 2]],
           
            // Left
            [[-1, 0], [0, 2]],
            [[-1, 0], [0, 1]],
            [[-1, 0], [0, 0]],
           
            // down
            [[0, -1], [0, 0]],
            [[0, -1], [1, 0]],
            [[0, -1], [2, 0]]
          ],
    
    again, this is a theory. Ive not tested. I don't know if it is problematic to reference one tile more than once per anchor.
     
    Last edited: Aug 9, 2017

Share This Page