Modding Help Sprite reading, lua and configuration patching issues.

Discussion in 'Starbound Modding' started by PerfyNormal, Aug 5, 2016.

  1. PerfyNormal

    PerfyNormal Subatomic Cosmonaut

    I can not figure out why the game will not read the extra 16 pixel height but reads the 32 pixel extra width, making custom sign icons for new sign frames and backgrounds work.
    Also, new backgrounds and frames sort of work, but it isn't because it reads an edited sprite, it just doesn't have the sprite and thus it turns invisible.
    I do not understand why some modified sprite sheets work(partially) and some do not, nor do I understand how the game reads the config files such as .object and .frames, as for example;

    Code:
    "size" : [16,16],
    "dimensions" : "12,5"
    
    on an image that is 12 times 16 pixels wide and 5 times 12 pixels high, seems to tell it all about how it reads and splits the sprite sheet ingame, but when I change the dimensions to 14,6 so that it will read the 16 pixels increased height custom icons, those all become blank but the additional 32 pixel of width icon frames work just fine.
    The same issue goes for the sign frame sprite and sign background sprite, it will not read the new dimension, assuming it is because it reads it over y and not x.
    I've looked through the LUA for the sign store, the various object, animation and etc files to see what I may have missed but I can not find any mention of expected image size, additional code or config entries that are used to read the sprite correctly, nor anything else for that matter.

    Things I've done
    - All patch setups were both made and tested using http://chbrown.github.io/rfc6902/ and ingame, Which partially works ingame and seem to work just fine when testing against the original configs.
    - Rewritten the patches to add array entries one at a time to see if the issue was related to "You can only add 1 item at a time into an existing array." noted in http://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/ , which should be unrelated as I create the new array with the patch anyway.
    - Tried changing some of my PNG exporation settings back and forth, which did nothing, transparency etc seems to work fine either way.
    - Changed the order of the entries in all configuration files, switched names to so that transparent-transparent was not a thing in frame and backing names wasn't a thing any more, it was changed to transparent and invisible.

    Things I've not done
    - Used .patch on the LUA, as I haven't a clue how to do that.
    - Used .patch on the Sprite, as I haven't a clue how to do that.
    - .patch that use structural patching from mod-"root" folder.
    - Got things to work as intended. <_<
    - Probably more things that I should do.

    Question
    - Is (As it seems to work), using folders in your mod folder corresponding to Starbound folder structure and putting the .patch in those a valid way of doing your patching?
    - Is there a way to .patch images and .lua?
    - Do I need to use .patch for everything? I do prefer to make sure that the mod is as compatible as possible with existing and upcoming mods.
    - Is it possible to debug items to see what part of the sprite sheet is being rendered, from the sign store, generating the item or from the item itself?

    Patches (excluding sprites, the dimensions are correct, it isn't the issue)

    File: customicons.frames.patch
    Folder: objects\outpost\customsign\
    Code:
    [
      {
        "op": "replace",
        "path": "/frameGrid/dimensions/0",
        "value": 14
      },
      {
        "op": "replace",
        "path": "/frameGrid/dimensions/1",
        "value": 6
      },
      {
        "op": "add",
        "path": "/frameGrid/names/0/6",
        "value": "transparent-gold"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/0/-",
        "value": "transparent-gold-wired"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/1/6",
        "value": "transparent-wood"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/1/-",
        "value": "transparent-wood-wired"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/2/6",
        "value": "transparent-grey"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/2/-",
        "value": "transparent-grey-wired"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/3/6",
        "value": "transparent-white"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/3/-",
        "value": "transparent-white-wired"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/4/6",
        "value": "transparent-black"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/4/-",
        "value": "transparent-black-wired"
      },
      {
        "op": "add",
        "path": "/frameGrid/names/-",
        "value": []
      },
      {
       "op": "add",
       "path": "/frameGrid/names/5/-",
       "value": "none-invisible"
      },
      { 
        "op": "add",
        "path": "/frameGrid/names/5/-",
        "value": "blank-invisible"
     },
     {
        "op": "add",
        "path": "/frameGrid/names/5/-",
        "value": "parchment-invisible"
    
     },
     {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "blackboard-invisible"
    
     },
     {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "glass-invisible"
    },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "hazard-invisible"
      },
          {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "transparent-invisible"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "none-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "blank-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "parchment-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "blackboard-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "glass-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "hazard-invisible-wired"
    
      },
        {
        "op": "add",
        "path":"/frameGrid/names/5/-",
        "value": "transparent-invisible-wired"
      }
    ]
    
    Note: I used to have the new array in one single line of JSON, but changed it to see if it would solve my issues.


    File:
    signframe.frames.patch
    Folder: interface\easel\
    Code:
    [
      {
        "op": "replace",
        "path": "/frameGrid/dimensions/1",
        "value": 6
      },
      {
        "op": "add",
        "path": "/frameGrid/names/-",
        "value": [
          "transparent"
        ]
      }
    ]
    
    File: signbacking.frames.patch
    Folder: interface\easel\
    Code:
    [
      {
        "op": "replace",
        "path": "/frameGrid/dimensions/1",
        "value": 7
      },
      {
        "op": "add",
        "path": "/frameGrid/names/-",
        "value": [
          "invisible"
        ]
      }
    ]
    
    File: minisignbacking.frames.patch
    Folder: interface\easel\
    Code:
    [
      {
        "op": "replace",
        "path": "/frameGrid/dimensions/1",
        "value": 7
      },
      {
        "op": "add",
        "path": "/frameGrid/names/-",
        "value": [
          "invisible"
        ]
      }
    ]
    
    File: signstoragegui.lua
    Folder: interface\easel\
    Modded code:
    Code:
      storage.frameTypes = {
        {"gold",       "b79c40FF", "a58038FF"},
        {"wood",       "754c23FF", "472b13FF" },
        {"grey" ,      "808080FF", "555555FF"},
        {"white" ,     "C6D2D4FF", "959EA2FF"},
        {"black" ,     "383838FF", "151515FF"},
        {"transparent","00000000", "00000000"} -- Mod for transparent signs.
      }
    
    and
    Code:
    storage.backingTypes = {"blank" , "parchment", "blackboard", "glass", "none", "hazard","invisible"} -- "invisible" added for transparent signs.
    
    Note: The comments are not in the used .lua files, in case those may be the cause of errors.
    And please do not use the code to use for publishing your own transparent signs mod, I was hoping to publish it once it works as intended. And well, even if someone were to publish something using this, I'd still publish my version. ;p
     
  2. PerfyNormal

    PerfyNormal Subatomic Cosmonaut

    I assumed adding one more vertical layer in the config file of the .frames file for a sprite would work, though the game doesn't seem to do that. However reading horizontal works.

    Is this a known issue? I can not figure out what I've done wrong.
    - "size": [1,1] on a "dimensions": [5,5] would read 1 pixel x 1 pixel over a 5 pixel x 5 pixel image?
    - When dimensions to [6,6] it will read the new width but not the height. Even if the pixels are there on the sprite. Anyone have a clue?
     

Share This Page