Take a look in DefBlacksmithy.cs at the top there is
public enum SmithRecipes

If you pick one of them such as
TrueSpellblade = 300,
and search for
TrueSpellblade

You'll find
C#:
        index = AddCraft(typeof(TrueSpellblade), 1011081, 1073513, 75.0, 125.0, typeof(IronIngot), 1044036, 14, 1044037);
        AddRes(index, typeof(BlueDiamond), 1032696, 1, 1044240);
        AddRecipe(index, (int)SmithRecipes.TrueSpellblade);
 
This what your wanting?

C#:
using System;

namespace Server.Items
{
    public class NewItemRecipe : RecipeScroll
    {

        [Constructable]
        public NewItemRecipe() : base( XXXX ) //replace XXXX with the number you use in the defcraft's public enum
        {}

        public NewItemRecipe(Serial serial)
            : base(serial)
        {}

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
 
That works but, doesn't work. It does create the recipe scroll, but it is unnamed and when double clicked it does not do anything.
Tried a few other things but got nowhere.
 
Did you replace NewItemRecipe with the name of your new item followed by Recipe?

Having that script and the example from above to whichever defcrafting your using making sure to have a unique number, and having a valid item for it to craft is everything I know to do with it.
 
Yes I did use the name of my item, a unique number and added it to the deftinkering. Even though I did that when created in game it didn't have the name on it and when double clicked it did nothing. So there is more that needs to be done to make it work.
 
I did play around with a bag before that adds a random recept. I rarely do new stuff sins T2A is my target area.

But anyway here is the code for it.

-Grim
 

Attachments

  • RecipeSatchel.cs
    1.5 KB · Views: 16
Thanks Grimoric for the help but that is not what I am looking for. I am looking to make a totally new recipe for a totally new item I created.
 
I just made a new recipe (had been going to make it for a while but just haven't till now). Here is what I did.

First I edited DefTinkering.cs as follows: (edits are marked with //Visam)

C#:
public enum TinkerRecipes
    {
        InvisibilityPotion = 400,
        DarkglowPotion = 401,
        ParasiticPotion = 402,

        EssenceOfBattle = 450,
        PendantOfTheMagi = 451,
        ResilientBracer = 452,
        ScrappersCompendium = 453,
        HoveringWisp = 454, // Removed at OSI Publish 103

        KotlPowerCore = 455,

        // doom
        BraceletOfPrimalConsumption = 456,
        DrSpectorLenses = 457,
        KotlAutomatonHead = 458,

        WeatheredBronzeArcherSculpture = 459,
        WeatheredBronzeFairySculpture = 460,
        WeatheredBronzeGlobeSculpture = 461,
        WeatheredBronzeManOnABench = 462,

        KrampusMinionEarrings = 463,
        EnchantedPicnicBasket = 464,

        Telescope = 465,
        EnchantedMobileForge = 10000 //Visam This is where I added it to. Don't forget the comma on the line above.
    }

Then I added it to the crafting part of the item still in DefTinkering.cs:
C#:
            //enchanted mobile forge //Visam
            index = AddCraft(typeof(EnchantedMobileForge), "Customs", "Enchanted Mobile Forge", 100.0, 150.0, typeof(KeyRing), "KeyRing", 2, "You need more Key Rings");
            AddSkill(index, SkillName.Blacksmith, 110.0, 150.0);
            AddSkill(index, SkillName.Mining, 110.0, 150.0);
            AddRes(index, typeof(PlatinumIngot), "Platinum Ingots", 350, "You need more Platinum Ingots");
            AddRes(index, typeof(PlatinumGranite), "Platinum Granite", 40, "You need more Platinum Granite");
            AddRes(index, typeof(PetrifiedBoard), "Petrified Boards", 100, "You need more Petrified Boards");
            AddRecipe(index, (int)TinkerRecipes.EnchantedMobileForge); //Visam Added for Recipe

Then I made the recipe file:
C#:
using System;

namespace Server.Items
{
    public class EnchantedMobileForgeRecipe : RecipeScroll
    {

        [Constructable]
        public EnchantedMobileForgeRecipe() : base( 10000 )
        {
         
        }

        public EnchantedMobileForgeRecipe(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }

    }
}

In game it looks like this:

4.jpg
 
Last edited:
Ok so all of them edits need to be done plus the actual recipe scroll code needs to be done.
I didn't realize that all of that had to be done also.
Thank you for the help
Edit: It's not working, made all the edits and created the individual recipe files and nothing.

C#:
#region Custom Resource
AddCraft(typeof(LumberHatchet), 1044046, "Lumber Hatchet" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.LumberHatchetRecipe);
            
AddCraft(typeof(OrePickaxe), 1044046, "Mining Pickaxe" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.OrePickaxeRecipe);
#endregion

C#:
KrampusMinionEarrings = 463,
EnchantedPicnicBasket = 464,
#region Custom Resource
HuntersKnifeRecipe = 513,
LumberHatchetRecipe = 511,
OrePickaxeRecipe = 512
#endregion

C#:
namespace Server.Items
{
    public class OrePickaxeRecipe : RecipeScroll
    {

        [Constructable]
        public OrePickaxeRecipe() : base( 512 )
        {
        
        }

        public OrePickaxeRecipe(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }

    }
}
 
Last edited:
In this section:
C#:
#region Custom Resource
AddCraft(typeof(LumberHatchet), 1044046, "Lumber Hatchet" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.LumberHatchetRecipe);
           
AddCraft(typeof(OrePickaxe), 1044046, "Mining Pickaxe" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.OrePickaxeRecipe);
#endregion

they should be like this not including the Recipe part:
C#:
#region Custom Resource
AddCraft(typeof(LumberHatchet), 1044046, "Lumber Hatchet" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.LumberHatchet);
            
AddCraft(typeof(OrePickaxe), 1044046, "Mining Pickaxe" , 95.0, 115.0, typeof(IronIngot), 1044036, 4, 1044037);
AddRecipe(index, (int)TinkerRecipes.OrePickaxe);
#endregion
 
Ok not sure what the difference between the server version you are using and the one I'm using but they are still not working like you have. Also when double clicked to learn the recipe it does nothing. Here are pics of what I have.The first image is when I add the recipe by name. The second image is when I add the recipe by number. The last image is of the one recipe that is always named and it is always the same name.



Recipeaddedbyname.pngRecipeaddedbynumber.pngRecipeNamed.png


Also I noticed this when the server was loading.

DataPath: C:\Program Files (x86)\Electronic Arts\Ultima Online Classic\
Warning: Attempted add of recipe #811 to the crafting of EnchantedPicnicBasket in CraftSystem Server.Engines.Craft.DefTinkering.
Warning: Attempted add of recipe #812 to the crafting of EnchantedPicnicBasket in CraftSystem Server.Engines.Craft.DefTinkering.
Post automatically merged:

Ok after chatting with Pyro in Discord I got it all working. Thanks for the help Visam.
 
Last edited:
Back