tModLoader Tutorial: [2] Recipes

recipe.SetResult(moditem)
or
recipe.SetResult(mod, "ItemName")
Can this only be one of the modded item or can it be multiple?
When I tried to do this before with multiple of the modded item as a result, it gave me that one error where you try to change a null value to a non-null value.

EDIT: I figured out how to actually refer to a mod in a recipe, so nevermind this.
The error I was ACTUALLY getting was the "Mod does not exist in current context" error.
 
Last edited:
HELP. so I'm trying to make an item have an optional recipe. for example, the item is 5 gold the recipe if 1 dirt or 1 wood. you can choose whatever one. I cant make multiple recipes for that specific item tho because there are so many different options. I saw a mod where you could have multiple types of butterflies to make an item and it would scroll through all the different types. if anyone understands what I'm saying, please reply
 
HELP. so I'm trying to make an item have an optional recipe. for example, the item is 5 gold the recipe if 1 dirt or 1 wood. you can choose whatever one. I cant make multiple recipes for that specific item tho because there are so many different options. I saw a mod where you could have multiple types of butterflies to make an item and it would scroll through all the different types. if anyone understands what I'm saying, please reply
https://github.com/blushiemagic/tModLoader/wiki/Intermediate-Recipes sounds like you want recipegroups
 
what does the 5 * 60 after the BuffID.OnFire mean? Is it the time the debuff lasts, and if so, why is it formatted as two separate integers?
 
I keep getting this error:
c:\Users\Kieran Nolan\Documents\My Games\Terraria\ModLoader\Mod Sources\NalonMod\Items\StingerBlade.cs(31,33) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)
 
what does the 5 * 60 after the BuffID.OnFire mean? Is it the time the debuff lasts, and if so, why is it formatted as two separate integers?
The duration of the debuff is in ticks, which there are 60/second. This, a duration of 5 * 60 would be five seconds.
I keep getting this error:
c:\Users\Kieran Nolan\Documents\My Games\Terraria\ModLoader\Mod Sources\NalonMod\Items\StingerBlade.cs(31,33) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?)
Add [using Terraria;] (no brackets) to the top of your file if it isn’t there already.
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Stuff
{
    class BetterStart : ModRecipe
    {
        public BetterStart()
        {
           
            Properties = new ModProperties()
            {
                Autoload = true,
                AutoloadGores = true,
                AutoloadSounds = true
            };
        }

        public override void AddRecipes()
        {
           
            ModRecipe recipe = new ModRecipe(this);
            recipe.AddIngredient(3507, 1);
            recipe.AddTile(18);
            recipe.SetResult(3504);
            recipe.AddRecipe();
           
            recipe = new ModRecipe(this);
            recipe.AddIngredient(3507, 1);
            recipe.AddTile(18);
            recipe.SetResult(739);
            recipe.AddRecipe();
           
            recipe = new ModRecipe(this);
            recipe.AddIngredient(3507, 1);
            recipe.AddTile(18);
            recipe.SetResult(1309);
            recipe.AddRecipe();
           
            recipe = new ModRecipe(this);
            recipe.AddIngredient(3507, 1);
            recipe.AddTile(18);
            recipe.SetResult(3508);
            recipe.AddRecipe();
        }
    }
}

I am typing this into my file but it says on the public override AddRecipes() it says no suitable method was found to override.
 
I'm having trouble adding a recipe for fishing. Like I want my item to be obtained via fishing. I would've thought it would have been able to be done with recipes (though it might not and if that's the case I apologize in advance if i asked in the wrong thread), but i can't find any info on that anywhere online. Help would be much appreciated.
 
I have one mod that I created, and I want to create an addon mod for it. However, I do not know how to use items from my other mod, in the new mod.
The recipe for a weapon in the second mod is all good except for the recipe line where I attempt to use an item from the first mod. Anybody know how to do this?
 
I have one mod that I created, and I want to create an addon mod for it. However, I do not know how to use items from my other mod, in the new mod.
The recipe for a weapon in the second mod is all good except for the recipe line where I attempt to use an item from the first mod. Anybody know how to do this?
recipe.AddIngredient("OtherModInternalName", "ItemClassName");
 
But how would you go about making a recipe that gives two items when crafted? Like smelting, you'd get the smelted ore that you want, but you would get the leftover "slag" too.
 
But how would you go about making a recipe that gives two items when crafted? Like smelting, you'd get the smelted ore that you want, but you would get the leftover "slag" too.
It's impossible my man. Terraria recipes aren't meant to make several items.
You would need to make some kind of tile that when you put an item into it will for example deposit the slag and something else into a built in slot for them or a chest nearby.
Check out the 'blast furnace' from immersive Engineering, it's a minecraft mod and it does exactly that.
 
It's impossible my man. Terraria recipes aren't meant to make several items.
You would need to make some kind of tile that when you put an item into it will for example deposit the slag and something else into a built in slot for them or a chest nearby.
Check out the 'blast furnace' from immersive Engineering, it's a minecraft mod and it does exactly that.
Can’t you just use a GlobalRecipe’s OnCraft method to spawn the item?
 
Back
Top Bottom