Modding Help [Solved] Sofa not appearing (Problem with .Object?)

Discussion in 'Starbound Modding' started by Kalora, Jan 5, 2017.

  1. Kalora

    Kalora Void-Bound Voyager

    Hello, everyone. I started modding 3 days ago and all of yesterday was spent ironing out the problems with my custom crafting table and recipes. I began to edit more complicated .object files with code that I was new to, such as sofas that have sit positions etc. I used the apex couch as a "template". I copied the files to my mod folder, changed all the names of the files, edited the sprite, and changed the code to match the new names. I expanded the .pngs to 48x24 while editing the sofa. Maybe I'm not supposed to do that, but I'm just messing around with it to see what would happen.. The item appears in my crafting table as well as the icon, but when I go to place it, it doesn't appear. I have looked for threads but I haven't found anything.. so I assume something is going over my head but I don't know what it is.

    Here are some things I tried:
    -Adding /object/myfolder etc to the cover image. I think it's supposed to be that way so I kept it like that. My folders are set up to match.
    -Changed size of cover, image, and frames to 48x24 so they match
    -Ran through Json parser online. Came up with a syntax error that looks to occur where the "sit" stuff comes in. If I remove everything after the description it comes up as valid. Not sure what the problem is.


    BW_catladysofa.object
    Code:
    {
      "objectName" : "BWcatladysofa",
      "colonyTags" : ["human"],
      "rarity" : "Rare",
      "category" : "furniture",
      "price" : 150,
      "description" : "Someone fell asleep on the sofa again.",
      "shortdescription" : "Cat Lady Sofa",
      "race" : "human",
    
      "apexDescription" : "At least someone is happy with the sofa.",
      "avianDescription" : "The cat looks comfortable.",
      "floranDescription" : "Ssmells old.",
      "glitchDescription" : "Unsure. Why is creature on furniture?",
      "humanDescription" : "This chair sucks the life out of the room, but the cat breathes it back in.",
      "hylotlDescription" : "A very unattractive piece of furniture.",
      "novakidDescription" : "I guess it's for sitting on and not for lookin' at.",
    
      "objectType" : "loungeable",
      "sitFlipDirection" : false,
    
      "inventoryIcon" : "BW_obj_catladysofa_icon.png",
      "orientations" : [
        {
          "image" : "BW_obj_catladysofa.png:<color>",
          "sitCoverImage" : "/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa_cover.png",
          "imagePosition" : [-16, 0],
          "direction" : "left",
          "flipImages" : true,
    
          "sitPositions" : [
            "// Positions from front to back.
            [-10, 22], // Right
            [3, 22] // Left"
          ],
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
        },
        {
          "image" : "BW_obj_catladysofa.png:<color>",
          "sitCoverImage" : "/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa_cover.png",
          "imagePosition" : [-16, 0],
          "direction" : "right",
    
          "sitPositions" : [
            "// Positions from front to back.
            [-2, 22], // Left
            [11, 22] // Right"
          ],
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
        }
      ]
    
    }
    
    BW_catladysofa.frames
    Code:
    {
    
      "frameGrid" : {
        "size" : [48, 24],
        "dimensions" : [1, 1],
        "names" : [
          [ "default" ]
        ]
      }
    }
    
    My images are named
    "BW_obj_catladysofa.png"
    "BW_obj_catladysofa_cover.png"
    "BW_obj_catladysofa_icon.png"'

    My folder is organized like:
    /objects/BW_Obj_CatLadySofa, just like in the code.




    If anyone could help me, I would really appreciate it. X3
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    The Frames file has to be updated if you change image sizes.
     
  3. Kalora

    Kalora Void-Bound Voyager

    Hello, thank you so much for your response. I did update the frames file. I updated it to [48, 24] but still no luck.
     
  4. The | Suit

    The | Suit Agent S. Forum Moderator

    Your entire sit position value is in quotes - turning the entire element into a string when it should have been an array.

    It should be only
    Code:
     "sitPositions" : [ [-2, 22], [11, 22] ]
    
    You should avoid comment tags and remove them
     
  5. Kalora

    Kalora Void-Bound Voyager

    That was a good find! However, I don't think that was the main issue because the image still doesn't appear. It shows as invisible. Since I copied the code from apexcouch.obj, I thought the tags would be fine but they were what was giving me an error in the Json parser. I removed them and it comes back as valid, but like I said, it still doesn't appear. I'm wondering since I changed the dimensions of the object, do I have to change the sit positions at all? Or does that have nothing to do with it?

    Here is what I changed the code to:
    Code:
    {
      "objectName" : "BWcatladysofa",
      "colonyTags" : ["human"],
      "rarity" : "Rare",
      "category" : "furniture",
      "price" : 150,
      "description" : "Someone fell asleep on the sofa again.",
      "shortdescription" : "Cat Lady Sofa",
      "race" : "human",
    
      "apexDescription" : "At least someone is happy with the sofa.",
      "avianDescription" : "The cat looks comfortable.",
      "floranDescription" : "Ssmells old.",
      "glitchDescription" : "Unsure. Why is creature on furniture?",
      "humanDescription" : "This chair sucks the life out of the room, but the cat breathes it back in.",
      "hylotlDescription" : "A very unattractive piece of furniture.",
      "novakidDescription" : "I guess it's for sitting on and not for lookin' at.",
    
      "objectType" : "loungeable",
      "sitFlipDirection" : false,
    
      "inventoryIcon" : "BW_obj_catladysofa_icon.png",
      "orientations" : [
        {
          "image" : "BW_obj_catladysofa.png:<color>",
          "sitCoverImage" : "/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa_cover.png",
          "imagePosition" : [-16, 0],
          "direction" : "left",
          "flipImages" : true,
    
          "sitPositions" : [ [-10, 22], [3, 22] ],
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
        },
        {
          "image" : "BW_obj_catladysofa.png:<color>",
          "sitCoverImage" : "/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa_cover.png",
          "imagePosition" : [-16, 0],
          "direction" : "right",
    
          "sitPositions" : [ [-2, 22], [11, 22] ],
    
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
        }
      ]


    *Edit*
    I began to work on another item (which is also having problems- I'm terrible) and I saw that the .log says this:

    Code:
    [14:05:36.519] [Error] Could not load image asset '/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa.png:default', using placeholder default.
    (AssetException) No associated frames file found for image '/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa.png' while resolving image frame '/objects/BW_Obj_CatLadySofa/BW_obj_catladysofa.png:default'
     
    Last edited: Jan 5, 2017
  6. The | Suit

    The | Suit Agent S. Forum Moderator

    frames file needs to b same name as the image
     
    Kalora likes this.
  7. Kalora

    Kalora Void-Bound Voyager

    Thank you! That was my issue. I'm surprised I overlooked that. Thank you for double-checking all the details. I was so frustrated over this for hours, I'm so happy it's resolved!
     

Share This Page