1. I've been trying to change the crafting requirements for certain items as well as items not normally craftable. I've gotten it to sort of work by making my own BuildRecipes function. However when I open the workbench that has these unique recipes the Workbench Window does not reflect the new recipes. It does change the requirements, and I can craft the item, it just doesn't update them in the window and in order to craft it I have to guess which of the default items it is (usualy starting with the flint hatchet).

    Is there an RPC method to "re-draw" the workbench menu that I can call on a client? I sure can't find one. From what I can tell, it's supposed to re-draw the window every time you open the workbench based on the recipes, but that is not the behavior I am observing in my tests.

    From WorkbenchWindow class:
    Code:
      public override void OnOpen(GameObject target)
      {
    //...more code here
        this.PopulateListButtons(); //Won't this repop the list every time the windows is opened?
    //...... more code here
      }
    Here is an example BuildRecipies.
    Code:
    void BuildRecipies(Workbench wb)
            {
                //Clear current recipes
                wb.RecipeDefinitions.Clear();
                //Engines
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.DamagedEngine,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.WeakEngine,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.MediumEngine,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.PowerfullEngine,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                //Gearbox
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.RoachStockGearbox,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.RoachRoadGearbox,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                //Wheels
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.LargeTractorWheel,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.SmallCartWheel,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.GoatWheelNipples,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.DriftLargeWheel,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Machines").SetTier(1));
           
                //Sombero
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.Sombrero,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Gear").SetTier(1));            //Mining Bow
                wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.MineBow,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Weapons").SetTier(1));
           
                //Anvil
                /*wb.RecipeDefinitions.Add(new RecipeDefinition((IItemGenerator) new ItemGeneratorStatic()
                {
                    ItemId = EItemCode.Anvil,
                    StackSize = 1
                }).AddMaterial(EItemCode.Wood, 5).AddMaterial(EItemCode.Flint, 5).SetCategory("UI/WorkbenchCategories/Gear").SetTier(1));*/
                wb.RecipeNames = new string[wb.RecipeDefinitions.Count];
                for (int index = 0; index < wb.RecipeDefinitions.Count; ++index)
                  wb.RecipeNames[index] = wb.RecipeDefinitions[index].Generator.GetName();
            }
    I have also tried creating my own inherited CustomWorkbench : Workbench class overriding BuildRecipes(). I then removed the Workbench component of the Workbench object, and attached a CustomWorkbench component. This gave the same results.

    Thank you for any assistance!
     
    Last edited by a moderator: Jan 16, 2016
  2. Wulf

    Wulf Community Admin

    Pretty sure recipe info is mostly client-side, so the server wouldn't be able to alter them. I may be wrong though, but I believe someone mentioned that.
     
  3. Created a RecipeConfig plugin a while ago to change the receipes but it is not possible for the client to see those changes because the client has a fixed receipe list...
     
  4. Yes, the workbench currently doesn't propogate these recipes to the client. This is on our todo.