Modding Help Race mod having issues

Discussion in 'Starbound Modding' started by ZixNomz, Jun 28, 2017.

Tags:
  1. ZixNomz

    ZixNomz Void-Bound Voyager

    So me and a close friend of mine as well as one of her friends are currently working on a race mod for starbound. We are having a few issues but have been using the only race template we found which was made my Skittles. While working on the ships we got stuck as we don't want to follow the human template in the file but do not have any other resources available to make a custom ship. Any help would be massively appreciated as we want to be able to make a fully customized ship and have no idea how (Ex: how to manage the .block pngs and custom designs in general in the entire template). If anyone has a different more complete or stable template that would be nice ;w; But until then the ship part is the hardest for us and I myself have not been able to find any other way to make custom ships. Sorry if I repeated myself!

    Attached here is an example of a block png. I am completely dead as to how to edit it :/
     

    Attached Files:

  2. Sparklink

    Sparklink Ketchup Robot

    The making of the ship may look rather difficult at first glance, but it turns out to be rather easy. The visual appearance of the out side of the ship does nothing in the game but look pretty; what really is keeping you inside "the ship" are invisible blocks solid blocks, they are represented in the blocks.png with red . White colored pixels are empty blocks that the player can walk through. And the various other colors represents objects like the flames, the ship locker, lights, etcetera.


    Here is a small example from the Apex ship locker.
    {
    "value" : [0, 128, 0, 255], (The value is the colour of the pixels that represents the object in the blocks.png)
    "foregroundBlock" : false, (The foreground is where your character stands, since the locker hangs on the wall it is considered a background block if it were to connect to the floor, left or right wall, or ceiling then it would be a foreground block)
    "backgroundBlock" : true, (The background is anything that is behind the character)
    "backgroundMat" : "apexshipwall", (The ship locker needs blocks behind it to be placed, this parameter specifies what type of block is place behind it, apexshipwall is the standard background block of any ship)
    "object" : "apexshiplockerTier0", (This is the object that is being placed)
    "objectParameters" : {
    "unbreakable" : true (This makes it so that it is impossible to remove the object; the captain's chair, fuel hatch, and S.A.I.L. should remain unbreakable 1.because they are both necessary and irreplaceable, and 2. because if you place two S.A.I.L. in the same area you will cause the game to crash.)
    }
    }

    I covered most of what you will need to know, save some minor details that are easy enough to figure out with what I have taught you.
    If there is anything else that is still unclear please let me know.
    Good luck with the ship building!
     
  3. bk3k

    bk3k Oxygen Tank

    I'd want to add to that.

    "value" is set to numeric values, all from 0 - 255. They represent colors.
    Red, Green, Blue, Alpha(less than 255 represents some level of transparency).
    It will accept a 3 number array as well(RGB without specifying alpha).
    The color program of your image editor should correspond to this same range. For ships, I personally like paint.net as far as programs go.

    Personally I'm not a fan of the "unbreakable" attribute. Go ahead and let people move things around. Their own fault if they go trash their captain's chair etc. At least they can redecorate more so. That's a person preference.

    If you specify "foregroundBlock" : true but don't also specify a "foregroundMat" then you'll get the invisible(undestroyable) metamaterial blocks that provide collisions. The same is true for the background equivalents and this will prevent players from manually placing a block there later, but will make it pass any "is there a background" tests.

    Some other things you can use in your blockKey
    Code:
    "foregroundResidual" : true,
    "backgroundResidual" : true,
    "objectResidual" : true
    
    Suppose your T1 blockImage includes some blocks and/or objects, and your T2 blockImage does not. If the foreground, background, and objects are residual, they will remain anyhow. If not, they will be removed. Without this, you're counting on everything to be re-added every time. Essentially removed, then readded. So if you had removable blocks, they'll be replaced each upgrade(unless you put something in their place already). With this, you can for example just add the lights on one tier. And on subsequent tiers, add only the lights that are newly placed(in expanded areas). If a player removed the lights, they won't get free new ones but neither will you be interfering with their re-decoration.

    Note also that you can't get away with doing this to teleporters. There must be an attempt to place a teleporter each time(even if it fails) or starbound crashes the shipworld. Well it doesn't technically have to be the teleporter, but some part of the blockImage needs to have a corresponding part of the blockKey with
    Code:
    "flags" : [ "playerSpawn" ],
    and that would typically be the one same one that places a teleporter, but technically it doesn't have to be.

    Some other object attributes could be used. Here's an example.
    Code:
        {
          "value" : [0, 248, 0, 255],
          "foregroundBlock" : false,
          "backgroundBlock" : true,
          "backgroundMat" : "vepr_shipwall",
          "object" : "vepr_shiplocker",
          "objectParameters" : {
            "treasurePools" : [
              "starterTreasure"
            ],
            "level" : 1.0,
            "unbreakable" : false
          }
        },
    
    What that tells us is
    1. Place a background wall
    2. Place an object there named "vepr_shiplocker" (which happens to be a container)
    3. That container will have contents determined from a treasurepool named "starterTreasure" but you could substitute your own treasurepool.
    4. The level of which is 1. I can't see why you'd want level 6 equipment on a starter ship, can you? So level 1 is probably appropriate.
    5. The object can be broken. The same thing would be true without this line, as that's the default.

    Your ship does in no way require a path that includes/matches any race's name. Any given race will simply use the .structure files pointed to by the universe_server.config file. The simple example is this patch.
    Code:
      [
        {
          "op" : "replace",
          "path" : "/speciesShips/apex",
          "value" : [
            "/ships/vepr/vepr_T0.structure",
            "/ships/vepr/vepr_T1.structure",
            "/ships/vepr/vepr_T2.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure",
            "/ships/vepr/vepr_T3.structure"
          ]
        }
      ]
    
    That exact ship doesn't bother with having real distinct tiers(it was made prior to the upgrade system). Tier 4 and beyond is just a repeat of T3. Starbound doesn't care that it is using the same structure files again, and it doesn't care that those files aren't found in /ships/apex/

    In the case of a new race - rather than a ship mod moving an existing race - you'd "add" instead of "replace" but it otherwise is the same.
     

Share This Page