Modding Help Object crashes when interacted with.

Discussion in 'Starbound Modding' started by HotLalonde, Dec 13, 2013.

  1. HotLalonde

    HotLalonde Void-Bound Voyager

    I've been trying to add a compressor object into the game and so far I've gotten the object in-game, but when it's interacted with by pressing E, the game crashes and I don't understand why.

    The .object file:
    Code:
    {
      "objectName" : "stargazer_plantcompressor",
      "rarity" : "Common",
      "description" : "A plant compressor. Maybe I can make fuels with this.",
      "shortdescription" : "Plant Compressor",
      "race" : "generic",
      "category" : "crafting",
      "objectType" : "container",
      "printable" : false,
      "interactData" : {
        "config" : "plantcompressor.config"
      },
    
      "apexDescription" : "A compressor. The future is now.",
      "avianDescription" : "Compressing plants has never been easier.",
      "floranDescription" : "T-they compress what?!",
      "glitchDescription" : "Organic fuel. Technological advancement ensues.",
      "humanDescription" : "A plant compressor.",
      "hylotlDescription" : "A machine made for the compression of plants",
      "inventoryIcon" : "stargazer_plantcompressoricon.png",
      "orientations" : [
        {
          "dualImage" : "stargazer_plantcompressor.png:<frame>",
    
         "imagePosition" : [0, 0],
         "frames" : 8,
         "animationCycle" : 1.0,
         
         "spaceScan" : 0.1,
         "anchors" : [ "bottom" ],
         "collision" : "platform"
    
        }
      ],
    
      "recipeGroup" : "stargazer_plantcompressor",
      "slotCount" : 2,
      "uiConfig" : "plantcompressor.config",
      "frameCooldown" : 67,
      "autoCloseCooldown" : 3600
    
    }
    
    
    The .config code:
    Code:
    {
      "gui" : {
        "background" : {
          "type" : "background",
          "fileHeader" : "plantcompressor_header.png",
          "fileBody" : "plantcompressor_body.png",
          "fileFooter" : "plantcompressor_footer.png"
        }
      },
    
      "toggleCrafting" : {
          "type" : "button",
          "position" : [5, 39],
          "base" : "compress.png",
          "hover" : "compressover.png"
        },
      
        "itemGrid" : {
          "type" : "itemgrid",
          "position" : [74, 37],
          "dimensions" : [1, 1],
          "spacing" : [19, 19],
          "backingImage" : "empty.png"
        },
      
        "outputItemGrid" : {
          "type" : "itemgrid",
          "slotOffset" : 1,
          "position" : [110, 37],
          "dimensions" : [1, 1],
          "spacing" : [19, 19],
          "backingImage" : "empty.png"
        }
    }
    All the resources are in the same folder and it hasn't caused any problems, the only issue I have is the crash and I have a feeling it's a problem with my coding. Can anybody see an error and help me out?
     
    Last edited: Dec 13, 2013
  2. Cayote

    Cayote Aquatic Astronaut

    Your object file seems to be empty.
    Nah kidding, try and upload your starbound.txt file inside /starbound (it's an error log)
     
  3. HotLalonde

    HotLalonde Void-Bound Voyager

  4. Cayote

    Cayote Aquatic Astronaut

    Code:
     
    [LIST=1]
    [*]Error: Could not load /stargazer/biofuelgen/stargazer_plantcompressor.png:default asset, attempting to use default.
    [*]AssetException: No such frame default in frames spec /stargazer/biofuelgen/stargazer_plantcompressor.frames
    [/LIST]
    
    I'm seeing this error, maybe something wrong with your animations on the item?
     
  5. HotLalonde

    HotLalonde Void-Bound Voyager

    Nothing seems to be wrong with the animations though, I've tried making changes to it and it hasn't affected anything.

    One thing I noticed was that there was a section in the log saying this:
    Code:
    Error: VariantException: Variant type not map for get("gui"), is of type null
      007C4FE2 (C:/starbound/source/core/StarVariant.hpp:14)
      00751505 (C:/starbound/source/core/StarAny.hpp:488)
      00464A25 (C:/starbound/source/frontend/StarContainerInterface.cpp:19)
      ... (2)
      00404EF0 (C:/starbound/source/core/StarAny.hpp:488)
      00407357 (C:/starbound/source/client/StarClientApplication.cpp:368)
      0040A254 (C:/starbound/source/application/StarApplicationBase.cpp:199)
      00407C7F (C:/starbound/source/client/main.cpp:49)
      004DB911 (c:\SDL-1.2.15/./src/main/win32/SDL_win32_main.c:318)
    The only problem is I can't make much sense of it.
     
  6. Cayote

    Cayote Aquatic Astronaut

    Have you added a completely new UI are are you trying to use a current one? e.g furnace or crafting table.
     
  7. HotLalonde

    HotLalonde Void-Bound Voyager

    I rewrote the furnace one and I downloaded a few mods just to look at their codes to see if I was doing it right, so it's the same UI but with different sprites.
     
  8. Cayote

    Cayote Aquatic Astronaut

    Allright so I may have found something,

    Compate these two files one of a Furnace and one is yours, look where the brackets are located, (Highlighted by the "<<<")

    The furnace
    Code:
    {
      "gui" : {
        "background" : {
          "type" : "background",
          "fileHeader" : "/interface/objectcrafting/campfire_header.png",
          "fileBody" : "/interface/objectcrafting/campfire_body.png",
          "fileFooter" : "/interface/objectcrafting/campfire_footer.png"
        },<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        "toggleCrafting" : {
          "type" : "button",
          "position" : [5, 39],
          "base" : "/interface/objectcrafting/smelt.png",
          "hover" : "/interface/objectcrafting/smeltover.png"
        },
        "itemGrid" : {
          "type" : "itemgrid",
          "position" : [74, 37],
          "dimensions" : [1, 1],
          "spacing" : [19, 19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "outputItemGrid" : {
          "type" : "itemgrid",
          "slotOffset" : 1,
          "position" : [110, 37],
          "dimensions" : [1, 1],
          "spacing" : [19, 19],
          "backingImage" : "/interface/inventory/empty.png"
        },
        "pointer" : {
          "type" : "image",
          "position" : [96, 40],
          "file" : "/interface/objectcrafting/arrow.png"
        },
        "overlay" : {
          "type" : "image",
          "file" : "/interface/objectcrafting/campfire_shine.png",
          "position" : [-20, 20]
        }
      }
    }
    
    
    Your code
    Code:
    {
    "gui" : {
    "background" : {
    "type" : "background",
    "fileHeader" : "plantcompressor_header.png",
    "fileBody" : "plantcompressor_body.png",
    "fileFooter" : "plantcompressor_footer.png"
    }<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    },
    
    "toggleCrafting" : {
    "type" : "button",
    "position" : [5, 39],
    "base" : "compress.png",
    "hover" : "compressover.png"
    },
    
    "itemGrid" : {
    "type" : "itemgrid",
    "position" : [74, 37],
    "dimensions" : [1, 1],
    "spacing" : [19, 19],
    "backingImage" : "empty.png"
    },
    
    "outputItemGrid" : {
    "type" : "itemgrid",
    "slotOffset" : 1,
    "position" : [110, 37],
    "dimensions" : [1, 1],
    "spacing" : [19, 19],
    "backingImage" : "empty.png"
    }
    }
    
    Do you see the difference?

    Try using this code instead:

    Code:
    {
    "gui" : {
    "background" : {
    "type" : "background",
    "fileHeader" : "plantcompressor_header.png",
    "fileBody" : "plantcompressor_body.png",
    "fileFooter" : "plantcompressor_footer.png"
    },
    
    "toggleCrafting" : {
    "type" : "button",
    "position" : [5, 39],
    "base" : "compress.png",
    "hover" : "compressover.png"
    },
    
    "itemGrid" : {
    "type" : "itemgrid",
    "position" : [74, 37],
    "dimensions" : [1, 1],
    "spacing" : [19, 19],
    "backingImage" : "empty.png"
    },
    
    "outputItemGrid" : {
    "type" : "itemgrid",
    "slotOffset" : 1,
    "position" : [110, 37],
    "dimensions" : [1, 1],
    "spacing" : [19, 19],
    "backingImage" : "empty.png"
    }
    }
    }
     
  9. tifel100

    tifel100 Void-Bound Voyager

    That probably is the problem, as it closes the "gui" with that.
     
  10. Cayote

    Cayote Aquatic Astronaut

    Exactly, all the other properties will not be caried to the "gui" tag.
     
  11. HotLalonde

    HotLalonde Void-Bound Voyager

    Okay so I corrected that, or at least I think I did. I'm probably missing something.
    Code:
    {
        "gui" : {
            "background" : {
                "type" : "background",
                "fileHeader" : "plantcompressor_header.png",
                "fileBody" : "plantcompressor_body.png",
                "fileFooter" : "plantcompressor_footer.png"
            },
    
            "toggleCrafting" : {
                "type" : "button",
                "position" : [5, 39],
                "base" : "compress.png",
                "hover" : "compressover.png"
            },
    
            "itemGrid" : {
                "type" : "itemgrid",
                "position" : [74, 37],
                "dimensions" : [1, 1],
                "spacing" : [19, 19],
                "backingImage" : "empty.png"
            },
    
            "outputItemGrid" : {
                "type" : "itemgrid",
                "slotOffset" : 1,
                "position" : [110, 37],
                "dimensions" : [1, 1],
                "spacing" : [19, 19],
                "backingImage" : "empty.png"
            }
        }
    }
    It still crashes with the same error though.
     
  12. tifel100

    tifel100 Void-Bound Voyager

    Did you try to use the same object from the same save? Try crafting or obtaining another plant compressor or w/e it's called and place it down and interact. Sometimes things are stored in saves. I had 2 of the same gun with 2 different properties in 1 save.
     
  13. Cayote

    Cayote Aquatic Astronaut

    If all the files are correct and the images are all correct too, I the only thing I can say is that you're missing "pointer" and "overlay" in your code compared to the stonefurnace but I'm 100% unsure about it's importance.
     
  14. Cayote

    Cayote Aquatic Astronaut

    Oh yes also this, make sure you create a new compressor every time you alter the code.
     
  15. HotLalonde

    HotLalonde Void-Bound Voyager

    Nope, nothing changed. It still crashes whenever I try to interact with it, whether it's newly crafted or an old object.
     
  16. Pinchy

    Pinchy Subatomic Cosmonaut

    All I did was:

    - Went to Starbound\assets\interface\crafting
    - Copied craftingtable.png and craftingbody.png
    - Placed them in my mod folder structure
    - Renamed them to match my crafting table
    - Copied the woodencraftingtable.config file and renamed it to match my custom table
    - Renamed the image links within the new config file to match the png names I made

    Interacting with the table crashed to desktop with no error and no persistant starbound.exe that didn't close properly.

    The table works fine in every aspect with no config edits.
     

Share This Page