Modding Help Spawner help

Discussion in 'Mod Releases & Modding Help' started by Malicante, Dec 14, 2013.

Modding Help Spawner help

Discussion in 'Mod Releases & Modding Help' started by Malicante, Dec 14, 2013.

  1. Malicante

    Malicante Space Penguin Leader

    So a few days ago, I found a chef spawner in a chest, and eager to have a chef for my Hylotl village, I plunked it down, warped to my ship and back, only to find that it was a Floran. Annoyed, I killed her, being the only Floran in a large, Hylotl village. Afterwards I learned you can't craft them, and the race chosen is random from a list. I intend to change that, with a mod I have begun working on today, to fix this issue.

    However, I have never done anything like this before, and while I am capable of learning how to understand the code Starbound is written in, I have to have some questions answered before I put my first foot forward.

    1. While I understand it, some things in the code elude me, such as what I can set "collision" to, and what "dualimage" does.

    2. Where is the data for shops saved at? For example, I want to customize the tool shop to replace "Rope" with "Climbing Rope", or to customize how much of what each vendor sells (Like the frog merchant and his 1x bomb or 15x bomb items).

    Thank you in advance.
      Last edited: Dec 15, 2013
    • Malicante

      Malicante Space Penguin Leader

      I've now got an issue, in that I can craft the spawner, but when I put them down (other than the blank one) they're invisible. I can see the item when I craft it, I can see where I'm putting it down, but when I put it down it's invisible. if I use my drill and hit where I put it I get the spawner back. Can anyone assist me in what might be happeneing?
      • vernadead

        vernadead Star Wrangler

        did you edit the original spawner file itself?
        • Malicante

          Malicante Space Penguin Leader

          No, I haven't. I copied it to another folder and edited it with my changes, changing the name, png, icon, and making a different recipe file for them. Would posting my code here help any?
            Last edited: Dec 14, 2013
          • tifel100

            tifel100 Sandwich Man

            Yea, you probably put the image in the wrong place, or have an incorrect name for it in the code.
            • Malicante

              Malicante Space Penguin Leader

              The strange thing is, when I used the same format (with a minor change from category wire to category decoration) It works, I can place it but then it does nothing. Now my Blank Spawner is set that way because it's just that, an empty.

              Code:
              {
                "objectName" : "spawnerblank",
                "rarity" : "Common",
                "description" : "A blank spawner.",
                "shortdescription" : "Blank Spawner",
                "race" : "generic",
                "printable" : false,
                "category" : "decorative",
                "price" : "500",
              
                "apexDescription" : "Even Big Ape cannot create life like this.",
                "avianDescription" : "Does this... make me like Kluex?",
                "floranDescription" : "Floran not know what thisss doesss.",
                "glitchDescription" : "Imaginative. I wonder what I can create with this?",
                "humanDescription" : "With this, I can make anything I want!",
                "hylotlDescription" : "A chance at creating an artistic life.",
              
                "inventoryIcon" : "spawnericon.png",
                "orientations" : [
                  {
                    "image" : "spawner_blank.png",
                    "imagePosition" : [-8, -8],
              
                    "spaceScan" : 0.1,
                    "anchors" : [ "bottom" ]
                  }
                ]
              }
              
              when I place this in the world, it does exactly what I want, it shows up, I can walk away from it, and come back, and it's still there.

              Now when I use the normal spawner code but change it to this:

              Code:
              {
                "objectName" : "hylotlvillager",
                "rarity" : "Common",
                "objectType" : "wire",
                "description" : "Spawn your very own Hylotl villager!",
                "shortdescription" : "Hylotl Villager",
                "race" : "generic",
                "printable" : false,
                "category" : "spawner",
                "price" : "300",
              
                "apexDescription" : "Spawning Hylotls. Uh... maybe later.",
                "avianDescription" : "I'll have to take care not to use this too often.",
                "floranDescription" : "Floran sssummon fishman right into sssword!",
                "glitchDescription" : "Insincere. A Hylotl gathering would be just wonderful.",
                "humanDescription" : "Well, I guess one Hylotl wouldn't hurt...",
                "hylotlDescription" : "What joy! I can finally surround myself with culture again.",
              
                "inventoryIcon" : "spawnericon.png",
                "orientations" : [
                  {
                    "image" : "hylotlvillager.png",
                    "imagePosition" : [-8, -8],
              
                    "spaceScan" : 0.1,
                    "anchors" : [ "bottom" ]
                  }
                ],
              
                "scripts" : [ "/objects/spawner/spawners/spawner.lua" ],
                "scriptDelta" : 1,
                //6000,
              
                "animation" : "/objects/spawner/spawners/hylotl.animation",
              
                "animationParts" : {
                  "switch" : "spawner_hylotl.png"
                },
                "animationPosition" : [-8, -8],
              
                "inboundNodes" : [ ],
                "outboundNodes" : [ ],
              
                "spawner" : {
                  "searchRadius" : 32.0,
                  "npcSpeciesOptions" : ["hylotl"],
                  "npcTypeOptions" : ["villager"],
                  "npcParameterOptions" : [
                    {
                      "dropPools" : []
                    }
                  ]
                }
              
              }
              
              To make a Hylotl Villager spawner, I can see it in the crafting guide for the Tabula Rasa (no editing player.config) Mod, I can make the statue and the blank spawner, I can put them together into this spawner, which appears if I move my mouse around, but when I put it down, it's invisible. If I walk away from where it was put down and come back, there's no spawner, but a villager is in it's place, like I want.

              spawnericon is like defaulticon but wouldn't work how it was in the game normally, and the hylotlvillager.png is a recolored picture of the hylotl spawner, which may be the issue. I recolored it since I'm planning on breaking the spawners up into race/type, instead of dropping a stim spawner, which spawns any race, I'm making them specific, for those who want to build a village and not have to farm spawners.

              EDIT: Derp, forgot to add the source code for the Hylotl spawner.

              Code:
              {
                "objectName" : "spawnerhylotl",
                "rarity" : "Common",
                "objectType" : "wire",
                "description" : "Spawn your very own Hylotl villager!",
                "shortdescription" : "Hylotl Spawner",
                "race" : "hylotl",
                "printable" : false,
                "category" : "spawner",
                "price" : "300",
              
                "apexDescription" : "Spawning Hylotls. Uh... maybe later.",
                "avianDescription" : "I'll have to take care not to use this too often.",
                "floranDescription" : "Floran sssummon fishman right into sssword!",
                "glitchDescription" : "Insincere. A Hylotl gathering would be just wonderful.",
                "humanDescription" : "Well, I guess one Hylotl wouldn't hurt...",
                "hylotlDescription" : "What joy! I can finally surround myself with culture again.",
              
                "inventoryIcon" : "defaulticon.png",
                "orientations" : [
                  {
                    "image" : "spawner_hylotl.png",
                    "imagePosition" : [-8, -8],
              
                    "spaceScan" : 0.1,
                    "anchors" : [ "bottom" ]
                  }
                ],
              
                "scripts" : [ "/objects/spawner/spawners/spawner.lua" ],
                "scriptDelta" : 1,
                //6000,
              
                "animation" : "/objects/spawner/spawners/hylotl.animation",
              
                "animationParts" : {
                  "switch" : "spawner_hylotl.png"
                },
                "animationPosition" : [-8, -8],
              
                "inboundNodes" : [ ],
                "outboundNodes" : [ ],
              
                "spawner" : {
                  "searchRadius" : 32.0,
                  "npcSpeciesOptions" : ["hylotl"],
                  "npcTypeOptions" : ["villager"],
                  "npcParameterOptions" : [
                    {
                      "dropPools" : []
                    }
                  ]
                }
              
              }
              
                Last edited: Dec 15, 2013
              • Malicante

                Malicante Space Penguin Leader

                This is frustrating. I've scanned over what I've changed and the original, tested both, and no matter what I change, I cannot get this to work! I tried changing the name of the object (making sure it lined up with the recipe name and PNG) and I get the same result. Can see it in the Tabula Rasa, can craft it, can place it, but it vanishes on placement. I can pick it back up, or if I leave the area it still makes a Hylotl Villager spawn where the spawner was. I just can't get it to appear visually in the world.

                I have to be doing something stupid. For those who have a good grasp on this system, can you please take a look at what I have and slap me in the right direction? Otherwise, I'll go ahead and mark this up as a failure, and start from scratch again.

                  Attached Files:

                  Last edited: Dec 15, 2013
                • Heliostorm

                  Heliostorm Starship Captain

                  I don't think you created a new .animation file, you probably need to do that and aim it at the correct images, the one your file is referencing uses the Starbound spawner images.
                  • Malicante

                    Malicante Space Penguin Leader

                    No, I didn't make a new .animation file, mainly because I didn't know I needed one. Does this mean I will also need a .frames file too? And how do I go about making them for items which have no frames/animation? (It just sits there.)
                    • Heliostorm

                      Heliostorm Starship Captain

                      I don't think so, the hylotl.animation just uses the same png twice. Right now I think you have two conflicting calls, one to your png, and one to the spawner_hylotl.png. I would try making a copy of the hylotl.animation file and renaming it and the references inside, and seeing if it works.
                      • Malicante

                        Malicante Space Penguin Leader

                        Thank you, I'm gonna try this right away, and hope it fixes it. I'd really rather get to making the doctor, stims, chef, tools, and such spawners to a more controlled state so that we all can have our custom villages, complete with vendors that actually, you know, sell the things their species uses/consumes. After I get better with the coding I want to make weapon merchants, and make it possible to craft stalls for them to stand at, much like they do in game.
                        • severedskullz

                          severedskullz Cosmic Narwhal

                          Lots of things wrong with this.... your first code for spawner_blank is just a decoration item... it has no scripts attached to it. Only WIRE object types are allowed to have scripts attached to them...
                          DualImage is just a way of telling the game that the image is made up of 2 parts... usually with an animated part (think of the player, and his arms)

                          for the invisiblilty issue, you are likely not doing a correct animation and frame selction.
                          "animation" : "/objects/spawner/spawners/hylotl.animation"
                          ^ That confirms you are using the wrong animation. The animation file is likely calling the wrong png file and that is why you arent seeing an image.


                          Hop on ##starbound-modding on IRC and we can help out :)
                          • Malicante

                            Malicante Space Penguin Leader

                            heh, will do. It'll be easier to explain some things there as well.

                            Also, spawner_blank is supposed to be a deco item, as it does nothing on it's own. Consider it as a placeholder when manually building villages through spawners. you can put it down in a place you want something later.

                            EDIT: Wow, I haven't used an IRC program in so long I've forgotten how. :facepalm:

                            EDIT2: Nevermind, I figured it out.
                              Last edited: Dec 15, 2013

                            Share This Page