Modding Discussion Foreground Layer: How hard would it be?

Discussion in 'Starbound Modding' started by gigaus, Oct 3, 2017.

  1. gigaus

    gigaus Aquatic Astronaut

    I'm sure this has come up before, but how difficult would it be to add a 3rd, foreground layer to the game? I bring this up after making a mall for a city....and realizing all the escalators looks weird because there's no 'front' part facing the camera. I know it's possible to cover players under an object, like with a blanket, tent, vehicle, elevator, but what about something that's static?
     
  2. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    I think the real problem is that there are only the two tile layers, hard-coded, into the game.

    Yes, we do have the ability to alter the render layer; But that is as the name implies only a manipulation of the order the sprite renders on-screen. Even in those cases, all objects and tiles fall either under the existing foreground or background layers.



    Tl;Dr

    The game has the two placement layers hard-coded, to my knowledge. Changing them is not a readily available option to us modders as of yet.
     
  3. lazarus78

    lazarus78 The Waste of Time

    Yes you can make objects "in front" of the player. Ive done it several times. --> https://i.imgur.com/Ke3nWNi.png

    You can use the json bit "renderLayer" : X where X is anything between -10 and +10, with 0 being the layer the player is rendered at.
     
  4. bk3k

    bk3k Oxygen Tank

    You can use other layers, not just the one the entity normally renders at. /help.config lists the following layers -
    I believe you could actually use any of those as a valid renderlayer and apply any zLevel adjustment on top of that.
    Code:
    "renderLayer" : "Player+1",
    would render in front of the player.

    In truth I have only done a little experimenting with this.
     
    lazarus78 likes this.
  5. gigaus

    gigaus Aquatic Astronaut

    Interesting. So tiles and the like are hard coded to two layers, but objects are not, technically.

    So it would be simple enough to just place an object, and have it render in front of the player I'm guessing. My only question there would be how would that effect placement? Because for most objects you need to have a surface that is wide enough to fit the object and all.

    Another question then, in regard to tiles then would be is there a way to make it so that tiles in the foreground are 'passable', as in players and entities can move through them? I know a bit of the code, and I poked at that idea of making another layer using the foreground/active layer, but with blocks being passable, but I have no clue how to make them in such a state. Yet.
     
  6. lazarus78

    lazarus78 The Waste of Time

    You can make objects take up only 1 space.

    You can use "anchors" : [ ] to make the object placable anywhere regardless of background or blocks, and if you leave out the "spaceScan" key, then it will only take up 1 space.
     
  7. bk3k

    bk3k Oxygen Tank

    Tiles you can pass through? Certainly.
    Code:
    "collision" : "none",
     
  8. gigaus

    gigaus Aquatic Astronaut

    Welp that helps accelerate my learning of this language. If these are the case, then I might be able to rig it to have a 3rd layer in the foreground above the active layer.

    Equally as possible, I could try and end up setting my computer on fire. We'll see.
     
  9. lazarus78

    lazarus78 The Waste of Time

    Either case, I await eagerly. Preferably the latter, cus that would be spectacular.
     

Share This Page