Modding Help Custom Item not showing

Discussion in 'Starbound Modding' started by Campaigner, Dec 9, 2013.

  1. Campaigner

    Campaigner Giant Laser Beams

    I recently downloaded a few mods to see how they were built, and I put them in my own game to see that they do indeed work. So, I went and copied the bare bones work, changing filenames and object names accordingly to match my custom item. I am simply creating a display item that has no use other than simply being visible, like a wall poster or an arcade. I have done the following for it:

    1. Created the sprite
    2. Created the object file, naming the item and doing all the technical stuff as seen in other display items.
    3. Created the frames file, matching the dimensions with my sprite's pixel dimensions
    4. Created the recipe file, and made sure it was in a tier that I could access for testing purposes
    5. Placed them all in a safe location inside my assets folder, but in one folder so that it will not be a hassle to remove
    6. Went to player.config, and placed my folder's name (//NAME) with the item in brackets as such { "item" : "newitem" },
    7. Opened the game and checked the crafting table (where I told it to go).

    Now, I have a problem; the sprites do not show. I can create my item, I can see my item and how it is NOT a perfectly generic item, and I can place some invisible 1-block object, but my custom sprite does not show.

    How do I get the sprite to show?
  2. Inconspicuous

    Inconspicuous Scruffy Nerf-Herder

    Post ze code.
    I have a hunch you missed something, if it's an object did you have this part filled out?
     "inventoryIcon" : "<ITEM NAME HERE>",
      "orientations" : [
          "dualImage" : "<ITEM NAME HERE>:<color>",
          "imagePosition" : [-12, 0],
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ],
          "collision" : "platform"
    Specifically the "item name here" are all the names correct?
  3. Campaigner

    Campaigner Giant Laser Beams

      "objectName" : "apexdecoy01",
      "rarity" : "Common",
      "category" : "decorative",
      "price" : "1500",
      "description" : "An Apex woman tied to a post.",
      "shortdescription" : "Captive Apex",
      "race" : "generic",
      "apexDescription" : " barbaric!",
      "avianDescription" : "Poor soul.",
      "floranDescription" : "Can Floran eat it?",
      "glitchDescription" : "Curious. Why is it tied up?",
      "humanDescription" : "That'll teach you to keep your paws off of me.",
      "hylotlDescription" : "It won't be escaping, from the looks of it.",
      "inventoryIcon" : "decoyprincessicon.png",
      "orientations" : [
          "dualImage" : "decoyprincessapex01.png:<color>",
          "imagePosition" : [-16, 0],
          "frames" : 1,
          "animationCycle" : 1,
          "spaceScan" : 0.1,
          "anchors" : [ "bottom" ]
    This is the code. The png filenames are 100% correct, as I copy and pasted them from the actual filename to be certain. It's a static image without frames, if that matters.
  4. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    I had this problem earlier myself when creating a vending machine out of the gold_spawner. The frames file was causing the issue though you claim to have yours set and correctly. I do notice one thing that might help.

    Try changing this line:
    "dualImage" : "decoyprincessapex01.png:<color>"
    To this:
    "dualImage" : "decoyprincessapex01.png:<color>.<frame>"
    Last edited: Dec 9, 2013
  5. Campaigner

    Campaigner Giant Laser Beams

    Unfortunately, when I was moving my files last night, I was dumb and accidentally deleted my stuff. So, starting over today, I took a different approach;

    1. Copied an item (example; apexcoolshelf01)
    2. Pasted my image in there, leaving the original dimensions (48x48)
    3. Changed filenames and recipes. Used Doctor Ragnarok's solution.
    4. Item is available ingame like normal, but the wrong size. Takes up too much width. (original image is 16x48)
    5. Change the size in the frames from 48x48 to 16x48
    6. Item becomes invisible ingame, unlike when it was 48x48.

    So, I accidentally made progress, yet also came to a similar problem. My image will only show if I keep the dimensions the same as the original image, which is too big. How can I fix that?

    EDIT 1: I made two items using the apexcoolshelf01 as the base. The first one, a shelf with poop on it, displays properly ingame. The second image, using three of my image to fill the 48x48 dimensions, does not show. All I did was change the filename in the "dualImage" : "!FILENAME!:<color>.<frame>", spot. I tried replacing another image by overwriting it, and it shows. Creating the item using the exact same parameters does not work.
    Last edited: Dec 9, 2013
  6. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    Try returning the frames to 48,48, and remove the frame tag I supplied from the object file. Since the original decoyprincess is a wire objectType, it may take other things into account such as the frame tag, where a decorative item may not need it. Though this might be simpler to diagnose if you provided a zip of your files as they are.
  7. Campaigner

    Campaigner Giant Laser Beams

  8. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    Part of the problem is a missing icon file. Each of the object files reference icons that don't exist in your folder structure. You'll need a decoyprincess01icon.png and a decoyprincess02.png, referenced accordingly. It only fixes half the problem however, and I'll continue looking over it unless you solve it first.

    Edit: Solved it.

    The structure was inconsistent. In some areas you use decoyprincess, is others you use firstprincesses / secondprincesses. I renamed everything in the first set to firstprincesses and changed all the references to fit, and then it worked fine.

    Last edited: Dec 9, 2013
  9. EvilEngineer

    EvilEngineer Starship Captain

    If you created a custom file, check the encoding on the file. I ran into a number of issues with making new files as they were saving in UFT-8 with BSO, they need to be in UTF-8 without BSO or ANSI.
  10. Campaigner

    Campaigner Giant Laser Beams

    @Doctor Ragnarok: I've got them made now, so icons are no problem anymore.

    @EvilEngineer: I did have my encoding as ANSI, so I changed it to UFT-8 without BSO. Unfortunately, it did not fix the invisible sprite problem.

    This is infuriating. I got it to work with one thing, but it won't work with another. I'm losing my mind. I'm gonna be leaving soon to go visit a sick relative, so I probably won't catch replies right away for a few hours. If you can figure this out, I'll be so grateful since I fell asleep trying to fix it last night.

    EDIT: Wait, what? I'm looking at the structure, and I do not see what you mean Doctor Ragnarok. All of the stuff links as you said already.
  11. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    Just taking the first set as example, you have decoyprincess01.png, firstsetprincesses.frames, and firstsetprincesses.object. Change the .png to firstsetprincesses.png and change the reference in the object file. Your frames file didn't know where to look because the names were not consistent. Adding firstsetprincessesicon.png also solved the missing icon issue that I experienced when loading your mod as-is.
  12. Campaigner

    Campaigner Giant Laser Beams

    Oh man, that worked. I can't believe it was something that simple, and I can't believe I was that dumb to keep ignoring that. Thank you!
  13. Doctor Ragnarok

    Doctor Ragnarok Former Staff

    I didn't catch it at first either, though the only other experience I've had with .lua is with Garry's Mod. We all start somewhere, and we all make mistakes.

  14. Campaigner

    Campaigner Giant Laser Beams

    Very true. Mistakes are always bound to happen, and learning from them is part of how life goes on.

    Again, thank you.

Share This Page