Modding Help Tent Recipes

Discussion in 'Starbound Modding' started by kitsunespirit, Dec 16, 2013.

  1. kitsunespirit

    kitsunespirit Cosmic Narwhal

    So I discovered that theres no recipe (that I could find) for making tents... and it bugs me. Because whipping out a four-poster bed on an alien planet makes me lol.

    I'd make it myself, but I don't know what to do, I can mod stuff if I have a reference (like someone elses mod), but I dont know how to do it from scratch.

    Do I just find the tent files in the assets and build a recipe file referencing the tent file?
     
  2. vernadead

    vernadead Big Damn Hero

    Should work as long as you put it in a custom player.config

    As well as a mod info file

    So
    Starbound/mods/yourtentmodname
    -tentmodfolder
    ---tent.recipe
    -player.config
    -tentmod.modinfo

    You can use notepad++ for the files
     
    Last edited: Dec 16, 2013
    kitsunespirit likes this.
  3. ejh1990

    ejh1990 Phantasmal Quasar

    OK, so firstly you need a recipe file in the recipe folders. It doesn't seem to matter which sub-folder, but best keep to one that is logical. For example, if you want it to be a tier1 item, best put it in the tier1 folder.

    So first, the whole recipe might look like this:

    Code:
    {
      "input" : [
        { "item" : "fabric", "count" : 10 },
        { "item" : "money", "count" : 50 }
      ],
      "output" : { "item" : "tent1", "count" : 1 },
      "groups" : [ "spinningwheel", "furniture", "all" ]
    }
    So first, we start the file (and end the file) with curly braces. This is because the recipe is a JSON object. You will also notice that there are three key parts to the recipe... The "input", the "output", and the "groups".

    Let's look at "input" first. Recipes contain one ore more items, so they are stored as an array. An array is marked with the square bracket. And each item is it's own object (curly brace, for object, remember?) within the array. This example has 2 items required to make the tent: fabric, and pixels (money). The recipe also specifies how many of each item is required... 10 fabric, and 50 pixels.

    As an aside, you will notice that the values come in pairs... First comes the string, then comes its value. These are separated by a colon. Also, unless you are dealing with an integer, most values are put in quotation marks.

    Turning the attention to the output, there's only one item. So it doesn't need an array. However, the value of the output is an object, so it needs its own curly braces. Can you see how it's similar to the input? Yep, there's an "item" value, but this time it's "tent1", because that's what we want to give the player. And "count" is how many. You probably only want to give the player 1 tent, but if you wanted to give the player 9001 tents, the output line would read:

    Code:
    "output" : { "item" : "tent1", "count" : 9001 },
    Now, the important bit. The "groups" string not only stores the type of item that it is, but also where it can be crafted. In the example, you would need to use the yarn spinner to craft the tent. If you wanted to craft it at an anvil, it'd be:

    Code:
    "groups" : [ "anvil", "furniture", "all" ]
    Or if the tent were delicious food, it would be:

    Code:
    "groups" : [ "spinningwheel", "foof", "all" ]
    You will also notice the square brackets again. That's because there's more than one value for the "groups" string, so it needs to be an array.

    The commas, if you are wondering, come after each value in an array, and at the end of every object and array except for the last object/array in each part the JSON sandwich.

    Once we have the recipe saved, we have one last thing to do... Open player.config (make a copy for your mod, and don't directly edit the one in the assets folder), Find this part:

    Code:
     "defaultBlueprints" : {
    Then find the tier that you want it to be available to. If you want it available to craft right off the bat, that'd be tier1. And if you notice, each tier has its own array. Why? Because there's more than one recipe per tier. And each recipe is it's own object in the array. So how all you do is add:

    Code:
    { "item" : "tent1" }
    into the tier that you want. Remember to add a comma if it's not the last item in the array. If you don't add a recipe to the defaultBlueprints then the player won't be able to craft the item at all. (There are ways to make a recipe "learnable", but that's a different kettle of fish).

    You can repeat the above process for the other tent (tent2) if you wish. :)

    Make sure you check your JSON when you're done here: http://jsonsh.com/

    And if you want to know more about JSON in general: http://json.org/

    I know that this might have been a long-winded post, but hopefully it'll also help you understand what you're looking at. :)
     
    kitsunespirit likes this.
  4. kitsunespirit

    kitsunespirit Cosmic Narwhal

    Thanks for the help, what is "unrefined wood" called in the files? I can't seem to find it.

    Or would I just put "unrefinedwood" In the recipe?

    Ok found "fullwood2" that references unrefined wood, but what would I put?

    And another thing, I am making 2 tiers of tents, the second tier I want to use copper (for the frame), so again, would I just use "copper" or what?
     
    Last edited: Dec 16, 2013
  5. vernadead

    vernadead Big Damn Hero

    Not sure about wood but it's copperbar

    Edit: looked up the crafting recipe file for the campfire, its fullwood1
     
    kitsunespirit likes this.
  6. kitsunespirit

    kitsunespirit Cosmic Narwhal

    Could someone look this over for me? They aren't showing up in the crafting table.

    Note: I didnt include a player.config, but I do have the recipes added to the tiers I want them in.

    I'm probably missing something ridiculously basic, but I cant figure out what it is.
     

    Attached Files:

  7. vernadead

    vernadead Big Damn Hero

    You have an item list
    you need to put commas at the end of each but the last item
    once I fixed that it works for me
     
  8. kitsunespirit

    kitsunespirit Cosmic Narwhal

    Umm... the spaces are in every config file I have looked at... if thats what youre saying.

    Otherwise I dunno what you're showing me since it looks the same as my file.
     
  9. vernadead

    vernadead Big Damn Hero

    [​IMG]


     
  10. kitsunespirit

    kitsunespirit Cosmic Narwhal

    *facepalm*
     
  11. vernadead

    vernadead Big Damn Hero

    Lol, my mod had it way worse than yours with missing commas, misspellings all over the place.
    enough errors to drive a glitch to self destruct. I had someone look over my mod and it took them like an hour to fix through it.
     
  12. kitsunespirit

    kitsunespirit Cosmic Narwhal

    Thanks so much for your help! It works... now I am just gonna edit the icons, and I'll upload it. :D
     

Share This Page