Modding Help [SOLVED] Adding modded items to the right tab of a crafting station?

Discussion in 'Starbound Modding' started by Coolguy123, Apr 13, 2018.

  1. Coolguy123

    Coolguy123 Scruffy Nerf-Herder

    I have no idea how to find the groups name of the crafting medical station and i want to replace the items from the vanilla but the .patch method didn't worked...?
    I am sure i did something wrong but i didn't find any tutorial explaining how to know the codding name of the groups.
    So i want to know in short:
    -how to make the item race specific
    -replace the salve or just delete the salve
    -how to place it in the correct tab in a crafting station

    Here is something ONLY for florans even though it appears on all races:
    Code:
    {
      "itemName": "rhi_flowerextract",
      "rarity": "Common",
      "price": 10,
      "category": "medicine",
      "inventoryIcon": "rhi_flowerextract.png",
      "description": "A petal mixture for healing minor wounds learned from the elders.Restores 50 health over 10 seconds.",
      "shortdescription": "Flower Extract",
      "effects": [
        [
          {
            "effect": "salveheal"
          }
        ]
      ],
      "emote": "",
      "race" : "floran",
      "emitters": [
        "bandageuse"
      ],
      "blockingEffects": [
        "salveheal",
        "bandageheal",
        "medkitheal",
        "nanowrapheal"
      ]
    }
    I thank you in advance! :)
    https://imgur.com/a/q9Gqp
     
  2. ToddAndChips

    ToddAndChips Tentacle Wrangler

    Hi Coolguy123,

    I'm not an experienced modder but I think I might be able to help a little!

    I was pointed to a .patch file building resource yesterday by projectmayhem (a very helpful forum roamer!) which can be used to create .patch files by inputting the existing code into the left box, and then inputting what you want the code to look like in the right box. It then writes a patch file for you - this might be of use to you for your future patching needs! https://chbrown.github.io/rfc6902/

    With regard to the crafting station, I believe the item recipe file would have to contain either the group "craftingmedical" or "craftingmedical2" to appear within the medical crafting station. Following that, I think it then needs to contain either "healing" or "buffs" to appear within the tabs within the medical station. So supposing you wanted this recipe to be available in only the tier 2 crafting station in the buffs category, you'd use a line something like this:

    Code:
     "groups" : [ "craftingmedical2", "buffs" ]
    Exchanging "craftingmedical2" to "craftingmedical1" will mean the item will be craftable in both tiers of medical station (I think, anyway). Exchanging "buffs" for "healing" will result in the item appearing in the healing tab instead.

    So if we take the recipe file from, for example, burn spray, we can see where all the relevant info is:

    Code:
    {
      "input" : [
        { "item" : "copperbar", "count" : 1 },
        { "item" : "cryonicextract", "count" : 1 }
      ],
      "output" : {
        "item" : "burnspray",
        "count" : 1
      },
      "groups" : [ "craftingmedical2", "healing" ]
    }
    
    This file is called burnspray.recipe, and this file is located in /recipes/medicaltable2/healing, so within your mod you'd need to base your recipe off this information and alter it accordingly (e.g. if it's to appear in the tier 1 medical table, you'd need to place it within /recipes/medicaltable1/healing). In your case, I'd assume you'd be calling it rhi_flowerextract.recipe and placing it in the healing folder of whichever medical station you choose.

    Once you have your recipe file sorted with the correct groups and the file is in the right location, we can look at adding the recipe to the player's known blueprints by patching the player.config file. This patch will need to be located in the root directory, as it will be adding to the existing player.config file in your game.

    So for the sake of clarity, I'll use your item name (rhi_flowerextract) to create this patch. All we'd need to do is add it to the player.config default blueprints list. Let's use the tier 1 blueprints for now.
    Code:
    [
    {
    "op" : "add",
    "path" : "/defaultBlueprints/tier1/-",
    "value" : { "item" : "rhi_flowerextract" }
    }
    ]
    
    This file should be named player.config.patch and located in the root directory. All that's doing is adding the recipe file to your available blueprints, which you will have hopefully called "rhi_flowerextract", which basically means it'll appear in the relevant crafting stations that we defined in the recipe file under the "groups" line.

    Now because I'm still new to modding myself and I only have a limited understanding, I'll try to have a quick look into what makes an item race specific, and I'll have a brief dig around to see how you'd go about replacing the existing salve. Before I do, would you mind clarifying a couple of things for me?
    Firstly, do you wish to just replace the image of the salves, or are you hoping to replace how the salves are created in your inventory?
    Secondly, the code you posted above - where is that located and what is the file called?
     
    Coolguy123 likes this.
  3. slowcold

    slowcold Pangalactic Porcupine

    If you want to make it race specific, patch the floran.species file - NOT the player.config file.

    This will add the recipe to florans only.
     
    Coolguy123 and ToddAndChips like this.
  4. ToddAndChips

    ToddAndChips Tentacle Wrangler

    Ahh, well there ya go! Never looked into those files before as I never did species stuff - looks like the .patch file contents would be fine, as long as it's renamed to floran.species.patch and located in /species :)
     
    Coolguy123 likes this.
  5. Coolguy123

    Coolguy123 Scruffy Nerf-Herder

    Hello ToddAndChips,

    Thanks a LOT for clearing this out.
    I had this thing about different races having different healing items (different texture and different crafting recipe) that do the exact healing as the vanilla ones.
    I already made all the textures.
    Ex for the Novakid. geWuzeZ.png <-Spark Blazing Rug.png <-Burning rug ChargeKit.png <-Charge Kit NanoPlasma.png <-Nanoplasma
    Ex for the Floran. rhi_flowerextract.png <-Flower Extract PlantRemedy.png <-Plant Remedy GreenKit.png <-Green Kit NanoSeed.png <-NanoSeed
    You see where all this is going? :)
    I will try now to see how i can do this after your super TUTORIAL :)
    You are the best!

    The code is placed like this (all the items exist in the game they just don't overwrite the other ones){except for the flowerextract that appears in the player "C" station handcraft items?} Image.png
     
    Last edited: Apr 14, 2018
  6. ToddAndChips

    ToddAndChips Tentacle Wrangler

    Yup, I get where you're going! I believe it would be possible to remove the ability to craft the default healing items from the game using their recipe files. As far as I'm aware, there's a group in some recipe files called "plain". This group enables you to craft things in your hands (so without the requirement of a medical table for the default salve).

    So with this in mind, you could find the salve recipe file and make a patch file for that to prevent it from appearing in your crafting menu by removing all the groups from it. So using the salve.recipe file (which is located in /recipes/medicaltable1/healing) you could make, within your mod, a patch file that matches that folder structure called salve.recipe.patch, and have something like this in it:

    Code:
    [
    {
    "op": "remove",
    "path": "/groups"
    }
    ]
    
    Now I haven't tested that, but in theory, that should remove the groups line entirely from the salve, thus stopping it from being craftable at all in game (in hands and in medical tables). However, it would still be possible to find them in containers and suchlike - I'm not entirely sure how you'd go about removing them from spawning in the first place. But I think removing the groups should stop them from being craftable even after you pick one up and "discover" the blueprint for the first time.

    This of course can be applied to other items - just removing the "groups" line should prevent any item from showing up in any of the crafting menus.

    One thing I will note is that removing a recipe completely from the game might affect quests that require an item to be crafted (I'm not sure if there are such quests, I haven't played the game enough just yet to know).

    Is there anything I've missed or anything else you need a little help with? If I can help I'll happily carry on doing so!
     
    DrPvtSkittles and Coolguy123 like this.
  7. Coolguy123

    Coolguy123 Scruffy Nerf-Herder

    Thank YOU Todd ! You helped me so much on making this mod i have published recently!:) I will keep updating for most known modded races too!:)
    For an year i haven't had any idea how to implement what i wanted so this is like a dream come true ( even though it might seem to be a simple dream i like to achieve small goals rather than never finishing a big project) .[/QUOTE]
     
  8. ToddAndChips

    ToddAndChips Tentacle Wrangler

    That's no problem at all mate, glad I could help you out :)

    Happy modding!
     
  9. SkyeTheTerribleBeastie

    SkyeTheTerribleBeastie Pangalactic Porcupine

    How's the progress going? Wondering if more help was required, or if Solved already.
     
  10. Coolguy123

    Coolguy123 Scruffy Nerf-Herder

    Thanks for asking, but this thread has already been solved. I have actually posted my mod : Realistic Healing Items.
     
    ToddAndChips likes this.
  11. SkyeTheTerribleBeastie

    SkyeTheTerribleBeastie Pangalactic Porcupine

    Oh, ok, could you add (SOLVED) to the beginning of the thread title? Helps peeps like me whom are looking for peeps like you to help. :D
     

Share This Page