Modding Help Multiple Recipes, Different Craft Times

Discussion in 'Starbound Modding' started by Shakar, Nov 30, 2016.

  1. Shakar

    Shakar Phantasmal Quasar

    Hey, I rarely make a post here but I looked up my issue and couldn't find it in the search...

    My issue, as you can possibly infer from the title, is that I'm having an issue with using recipes that are identical except for the crafting times. What I'm doing, is that I'm making a mod that will modify part of the crafting experience to one that better suits my play style.

    With three furnaces, I'm trying to make it so that each furnace is either better or worse than the one before/after it. In this case, Primitive is worse than Industrial, which is worse than Atomic. So, looking around a little I then proceeded and made the necessary changes/additions.

    Changing the vanilla recipes to be usable by only my modified atomic furnace gives me no issues, had to make a set for the industrial, and then another set for the primitive. The custom recipes of mine are the ones for the Primitive Furnace (My tier 1) and the Industrial Furnace (my tier 2) with a .patch going to the vanilla furnace recipes to use for the Atomic one.

    The issue is this... Out of the three furnaces, which each work similar to the Refinery in terms of function, only one of the three work despite no errors given at all for anything relating to my mod. I've checked the recipes, I've checked their groups, checked the spelling, but no matter what I do only one of the three sets of recipes work. The vanilla recipes which I've restricted to my tier 3 furnace won't work, and the custom recipes for my tier 1 won't work either despite being identical save for group and duration as the tier 2 ones of mine which do work.

    I thought it may have been a group thing at first, however that is not the case as my furnaces do use the groups for the various recipes.

    shakosfurnace1 for Primitive
    shakosfurnace2 for Industrial
    shakosfurnace3 for Atomic

    My code below uses the copper bar as the example as that is what I'm working with to test them.
    Code:
    My Tier 1 recipe for Primitive Furnace
    
    {
      "input" : [
        { "item" : "copperore", "count" : 2 } ],
      "output" : { "item" : "copperbar", "count" : 1 },
      "duration" : 2.25,
      "groups" : [ "shakosfurnace1", "bars", "all" ]
    }
    Code:
    My Tier 2 recipe for Industrial Furnace.
    
    {
      "input" : [
        { "item" : "copperore", "count" : 2 } ],
      "output" : { "item" : "copperbar", "count" : 1 },
      "duration" : 1.50,
      "groups" : [ "shakosfurnace2", "bars", "all" ]
    }
    Code:
    Vanilla (Now tier 3 recipe for my mod)
    
    [
      {
        "op": "replace", "path": "/duration", "value": 0.75
      },
      {
        "op": "replace", "path": "/groups/0", "value": "shakosfurnace3"
      }
    ]
    So above, the only things that are different are the groups and duration lines. My furnaces uses their respective groups for their tier.

    The issue is, however, despite the Industrial furnace itself working with it's tier 2 remodel for my mod, the Primitive and Atomic Furnaces don't work with their remodels in my mod despite using the same coding save for the names, description, art, and recipe groups (essentially clones of the Refinery).


    The only thing I can think of for why my tier 1 and tier 3 (vanilla) recipes won't work, is because the game appears to be looking at the inputs/outputs to make it's recipe judges? So if a item needs two copper ore to make a copper bar, it'll use that recipe. Then if it finds another recipe using the same inputs, it'll use that instead thus overwriting the previous version it found, and then overwrites that one with the third one it finds (This case being my tier 2 since it's later file wise) despite the key differences in the recipe files being the Duration (Vanilla will have a 0.75 duration in my mod, tier 2 has a 1.50 duration, and tier 1 has a 2.25 duration) while ignoring the groups and duration lines. Is this the case?

    The log file, as mentioned earlier doesn't show any errors relating to the recipes or furnaces so any help in solving this would be greatly appreciated.

    The goal of what I am trying to do, is have a set of furnaces that craft at different speeds. Tier one being the slowest, followed by 2, and then 3 with 3 being the fastest.
     
  2. lazarus78

    lazarus78 The Waste of Time

    IIRC, recipes are based on the output item, so having more than one with the same output item basically overwrites each one, and thus no error is created because as far as the game can tell, there is nothing wrong. Ive never tried it myself, but in my attempts to go other things, that is how I have come to understand it. Could be wrong.
     
  3. Shakar

    Shakar Phantasmal Quasar

    They appear to be input and output based alone from what I've gathered, not just output. I can have an input of 4 ores and get an output of 2 bars and they will show up with the vanilla recipe (Long as I name the file differently) allowing multiple recipes in the form of outputs/inputs based on count, but my issue is basically the game appears to be ignoring the duration and groups lines in the recipe files to make them separate recipes even though the count part alone suggests you can have multiple recipes but those seem to be restricted on input:count/output:count =\
     
  4. IHart

    IHart Scruffy Nerf-Herder

    from dealing with a similar issue i found a solution in making sure the recipe name matched the output item name. I hope this helps you, but if it doesn't i'd be happy to help you tinker with it if you would like to share your files so far.
     
  5. Shakar

    Shakar Phantasmal Quasar

    Since I'm trying to have three separate recipes all available at once for the same item, would that even be possible? Wouldn't the game just overwrite the vanilla file of the same name and the modded file with the later modded file it finds?

    My goal is to have 3 usable copper recipes with the same input and output, but the difference being time it takes to make them and which furnace uses which recipe that isn't in the form of a crafting table (Like how the smelting used to be back when the game first entered early access in the early koala builds).
     
  6. IHart

    IHart Scruffy Nerf-Herder

    you put them in separate folders and this will not be a problem at all. look in /recipes/pixelcompressor

    edit: on further testing i discovered that the instructions in my initial post are not actually necessary, so i'm unsure why my recipes were not working or how i actually fixed them.
     
    Last edited: Dec 3, 2016
  7. Shakar

    Shakar Phantasmal Quasar

    Well, I commend you trying to help at least but even different file names doesn't work. I naturally put my custom recipes with their own file names. In this case, my files begin with shakos followed by what the item is. In the case of my multiple furnaces, I've only two real custom recipes for each item. So, there would be the modified vanilla recipe (My tier 3), then shakoscopperbar1.recipe (My tier 1), and lastly shakoscopperbar2.recipe. The only difference between all three of the recipes are the groups (craftingfurnace3 changed to shakosfurnace3 for vanilla which my tier 3 furnace uses, shakosfurnace1 and shakosfurnace2 for their respective furnaces of those tiers), and the duration of each one (Which affects how long it takes to smelt them in the old system.).

    As I said, I simply think maybe the game is saying that the recipes are only dictated by their input and output depending on when the file that loads the recipe loads... Vanilla first, then any mod files that uses the same exact input/output and disregards the group/duration differences. It doesn't care for file name, which it only uses that to load files in alphabetical order. In the case of copper bars which I used to test my mod, it loaded the vanilla bar, patched it, then found my mod files that had the same input/output and thought that was supposed to be the right recipe instead of what was loaded already, hence overwriting it.
     
  8. IHart

    IHart Scruffy Nerf-Herder

    to test this add 1 and 2 pixels to the others?
    i assume you are testing in admin, meaning all recipes unlock, but are the recipes added to the default recipe list?
     
  9. Shakar

    Shakar Phantasmal Quasar

    The only issue with using pixels for how I am doing the crafting in my mod is that you cannot put pixels into the input. As I said my crafting stations here are similar to the refinery. Reason being is that the refinery is the only object I was able to think of in the game that was still using a old style crafting mechanic which the original smelter used when the game first went into Early Access on Steam. yes it may be able to produce pixels but you cannot put pictures into them. So having pixels as part of the cost to make the bars in the way that I am doing it will not work.
     

Share This Page