Jump to content
PhoenixSoul

Venka Crafting Script: (read for more details)

Recommended Posts

Okay, so I'm using this crafting system in particular because:
> Coelocanth's system does not allow for more than one 'recipe' per item
> The interface of Venka's system is really robust

(I do not know where online the script set/demo can be found)

Anyway, the issue I am having is that, for some reason, for some of the crafting types, the timer bar (and help text!) does not show up, and players having to guess at when to press the confirm button, is just really, really, really BAD GAMEPLAY. NO, THANK YOU. I dunno what the deal is, but I cannot release the game with such a critical flaw.

I've tried to figure out what in the literal name of Mercy is going on, but looking at the code, I see no reason why this could be happening.

So, I'm at a loss, and need help. I've actually put this off, because I'm trying to get other things set to go, but this here, this is make or break. It will be a cornerstone of gameplay and must be functional before the game is released. So I humbly ask whoever is able, to aid me here. Thanks much...

Share this post


Link to post
Share on other sites
Posted (edited)

I can help I think as I use the same scripts I believe. but without seeing what yours are I can only guess.

 

  #          "Text" is text shown when the exp gauge for the craft is maxed out
  #      :bg_image      => "File_Name",           # Background image for scene
  #          "File_Name" is file found Graphics/Titles1 or Graphics/Picture.
  #          Use nil to omit this option.
  #      :bg_music      => "File_Name",           # Background music for scene
  #          "File_Name" is file found Audio/BGM. Use nil to omit
  #      :active_sound  => ["File_Name", Volume, Pitch],  # Sound while crafting
  #          For this one, it will check in the Audio/BGS folder first if it 
  #          doesn't find the file, then it'll check in Audio/SE. If the file 
  #          is a SE (sound effect) it will play ever 2 seconds. Can be omitted.

Craft_Info[1] = {  # Cooking
    :craft_name    => "Cooking",
    :craft_time    => 30,
    :buffer_time   => 90,
    :exp_table     => [ 10, 5, 12, 20],
    :max_level     => 10,
    :mastered      => "Master Chef",
    :bg_image      => "Book",
    :bg_music      => nil,
    :active_sound  => ["Fire", 100, 100],

Craft time & buffer time, may have some effect.

Make Sure each of your crafting info[]s have similar stuff on them find the ones that work & replace the => with right ones that do.

  Recipes[1] = {     # Loaf of Bread
    :recipe_type  => 1,            # Cooking Recipe
    :auto_learn   => true,         # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Baked Bread", # Name that appears on the recipe
    :shop_fee     => 10,           # Fee charged if crafted at a shop
    :craft_time   => 200,          # Time it takes to make the item
    :earned_exp   => 5,            # Exp gained on success
    :crafted_item => [:i24, 2],    # Makes 2x Loaf of Bread
    :ingredients  => [ # 2x Eggs,  1x Flour,   1x Milk
                     [:i298, 2], [:i72, 1], [:i297, 1],

 

Make sure your Craft Time is correct on Recipes.

 

Edited by EXVA

Share this post


Link to post
Share on other sites
Posted (edited)

  Timer_Type = :timer      Make sure this isn't set to none I think your wanting it active.

 

Timer_Type = :timer         # Set to :active, :timer, or :none
  Crafting_Time_Max  = 1000    # Max craft time (total time)
  Crafting_Buffer    = 30      # Buffer to activated timer (window for claiming)
  Default_Craft_Time = 500     # Default craft time (when to claim item)
  Time_Variance      = 100     # Variance to craft time, set to 0 to disable
  Accelerate_Time    = true    # Craft time gets faster as you out level them
  # This is the rate to speed up craft time. This should be between 0.1 and 0.9
  Accelerate_Rate    = 0.9     # The lower the number, the faster it speeds up.
 

Time Variance would effect timing too same for Accelerate. 

Edited by EXVA

Share this post


Link to post
Share on other sites

The terminology section effect text,   Directions_Msg, Craft_Button_Text

 

Start_Scene      = ["Book1", 80, 100]            # Sound on book open
  Success_Sound    = ["Item1", 80, 75]             # Crafted successfully
  Premature_Sound  = ["Disappointment", 80, 100]   # Crafted too soon
  Failure_Sound    = ["Chime1", 80, 50]            # Crafted too late
  Level_Up_Sound   = ["Sound2", 80, 100]           # Gained crafting level
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Text Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Craft_Button_Text = "Create"        # What the begin crafting button displays
  Directions_Msg    = "Press 'Enter' when the bar is green" # Instructions Text
  Possessed_Text    = "Currently Owned:"                    # Total Owned Text
  Ingredients_Text  = "Ingredients:"                        # Ingredients Text
  Needed_Owned_Text = "Need/Have"                           # Needed/Owned Text
  Level_Text = "Lv:"                                        # Level Text
  EXP_Text   = "Exp"                                        # Exp Text
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Results Pop-up Window Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Pop_up_Window    = true     # Use the pop up window
  Result_Opacity   = 255      # Result window's over all opacity. Number 0 - 255
  Result_BGOpacity = 215      # Result window's background opacity (default 192)
  Results_Text = "Results"    # Text shown at the top of the Results Window
  Failed_Msg = "You have failed at creating this item."   # Fail message
  Result_Msg = "You crafted:"                             # Success Message
  Lv_Gain    = "Leveled Up!!"                             # Level up message
  Exp_Earned = "Exp earned:"                              # Exp Earned message
  Max_Exp    = "Maxed Out!"                               # Message for max exp
  Learn_Text = "Learned:"      

Share this post


Link to post
Share on other sites

@EXVA (yeah-the script snippets you shared are just like the ones I have)
Hmmm...

Spoiler


  Craft_Info[1] = {  # Mixology
    :craft_name    => "Mixology",
#   :craft_time    => 90,
#   :buffer_time   => 180,
    :craft_time    => 60,
    :buffer_time   => 150,
    :exp_table     => [16, 4, 16, 16],
    :max_level     => 40,
    :mastered      => "Mixologist Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Bubbling", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[2] = {  # Smithing
    :craft_name    => "Smithing",
    :craft_time    => 90,
    :buffer_time   => 180,
    :exp_table     => [12, 3, 15, 20],
    :max_level     => 50,
    :mastered      => "Forgeprint Master",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Hammer", 100, 100],
    } # <-DO NOT REMOVE
  Craft_Info[3] = {  # Satineer
    :craft_name    => "Satineer",
    :craft_time    => 70,
    :buffer_time   => 180,
    :exp_table     => [15, 0, 10, 30],
    :max_level     => 50,
    :mastered      => "Seamstress Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Equip3", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[4] = {  # Jeweler
    :craft_name    => "Jeweler",
    :craft_time    => 75,
    :buffer_time   => 240,
    :exp_table     => [13, 2, 25, 20],
    :max_level     => 50,
    :mastered      => "Gem Appraiser Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Metal Cursor", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[5] = {  # Aetherology
    :craft_name    => "Aetherology",
    :craft_time    => 120,
    :buffer_time   => 60,
    :exp_table     => [30, 0, 15, 10],
    :max_level     => 50,
    :mastered      => "Void Weaver",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Fog1", 100, 50],
    } # <-DO NOT REMOVE
  Craft_Info[6] = {  # Cosmetology
    :craft_name    => "Cosmetology",
    :craft_time    => 90,
    :buffer_time   => 90,
    :exp_table     => [15, 5, 10, 20],
    :max_level     => 40,
    :mastered      => "Beauty Guru",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Scraping", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[7] = {  # Smelting
    :craft_name    => "Smelting",
    :craft_time    => 90,
    :buffer_time   => 180,
    :exp_table     => [12, 3, 15, 20],
    :max_level     => 40,
    :mastered      => "Metal Melter",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Fire", 100, 90],
    } # <-DO NOT REMOVE

 

Spoiler


  Recipes[0] = {     # Lemon Ale (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Lemon Ale (pint)",  # Name that appears on the recipe
    :shop_fee     => 350,          # Fee charged if crafted at a shop
    :craft_time   => 160,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 12,           # Exp gained on success
    :crafted_item => [:i41,1],     # Makes a pint of Lemon Ale
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 2 Lemons, 1 each of Valstrig Vinegar and Empty Flask.
                       # Also requires a tool, Mixer.                     
                     [:i70,2],[:i77,1],[:i40,1],[:i78,1,],
    ]} # <- DO NOT REMOVE

 

Spoiler


  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - General Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Window_Opacity     = 255      # Window overall opacity. Number 0 - 255
  Window_BGOpacity   = 180      # Window background opacity (default 192)
  Auto_Learn         = false    # Automatically learn recipes when leveling
  Gold_Icon          = 0        # Icon Index used for Gold Coins
  Gold_Text          = "\\*\\r[26]"   # Text used to represent currency
  Gold_Hue           = 0        # Icon Hue (if using modern alegbra's Icon Hues)
  Use_Line_Dividers  = true     # Toggle the display of line separators
  Failure_Exp_Rate   = 0.25     # Exp received when failed. Ex 0.25 is 25%
  Include_Equipment  = false    # Include equipped items in total owned items?
  Use_Craft_Exp      = true     # Use craft exp and levels true/false

 

So, I tried setting it to :timer (I've had it set to :active), and the timer bar shows up then.
So, I think there's something weird going on with the code itself, or maybe, just maybe, the script is harder than it appears to set up.

Spoiler


  #----------------------------------------------------------------------------
  # ○ new method: activate_craft
  #----------------------------------------------------------------------------
  def activate_craft
    return if Venka::Crafting::Timer_Type == :none
    play_sound
    rect = item_rect(index)
    unselect
    contents.clear_rect(rect)
    rate = [@elapsed.to_f / @max_time, 1.0].min
    if Venka::Crafting::Timer_Type == :timer
      @elapsed += 1
    else
      set_font(:help_text)
#     draw_text(rect.x, rect.y + font_height, rect.width, rect.height - font_height, Directions_Msg, 1)
      draw_text(120, 240 + font_height, 240, rect.height - font_height, Directions_Msg, 1)
      if @elapsed < @max_time
        @elapsed += 1
      else
        @failed  = true
        @success = false
      end
    end
    if @claim_time + @buffer >= @elapsed and @elapsed >= @claim_time - @buffer
      @success = true
      gc1 = get_color(Claim_Gauge_Color1)
      gc2 = get_color(Claim_Gauge_Color2)
    else
      if @claim_time + @buffer < @elapsed
        @failed = true
      end
      @success = false
      gc1 = get_color(Craft_Gauge_Color1)
      gc2 = get_color(Craft_Gauge_Color2)
    end
#   draw_gauge(rect.x, rect.y, rect.width, rate, gc1, gc2)
    draw_gauge(120, 240, 240, rate, gc1, gc2)
  end

 

Hmmm...I just don't know...

Share this post


Link to post
Share on other sites
11 hours ago, EXVA said:

  Timer_Type = :timer      Make sure this isn't set to none I think your wanting it active.

 

Timer_Type = :timer         # Set to :active, :timer, or :none
  Crafting_Time_Max  = 1000    # Max craft time (total time)
  Crafting_Buffer    = 30      # Buffer to activated timer (window for claiming)
  Default_Craft_Time = 500     # Default craft time (when to claim item)
  Time_Variance      = 100     # Variance to craft time, set to 0 to disable
  Accelerate_Time    = true    # Craft time gets faster as you out level them
  # This is the rate to speed up craft time. This should be between 0.1 and 0.9
  Accelerate_Rate    = 0.9     # The lower the number, the faster it speeds up.
 

Time Variance would effect timing too same for Accelerate. 

& you checked this part too?

Share this post


Link to post
Share on other sites
Posted (edited)
4 minutes ago, EXVA said:

& you checked this part too?

Yeah; the settings are identical.

Spoiler


  Timer_Type = :active#timer         # Set to :active, :timer, or :none
  Crafting_Time_Max  = 1000    # Max craft time (total time)
  Crafting_Buffer    = 30      # Buffer to activated timer (window for claiming)
  Default_Craft_Time = 500     # Default craft time (when to claim item)
  Time_Variance      = 100     # Variance to craft time, set to 0 to disable
  Accelerate_Time    = true    # Craft time gets faster as you out level them
  # This is the rate to speed up craft time. This should be between 0.1 and 0.9
  Accelerate_Rate    = 0.9     # The lower the number, the faster it speeds up.

 

But aren't these just default settings for if a recipe item omits them? Or...
...
One thing to clarify is that for Mixology and Smelting (first and last crafting types), the timer bar and instructions do not show up when :active is set, but the others do show up. I actually wonder if this is some kind of coding error by Venka theirself.

Edited by PhoenixSoul

Share this post


Link to post
Share on other sites
1 hour ago, PhoenixSoul said:

:ingredients => [ # 2 Lemons, 1 each of Valstrig Vinegar and Empty Flask. # Also requires a tool, Mixer. [:i70,2],[:i77,1],[:i40,1],[:i78,1,],

You have an extra comma at the end of the item. maybe that's part of it?

Share this post


Link to post
Share on other sites
28 minutes ago, roninator2 said:

You have an extra comma at the end of the item. maybe that's part of it?

I do not know how that happened, but only the Mixology recipes were like that, thus, fixing those did not change anything. In the script demo, not all the craft types had associated crafting scenes, and I wonder if that's part of it. Even still, Mixology replaces 'Cooking', and that one had no issues. I'm really at a loss.

Share this post


Link to post
Share on other sites
Posted (edited)

Can you post a small clip of what it's suppose to look like & where it doesn't

Wait nvm I think I understood, so your first tab has it set up to show

press enter or something & the bar slides to green & you press the button.

& it's missing from your 3/4th crafting menus.

Edited by EXVA

Share this post


Link to post
Share on other sites
6 minutes ago, EXVA said:

& it's missing from your 3/4th crafting menus.

First and Seventh, yes. (first and last)
I'm not sure what the deal is.

Share this post


Link to post
Share on other sites

post yours & I'll fix it if you can't find the issue vs mine.

Share this post


Link to post
Share on other sites

I am using all the scripts, FTR.
Anyway...

Spoiler

#===============================================================================
# Crafting Script v3.7                                      updated: 12/15/2014
#  Based off of Cooking Script v1.0 for RPG Maker VX by GubiD 
#  Author: Venka
#===============================================================================
# - Change Log -
#------------------------------------------------------------------------------
# 12/15/2014 - Fixed BGM's so the play through the craft scene if no new BGM 
#              was set.
# 10/27/2014 - Fixed equipment count so it counts if an actor is wearing more 
#              then one piece of the same item - Like two of the same Rings.
#            - You can set claim/buffer time by craft type now.
# 09/15/2014 - Changes to make it a bit more friendly for the new bigger screen
#              size RGSS301.dll. I just stretched the background images to 
#              make the scale to any resolution and made the windows scale more 
#              evenly in the higher resolutions.
# 09/08/2014 - Fixed the change_level script call to award the correct amount 
#              of exp.
# 09/04/2014 - You wouldn't auto learn recipes when using the script call to 
#              change levels. This has been fixed.
#            - Added a new script call to set the craft to a specific level.
#            - Crafting background images will now check the Titles1 Folder 
#              for images first and if it doesn't find one in that folder then 
#              it'll look for the image in the Pictures folder.
# 09/01/2014 - Made the code more efficient for the Menu Add on.
#            - No changes were made to the customize section so no need to 
#              replace that section if you are upgrading.
# 08/17/2014 - Made it so you can use this script without using craft exp and 
#              levels. The pop up window will shrink as well if no exp is 
#              earned.
#            - Put in fail safes for if an item is listed as required, but set 
#              to zero (so you won't get the divide by 0 error).
# 08/01/2014 - Made slight changes to the way the crafting result info was 
#              stored for the actor stats add-on. Also small changes to 
#              the crafting stack number in the Details window.
# 07/24/2014 - Added a font height method to Window_Base for general purpose 
#              use. 
# 07/21/2014 - Gave some attention to the result window. It will now scale in 
#              size and show learned recipes when you level up a craft.
#            - Added display names to recipes. So a recipe could be called
#              "Super Awesome Recipe" instead of whatever the item is it 
#              creates.
# 07/05/2014 - Incorporated the Tools Add-on into the main script.
#            - When counting items already owned (at the top of the recipe info
#              window, not the ingredients themself), it'll count equipped items
#            - Allows crafting of stacks of ingredients as this is a common 
#              request. You can set if you want to allow the player to craft 
#              stacks.
#            - Added in Opacity settings for all the windows in the scene.
#            - Added more text control settings
#            - Changed the text color of the required level in the recipe 
#              detail window if the current level is insufficient.
#            - Fixed potential  spacing issues with the text in the Result Window
# 06/28/2014 - fixed an enable bug introduced in the previous update.
# 06/13/2014 - Allow sorting of the recipe list by level, alphabetically, or 
#              order created.
#            - Small fixes here and there for the new Shop Craft & Decompile 
#              add-on script.
#            - Added in :shop_fee for set up with the Shop Craft & Decompile 
#              add-on script. This option can be omitted in the Recipe setup
#              if you have no intentions of using that add-on.
#            - The recipe list window was only returning the check of the last 
#              item in the list. So if you had that ingredient, it would allow 
#              you to try and craft the recipe. You still couldn't craft it 
#              without all the items, but it didn't gray out like it should.
#            - Move the Customize and Instructions section to it's own entry 
#              in the script editor so its easier to update the script without 
#              having to move settings back in from older versions.
#            - Allows you set set what time of crafting gauge you want. There 
#              are now 3 options. The standard activated gauge where the action 
#              key needs to be pressed at a certain time. You can now make the 
#              gauge a progress bar that just shows when you'll finish crafting.
#              Or you can just do away with the bar and instantly craft the 
#              item.
# 05/28/2014 - Updated the script to auto fail the craft if the max craft time 
#              is reached before the action key is pressed.
#            - Fixed the map's BGM to save instead of resetting it.
# 05/22/2014 - Fixed some bugs in the auto learning feature (wasn't auto 
#              auto learning on craft level changes).
# 03/09/2014 - Allows for the automatic learning of recipes when the craft
#              levels up (you can choose to use this option or not)
#            - Re-formated the way the craft type information is input. More 
#              and more information was being stored here and the old way was 
#              getting hard to follow.
#            - Made the script compatible with modern algebra's Icon Hues.
#            - Added a script call for conditional branches
# 02/20/2014 - Allows active crafting sounds (like a hammer while smithing)
#              The sounds can be a SE or a BGS
# 01/31/2014 - Allows a failure item if crafting before the set time
#            - Allows you to use gold in crafting recipes
#            - Allows you to set background pictures/music for each craft type
#            - Option for using line separators
#            - Recipe List window will gray out recipes if requirements for 
#              crafting are not met.
#            - Fixed compatibility issue with LoneWolf's trash symbol fix
#            - Fixed some typos and misspelled words
# 12/13/2013 - Made inputting item info easier for the user.
# 10/15/2013 - Fix a bug failed item bug introduced in previous patch.
#              Fixed a max level bug (could still get exp after max level)
#              Allows you to give custom crafter mastery titles.
# 10/11/2013 - Cleaned up some code.
#              Added a random craft time setting to allow for some variance 
#              in craft times. Also added the ability to speed up the craft 
#              time in relation to how easy it is for you to make.
#              Example: a level 1 recipe should be fast for a level 30 crafter.
#  9/30/2012 - Upgraded to version 2.0. Allows use of items, weapons, armor.
#              And you can have multiple crafting skills each with their own
#              Levels, Recipes, and Exp.
#  8/23/2013 - Initial port from VX to VXAce
# 
#===============================================================================
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
  #----------------------------------------------------------------------------
  # ● alias methods:
  #----------------------------------------------------------------------------
  class << self
    alias venka_crafting_create_objects        create_game_objects
    alias venka_crafting_save_contents         make_save_contents
    alias venka_crafting_extract_contents      extract_save_contents
    alias load_database_craft_tools            load_database
  end
  #----------------------------------------------------------------------------
  # ● alias method: create_game_objects
  #----------------------------------------------------------------------------
  def self.create_game_objects
    venka_crafting_create_objects
    $craft  = Game_Crafting.new
    $recipe = Game_Recipes.new
  end
  #----------------------------------------------------------------------------
  # ● alias method: make_save_contents
  #----------------------------------------------------------------------------
  def self.make_save_contents
    contents = venka_crafting_save_contents
    contents[:crafting] = $craft
    contents
  end
  #----------------------------------------------------------------------------
  # ● alias method: extract_save_contents
  #----------------------------------------------------------------------------
  def self.extract_save_contents(contents)
    venka_crafting_extract_contents(contents)
    $craft = contents[:crafting]
  end
  #----------------------------------------------------------------------------
  # ● alias method: load_database
  #----------------------------------------------------------------------------
  def self.load_database
    load_database_craft_tools
    load_crafting_tools_notetags
  end
  #----------------------------------------------------------------------------
  # ○ new method: load_crafting_notetags
  #----------------------------------------------------------------------------
  def self.load_crafting_tools_notetags
    groups = [$data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_craft_tool_notetag
      end
    end
  end
end
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :tool
  #----------------------------------------------------------------------------
  # ○ new method: load_craft_tool_notetag
  #----------------------------------------------------------------------------
  def load_craft_tool_notetag
    @tool = false
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when Venka::Notetag::Tool;    @tool = true
      end
    end
  end
end
#==============================================================================
# ■ Craft_Gold
#==============================================================================
class Craft_Gold
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :tool
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader   :icon_index               # Icon Index
  attr_reader   :name                     # Gold Text Name
  attr_reader   :icon_hue                 # Icon Hue
  #----------------------------------------------------------------------------
  # ● upgrade method: initialize
  #----------------------------------------------------------------------------
  def initialize
    super
    @icon_index = Venka::Crafting::Gold_Icon
    @name       = Venka::Crafting::Gold_Text
    @icon_hue   = Venka::Crafting::Gold_Hue
    @tool = false
  end
end
#==============================================================================
# ■ Game_Craft_Info
#==============================================================================
class Game_Craft_Info
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader    :name,            :mastered,            :craft_sound
  attr_reader    :level,           :bg_image,            :bg_music
  attr_reader    :active_sound,    :learned_recipes,     :default_time
  attr_reader    :buffer_time
  #----------------------------------------------------------------------------
  # ● upgrade method: initialize
  #----------------------------------------------------------------------------
  def initialize(craft_id)
    @craft_id     = craft_id
    @craft_info   = Venka::Crafting::Craft_Info[@craft_id]
    @name         = @craft_info[:craft_name]
    @max_level    = @craft_info[:max_level]
    @mastered     = @craft_info[:mastered]
    @bg_image     = @craft_info[:bg_image]
    @bg_music     = @craft_info[:bg_music]
    @craft_sound  = @craft_info[:craft_sound]
    @active_sound = @craft_info[:active_sound]
    @default_time = @craft_info[:craft_time] ? @craft_info[:craft_time] : Venka::Crafting::Default_Craft_Time
    @buffer_time  = @craft_info[:buffer_time] ? @craft_info[:buffer_time] : Venka::Crafting::Crafting_Buffer
    @level     = 1
    @exp       = {}
    @learned_recipes = nil
    init_exp
  end
  #----------------------------------------------------------------------------
  # ○ new method: exp_for_level
  #----------------------------------------------------------------------------
  def exp_for_level(level)
    lv = level.to_f
    basis = @craft_info[:exp_table][0].to_f
    extra = @craft_info[:exp_table][1].to_f
    acc_a = @craft_info[:exp_table][2].to_f
    acc_b = @craft_info[:exp_table][3].to_f
    return (basis*((lv-1)**(0.9+acc_a/250))*lv*(lv+1)/(6+lv**2/50/acc_b)+(lv-1)*extra).round.to_i
  end
  #----------------------------------------------------------------------------
  # ○ new method: init_exp
  #----------------------------------------------------------------------------
  def init_exp;    @exp[@craft_id] = current_level_exp;    end
  #----------------------------------------------------------------------------
  # ○ new method: exp related methods
  #----------------------------------------------------------------------------
  def exp;                 @exp[@craft_id];            end
  def current_level_exp;   exp_for_level(@level);      end
  def next_level_exp;      exp_for_level(@level + 1);  end
  def max_level?;          @level >= @max_level;       end
  #----------------------------------------------------------------------------
  # ○ new method: level_up
  #----------------------------------------------------------------------------
  def level_up
    @level += 1
    # Note to self: don't use a return method here for the actor specific add on
    if Venka::Crafting::Auto_Learn
      # Learn new recipes if auto learning is on
      Venka::Crafting::Recipes.each do |recipe_info|
        recipe_id = recipe_info[0]
        recipe    = recipe_info[1]
        recipe_lv = recipe[:req_level] ? recipe[:req_level] : 1
        if recipe[:recipe_type] == @craft_id && recipe_lv <= @level
          next if $craft.known_recipes.include?(recipe_id)
          $craft.learn_recipe(recipe_id) unless recipe[:auto_learn] == false
        end
      end
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: level_down
  #----------------------------------------------------------------------------
  def level_down
    @level -= 1
    return unless Venka::Crafting::Auto_Learn
    # Forget recipes if auto learning is on and craft level is lost
    $craft.known_recipes.each do |id|
      recipe = Venka::Crafting::Recipes[id]
      if recipe[:recipe_type] == @craft_id && recipe[:req_level] > @level
        $craft.forget_recipe(id) unless recipe[:auto_learn] == false
      end
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: change_exp
  #----------------------------------------------------------------------------
  def change_exp(exp)
    @learned_recipes = nil
    @exp[@craft_id] = [exp, 0].max
    last_level = @level
    recipes = $craft.known_recipes.clone
    if $imported[:Venka_Actor_Crafting]
      recipes += actor_recipes.clone
    end
    level_up while !max_level? && self.exp >= next_level_exp
    level_down while self.exp < current_level_exp
    new_recipes = $craft.known_recipes
    if $imported[:Venka_Actor_Crafting]
      new_recipes += actor_recipes
    end
    @learned_recipes = new_recipes - recipes if @level > last_level
  end
  #----------------------------------------------------------------------------
  # ○ new method: get_actor_access
  #----------------------------------------------------------------------------
  def get_actor_access
    @mode = []
    case Venka::Crafting::Actor_Access
    when :party  ;         @mode = $game_party.members
    when :active ;         @mode = $game_party.battle_members
    else         ;         @mode << $game_party.leader
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: actor_recipes
  #----------------------------------------------------------------------------
  def actor_recipes
    get_actor_access
    actor_recipes = []
    @mode.each do |actor|
      actor.known_recipes.each { |recipe_id| actor_recipes << recipe_id }
    end
    return actor_recipes
  end
  #----------------------------------------------------------------------------
  # ○ new method: exp, gain_exp
  #----------------------------------------------------------------------------
  def exp;              @exp[@craft_id];                     end
  def gain_exp(exp);    change_exp(self.exp + exp.to_i);     end
  #----------------------------------------------------------------------------
  # ○ new method: change_level
  #----------------------------------------------------------------------------
  def change_level(change)
    change_exp(exp_for_level(@level + change))
  end
  #----------------------------------------------------------------------------
  # ○ new method: set_level
  #----------------------------------------------------------------------------
  def set_level(level)
    level = [[level, @max_level].min, 1].max
    change_exp(exp_for_level(level))
  end
end
#==============================================================================
# ■ Game_Crafting   
#==============================================================================
class Game_Crafting
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader    :known_recipes,    :results
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize
    @craft = []
    clear_results
    init_recipes
  end
  #----------------------------------------------------------------------------
  # ○ new method: []
  #----------------------------------------------------------------------------
  def [](craft_id)
    return nil unless Venka::Crafting::Craft_Info[craft_id]
    @craft[craft_id] ||= Game_Craft_Info.new(craft_id)
  end
  #----------------------------------------------------------------------------
  # ○ new method: init_recipes
  #----------------------------------------------------------------------------
  def init_recipes
    @known_recipes = []
    return unless Venka::Crafting::Auto_Learn
    crafts = Venka::Crafting::Craft_Info
    recipe_list = Venka::Crafting::Recipes
    crafts.each_key do |craft_id|
      recipe_list.each do |recipe_info|
        recipe_id = recipe_info[0]
        recipe    = recipe_info[1]
        recipe_lv = recipe[:req_level] ? recipe[:req_level] : 1
        if recipe[:recipe_type] == craft_id && recipe_lv <= 1
          learn_recipe(recipe_id) unless recipe[:auto_learn] == false
        end
      end
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: learn_recipe
  #----------------------------------------------------------------------------
  def learn_recipe(recipe_id)
    @known_recipes ||= []
    @known_recipes << recipe_id unless @known_recipes.include?(recipe_id)
  end
  #----------------------------------------------------------------------------
  # ○ new method: forget_recipe
  #----------------------------------------------------------------------------
  def forget_recipe(recipe_id)
    @known_recipes.delete(recipe_id)
  end
  #----------------------------------------------------------------------------
  # ○ new method: set_results
  #----------------------------------------------------------------------------
  def set_results(id, exp, message, item, amount, leveled_up)
    clear_results
    @results = [id, [exp, message, item, amount, leveled_up]]
  end
  #----------------------------------------------------------------------------
  # ○ new method: clear_results
  #----------------------------------------------------------------------------
  def clear_results
    @results = []
  end
end
#==============================================================================
# ■ Game_Recipe
#==============================================================================
class Game_Recipe
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader    :recipe_type,      :req_level,       :ingredients
  attr_reader    :craft_time,       :earned_exp,      :ingredient_amount
  attr_reader    :pre_failed,       :auto_learn,      :recipe_id
  attr_reader    :display_name
  #----------------------------------------------------------------------------
  # ● upgrade method: initialize
  #----------------------------------------------------------------------------
  def initialize(recipe_id)
    @recipe_id    = recipe_id
    @recipe       = Venka::Crafting::Recipes[@recipe_id]
    @recipe_type  = @recipe[:recipe_type]
    if Venka::Crafting::Auto_Learn
      @auto_learn = @recipe[:auto_learn] == false ? false : true
    else
      @auto_learn = false
    end
    @req_level    = @recipe[:req_level] ? @recipe[:req_level] : 1
    @earned_exp   = @recipe[:earned_exp] ? @recipe[:earned_exp] : 0
    @craft_item   = @recipe[:crafted_item]
    @fail_item    = @recipe[:failed_item]
    @pre_failed   = @recipe[:pre_failed]
    @components   = @recipe[:ingredients]
    @ingredients  = []
    @ingredient_amount = []
    get_ingredients
    get_ingredient_amount
    get_display_name
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft_time
  #----------------------------------------------------------------------------
  def craft_time 
    time = @recipe[:craft_time] ? @recipe[:craft_time] : $craft[@recipe_type].default_time #Venka::Crafting::Default_Craft_Time
    time += rand(Venka::Crafting::Time_Variance)
    if Venka::Crafting::Accelerate_Time
      rate = Venka::Crafting::Accelerate_Rate
      time = (time * (rate ** $craft[@recipe_type].level)).to_i
    end
    time = [[time, Venka::Crafting::Crafting_Time_Max].min, 0].max
    return time
  end
  #----------------------------------------------------------------------------
  # ○ new method: crafted_item, crafted_amount, failed_amount
  #----------------------------------------------------------------------------
  def crafted_item;       get_item_info(@craft_item[0]);                   end
  def crafted_amount;     @craft_item[1];                                  end
  def failed_amount;      @fail_item[1];                                   end
  #----------------------------------------------------------------------------
  # ○ new method: pre_failed_amount
  #----------------------------------------------------------------------------
  def pre_failed_amount
    return unless @recipe[:pre_failed]
    @pre_failed[1]
  end
  #----------------------------------------------------------------------------
  # ○ new method: failed_item
  #----------------------------------------------------------------------------
  def failed_item
    get_item_info(@fail_item[0]) if @recipe[:failed_item]
  end
  #----------------------------------------------------------------------------
  # ○ new method: pre_failed_item
  #----------------------------------------------------------------------------
  def pre_failed_item
    get_item_info(@pre_failed[0]) if @recipe[:pre_failed]
  end
  #----------------------------------------------------------------------------
  # ○ new method: ingredients
  #----------------------------------------------------------------------------
  def get_ingredients
    for i in 0...@components.size
      item = get_item_info(@components[i][0])
      @ingredients << item
    end
    return @ingredients
  end
  #----------------------------------------------------------------------------
  # ○ new method: ingredient_amount
  #----------------------------------------------------------------------------
  def get_ingredient_amount
    for i in 0...@components.size
      item = @components[i][0].to_s
      case item.slice(0, 1)
      # When the item is Gold, then get the amount of gold
      when "g"; @ingredient_amount << item.gsub!('g', '').to_i
      # Else get the amount of items used
      else;     @ingredient_amount << @components[i][1]
      end
    end
    return @ingredient_amount
  end
  #----------------------------------------------------------------------------
  # ○ new method: get_item_type
  #----------------------------------------------------------------------------
  def get_item_info(item)
    info = item.to_s
    case info.slice(0, 1)
    when "i";   return $data_items[info.gsub!('i', '').to_i]     # item
    when "a";   return $data_armors[info.gsub!('a', '').to_i]    # armor
    when "w";   return $data_weapons[info.gsub!('w', '').to_i]   # weapon
    when "g";   return Craft_Gold.new                            # gold
    else;       return
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: get_display_name
  #----------------------------------------------------------------------------
  def get_display_name
    if @recipe[:display_name]
      @display_name = @recipe[:display_name]
    else
      @display_name = crafted_item.name
    end
  end
end
#==============================================================================
# ■ Game_Recipes
#==============================================================================
class Game_Recipes
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize
    @recipes = []
  end
  #----------------------------------------------------------------------------
  # ○ new method: []
  #----------------------------------------------------------------------------
  def [](recipe_id)
    return nil unless Venka::Crafting::Recipes[recipe_id]
    @recipes[recipe_id] ||= Game_Recipe.new(recipe_id)
  end
end
#==============================================================================
# ■ Game_Interpreter
#==============================================================================
class Game_Interpreter
  #----------------------------------------------------------------------------
  # ○ new method: craft
  #----------------------------------------------------------------------------
  def craft(craft_type)
    SceneManager.call(Scene_Crafting)
    SceneManager.scene.prepare(craft_type)
  end
  #----------------------------------------------------------------------------
  # ○ new method: learn_recipe
  #----------------------------------------------------------------------------
  def learn_recipe(recipe_id)
    $craft.learn_recipe(recipe_id)
  end
  #----------------------------------------------------------------------------
  # ○ new method: recipe_learned?
  #----------------------------------------------------------------------------
  def recipe_learned?(recipe_id)
    $craft.known_recipes.include?(recipe_id)
  end
  #----------------------------------------------------------------------------
  # ○ new method: forget_recipe
  #----------------------------------------------------------------------------
  def forget_recipe(recipe_id)
    $craft.forget_recipe(recipe_id)
  end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● alias method: process_escape_character - credit LoneWolf (fixes trash symbols)
  #--------------------------------------------------------------------------
  alias lonewolf_trash_char_fix_process_normal_character process_normal_character
  def process_normal_character(c, pos)
    return unless c >= ' '
    lonewolf_trash_char_fix_process_normal_character(c, pos)
  end
  #----------------------------------------------------------------------------
  # ○ new method: get_color - method determines if text color or new color
  #----------------------------------------------------------------------------
  def get_color(input)
    input.is_a?(Integer) ? text_color([[input, 0].max, 31].min) : Color.new(*input)
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft_font_color
  #----------------------------------------------------------------------------
  def craft_font_color(text_type)
    f_color = Venka::Crafting::Fonts[text_type][3]
    color = f_color.is_a?(Integer) ? text_color(f_color) : Color.new(*f_color)
  end
  #----------------------------------------------------------------------------
  # ○ new method: set_font
  #----------------------------------------------------------------------------
  def set_font(text_type, enabled = true)
    font = Venka::Crafting::Fonts[text_type]
    contents.font.name = font[0]
    contents.font.size = font[1]
    contents.font.bold = font[2]
    change_color(craft_font_color(text_type), enabled)
  end
  #----------------------------------------------------------------------------
  # ○ new method: font_height
  #----------------------------------------------------------------------------
  def font_height
    [contents.font.size, 24].max
#   [[contents.font.size, 24].min, 8].max
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_line
  #----------------------------------------------------------------------------
  def draw_line(y)
    return unless Venka::Crafting::Use_Line_Dividers
    color = get_color(Venka::Crafting::Line_Color)
    contents.fill_rect(4, y, contents_width - 8, 2, color)
    contents.fill_rect(4, y + 2, contents_width - 8, 1, Color.new(16,16,16,100))
  end
end
#==============================================================================
# ■ Crafting_Title_Window
#==============================================================================
class Crafting_Title_Window < Window_Base
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width, 48)
    self.opacity = Venka::Crafting::Window_Opacity
    self.back_opacity = Venka::Crafting::Window_BGOpacity
    @craft_id = nil
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft
  #----------------------------------------------------------------------------
  def craft=(craft_id)
    return if @craft_id == craft_id
    @craft_id = craft_id
    @craft = $craft[@craft_id]
    @exp = @craft.exp
    refresh
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: refresh
  #----------------------------------------------------------------------------
  def refresh
    contents.clear
    x = w = contents.width * 0.5
    set_font(:title_text)
    if Venka::Crafting::Use_Craft_Exp
      align = 0
      set_font(:other_text)
      draw_crafting_gauge(x, 0, w) unless @craft.max_level?
      draw_craft_level(x, 0, w)
    else
      align = 1
    end
    draw_text(0, 0, contents.width, font_height, @craft.name, align)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_crafting_gauge
  #----------------------------------------------------------------------------
  def draw_crafting_gauge(x, y, width)
    s1 = @craft.exp - @craft.current_level_exp
    s2 = @craft.exp_for_level(@craft.level + 1) - @craft.current_level_exp
    rate = [s1.to_f/s2, 1.0].min
    color1 = get_color(Venka::Crafting::Exp_Gauge_Color1)
    color2 = get_color(Venka::Crafting::Exp_Gauge_Color2)
    draw_gauge(x, y, width, rate, color1, color2)
    color1 = color2 = normal_color
    draw_current_and_max_values(x + 80, y, width - 80, s1, s2, color1, color2)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_craft_level
  #----------------------------------------------------------------------------
  def draw_craft_level(x, y, w)
    if @craft.max_level?
      set_font(:title_text)
      draw_text(x, y, w, font_height, @craft.mastered, 2)
    else
      set_font(:other_text)
      draw_text(x, y, w, font_height, "Level: #{@craft.level}")
    end
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: update
  #----------------------------------------------------------------------------
  def update
    super
    if @exp != $craft[@craft_id].exp
      @exp = $craft[@craft_id].exp
      refresh
    end
  end
end
#==============================================================================
# ■ Recipe_List_Window
#==============================================================================
class Recipe_List_Window < Window_Command
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader   :detail_window,     :status_window
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y)
    self.opacity = Venka::Crafting::Window_Opacity
    self.back_opacity = Venka::Crafting::Window_BGOpacity
    @craft_id = nil
    @recipes   = $craft.known_recipes
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft
  #----------------------------------------------------------------------------
  def craft=(craft_id)
    return if @craft_id == craft_id
    @craft_id = craft_id
    refresh
  end
  #----------------------------------------------------------------------------
  # ● window_settings
  #----------------------------------------------------------------------------
  def window_width;      (Graphics.width * 0.33).to_i;           end
  def window_height;     return Graphics.height - 48;            end
  #----------------------------------------------------------------------------
  # ● upgraded method: update
  #----------------------------------------------------------------------------
  def update
    super
    if @detail_window && @detail_window.recipe_id != current_symbol
      @detail_window.recipe_id = current_symbol
    end
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: make_command_list
  #----------------------------------------------------------------------------
  def make_command_list
    if @recipes
      get_recipes
      sort_list
      @items.each do |item|
        add_command(item.crafted_item, item.recipe_id.to_s.to_sym, enabled?(item))
      end
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: get_recipes
  #----------------------------------------------------------------------------
  def get_recipes
    @items = []
    @recipes.each do |recipe_id|
      next unless $recipe[recipe_id].recipe_type == @craft_id
      item = $recipe[recipe_id]
      @items << item
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: sort_list
  #----------------------------------------------------------------------------
  def sort_list
    if Venka::Crafting::Sort_Type == :level                # Sort by level
      @items.sort!{|a, b| a.req_level <=> b.req_level} 
    elsif Venka::Crafting::Sort_Type == :alphabet          # Sort by alpha
      @items.sort!{|a, b| a.crafted_item.name <=> b.crafted_item.name}
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: enabled?
  #----------------------------------------------------------------------------
  def enabled?(recipe)
    if SceneManager.scene_is?(Scene_Crafting) || SceneManager.scene_is?(Scene_Recipes)
      return false if recipe.req_level > $craft[@craft_id].level
    end
    ingredients = recipe.ingredients
    required = recipe.ingredient_amount
    for i in 0...ingredients.size
      if ingredients[i].is_a?(Craft_Gold)
        owned = $game_party.gold
      else
        owned = $game_party.item_number(ingredients[i])
      end
      enabled = (owned < required[i] ? false : true)
      return false unless enabled
    end
    return enabled
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: draw_item
  #----------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect_for_text(index)
    return unless @items[index]
    set_font(:recipe_list, @list[index][:enabled])
    item = @list[index][:name]
    if $imported[:MAIcon_Hue]
      draw_icon_with_hue(item.icon_index, item.icon_hue, 
        rect.x + 1, rect.y, @list[index][:enabled])
    else
      draw_icon(item.icon_index, rect.x + 1, rect.y, @list[index][:enabled])
    end
    text = @items[index].display_name
    draw_text(rect.x + 26, rect.y, rect.width - 27, font_height, text)
  end
  #----------------------------------------------------------------------------
  # ○ new method: detail_window
  #----------------------------------------------------------------------------
  def detail_window=(detail_window)
    @detail_window = detail_window
    update
  end
  #----------------------------------------------------------------------------
  # ○ new method: status_window
  #----------------------------------------------------------------------------
  def status_window=(status_window)
    @status_window = status_window
    update
  end
end
#==============================================================================
# ■ Crafting_Details_Window
#==============================================================================
class Crafting_Details_Window < Window_Command;         include Venka::Crafting
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_reader      :recipe_id,        :started
  attr_reader      :result_exp,       :result_item,        :result_level
  attr_reader      :result_amount,    :result_message
  attr_accessor    :number
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize
    super((Graphics.width * 0.33).to_i, 48)
    self.opacity = Venka::Crafting::Window_Opacity
    self.back_opacity = Venka::Crafting::Window_BGOpacity
    @recipe_id = :none
    @recipe    = []
    @number    = 1
    @max_time  = Crafting_Time_Max
    @result_item    = nil
    @result_message = ""
    @started = @success = @failed = @result_level = false
    @result_exp = @result_amount = 0
    @ingredients = []
    unselect
    deactivate
  end
  #----------------------------------------------------------------------------
  # ● window settings
  #----------------------------------------------------------------------------
  def window_width;    Graphics.width - (Graphics.width * 0.33).to_i;   end
  def window_height;            Graphics.height - 48;              end
  def item_max;                 return 1;                          end
  def contents_height;          height - standard_padding * 2;     end
  def update_padding_bottom;    self.padding_bottom = 0;           end
  #----------------------------------------------------------------------------
  # ● upgraded method: item_height
  #----------------------------------------------------------------------------
  def item_height
    if Craft_Stacks
      Fonts[:button_text][1] + [24, Fonts[:recipe_name][1], Fonts[:other_text][1]].max
    else
      Fonts[:button_text][1]
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: recipe_id
  #----------------------------------------------------------------------------
  def recipe_id=(recipe_id)
    return if @recipe_id == recipe_id
    @recipe_id = recipe_id
    @recipe = $recipe[recipe_id.to_s.to_i]
    @craft_id = @recipe.recipe_type if @recipe
    refresh
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: make_command_list
  #----------------------------------------------------------------------------
  def make_command_list
    add_command(Craft_Button_Text, :craft, current_item_enabled?)
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: item_rect
  #----------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.y = contents.height - item_height
    return rect
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_item
  #----------------------------------------------------------------------------
  def draw_item(index)
    return unless @recipe_id
    rect = item_rect_for_text(index)
    set_font(:button_text, current_item_enabled?)
    draw_text(rect.x, rect.y, rect.width, font_height, Craft_Button_Text, 1)
    if Craft_Stacks
      draw_craft_number(rect.width/2, rect.y + font_height, rect.width, 
            rect.height - font_height)
    end
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: refresh
  #----------------------------------------------------------------------------
  def refresh
#   @max = 99
    @max = YEA::LIMIT::ITEM_MAX
    contents.clear
    @ingredient_count = 0
    super
    return unless @recipe_id && @craft_id
    width = contents.width
    @y = 0
    draw_recipe_header(0, @y, width)
    draw_line(@y)
    draw_item_description(0, @y, @recipe.crafted_item.description)
    draw_line(@y)
    draw_ingredient_header(0, @y, width)
    draw_ingredients
    draw_line(@y + 5)
    draw_all_items
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_recipe_header
  #----------------------------------------------------------------------------
  def draw_recipe_header(x, y, w)
    set_font(:header_text);    h2 = font_height
    set_font(:other_text);     h3 = font_height
    set_font(:recipe_name);    h1 = font_height
    lh = [h1, h2, h3].max
    draw_recipe_name(x, y, w - 60)
    draw_owned_items(x, y + lh, w)
    @y += lh * 2
    return unless Use_Craft_Exp
    draw_level_required(y, w)
    draw_recipe_exp(y + lh, w)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_recipe_name
  #----------------------------------------------------------------------------
  def draw_recipe_name(x, y, w)
    if $imported[:MAIcon_Hue]
      draw_icon_with_hue(@recipe.crafted_item.icon_index, @recipe.crafted_item.icon_hue, 
        x, y)
    else
      draw_icon(@recipe.crafted_item.icon_index, x, y)
    end
    draw_text(x + 25, y, w, font_height, @recipe.display_name)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_owned_items
  #----------------------------------------------------------------------------
  def draw_owned_items(x, y, w)
    set_font(:header_text)
    draw_text(x, y, w, font_height, Possessed_Text)
    width = text_size(Possessed_Text).width + 5
    set_font(:other_text)
    text = sprintf("×%2d", equip_items(@recipe.crafted_item))
    draw_text(x + width, y, w - width, font_height, text)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_level_required
  #----------------------------------------------------------------------------
  def draw_level_required(y, w)
    level = sprintf("%2d", @recipe.req_level)
    set_font(:header_text)
    lw = text_size(level).width + 5
    tw = text_size(Level_Text).width + 5
    draw_text(w - lw - tw, y, tw, font_height, Level_Text)
    set_font(:other_text)
    change_color(power_down_color) if @recipe.req_level > $craft[@craft_id].level
    draw_text(w - lw, y, lw, font_height, level, 2)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_recipe_exp
  #----------------------------------------------------------------------------
  def draw_recipe_exp(y, w)
    set_font(:header_text)
    width = text_size(EXP_Text).width + 5
    w2 = text_size(Possessed_Text).width + 5
    draw_text(w - width, y, width, font_height, EXP_Text, 2)
    set_font(:other_text)
    draw_text(w - 135, y, 100, font_height, @recipe.earned_exp.to_s, 2)
  end
  #----------------------------------------------------------------------------
  # ○ new method: equip_items
  #----------------------------------------------------------------------------
  def equip_items(item)
    count = $game_party.item_number(item)
    if Include_Equipment
      $game_party.members.each do |actor| 
        actor.equips.each {|gear| count +=1 if gear == item}
      end
    end
    return count
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_item_description
  #----------------------------------------------------------------------------
  def draw_item_description(x, y, text)
    set_font(:description)
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => font_height}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
    @y += font_height * 2
  end
  #----------------------------------------------------------------------------
  # ○ new method: update_number
  #----------------------------------------------------------------------------
  def update_number
    change_number(1)   if Input.repeat?(:RIGHT)
    change_number(-1)  if Input.repeat?(:LEFT)
    change_number(10)  if Input.repeat?(:UP)
    change_number(-10) if Input.repeat?(:DOWN)
  end
  #----------------------------------------------------------------------------
  # ○ new method: change_number
  #----------------------------------------------------------------------------
  def change_number(amount)
    @number = [[@number + amount, @max].min, 1].max
    Sound.play_cursor
    refresh
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_craft_number
  #----------------------------------------------------------------------------
  def draw_craft_number(x, y, w, h)
    # Set font to get true width of the string
    set_font(:recipe_name, current_item_enabled?)
    item_width = text_size("×#{@recipe.crafted_item.name}").width + 5
    set_font(:other_text, current_item_enabled?)
    amount = @recipe.crafted_amount * @number
    num_width  = text_size("×#{amount}").width + 5
    # Funky math to get how to center the string
    x -= (num_width + item_width + 24) * 0.5
    draw_text(x, y, w, h, "×#{amount}")
    x += num_width
    if $imported && $imported[:MAIcon_Hue]
      draw_icon_with_hue(@recipe.crafted_item.icon_index, 
              @recipe.crafted_item.icon_hue, x, y, enabled)
    else
      draw_icon(@recipe.crafted_item.icon_index, x, y)
    end
    x += 24
    set_font(:recipe_name, current_item_enabled?)
    draw_text(x, y, w, h, @recipe.crafted_item.name)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_ingredient_header
  #----------------------------------------------------------------------------
  def draw_ingredient_header(x, y, width)
    set_font(:header_text)
    @w = [text_size(Needed_Owned_Text).width + 5, width * 0.3].max
    draw_text(x, y, width - @w, font_height, Ingredients_Text)
    draw_text(x + (width - @w), y, @w, font_height, Needed_Owned_Text, 1)
    @y += font_height
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_ingredients
  #----------------------------------------------------------------------------
  def draw_ingredients
    @ingredients = @recipe.ingredients
    @required = @recipe.ingredient_amount.clone
    for i in 0...@ingredients.size
      ingredient = determine_required_ingredients(@ingredients[i], i)
      @max = [[@max, ingredient[3]].min, 1].max
      set_font(:other_text, ingredient[2])
      if $imported[:MAIcon_Hue]
        draw_icon_with_hue(@ingredients[i].icon_index, @ingredients[i].icon_hue, 
          0, @y, ingredient[2])
      else
        draw_icon(@ingredients[i].icon_index, 0, @y, ingredient[2])
      end
      draw_text(25, @y, contents.width - @w - 45, font_height, @ingredients[i].name)
      text = "#{ingredient[1]}/#{ingredient[0]}"
      draw_text(contents.width - @w, @y, @w, font_height, text, 1)
      @y += font_height
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: determine_required_ingredients
  #----------------------------------------------------------------------------
  def determine_required_ingredients(ingredient, i)
    if @ingredients[i].is_a?(Craft_Gold)
      owned = $game_party.gold
      needed = @required[i] * @number
    elsif ingredient.tool
      owned = $game_party.item_number(ingredient)
      needed = @required[i]
    else
      owned = $game_party.item_number(ingredient)
      needed = @required[i] * @number
    end
#   max_stacks = 99
    max_stacks = YEA::LIMIT::ITEM_MAX
    if !ingredient.is_a?(Craft_Gold) && ingredient.tool
      enabled = (owned >= needed) ? @ingredient_count += 1 : false
#     max_stacks = (owned >= needed) ? 99 : owned / @required[i] if @required[i] > 0
      max_stacks = (owned >= needed) ? YEA::LIMIT::ITEM_MAX \
                   : owned / @required[i] if @required[i] > 0
    else
      enabled = (owned < needed ? false : @ingredient_count += 1)
      max_stacks = owned / @required[i] if @required[i] > 0
    end
    [owned, needed, enabled, max_stacks]
  end
  #----------------------------------------------------------------------------
  # ○ new method: current_item_enabled?
  #----------------------------------------------------------------------------
  def current_item_enabled?
    return false unless @recipe_id
    return false if @recipe.req_level > $craft[@craft_id].level
#   return false if $game_party.item_number(@recipe.crafted_item) == 99
    return false if $game_party.item_number(@recipe.crafted_item) == \
                     YEA::LIMIT::ITEM_MAX
    return false if @ingredient_count != @ingredients.size
    return true
  end
  #----------------------------------------------------------------------------
  # ○ new method: start_crafting
  #----------------------------------------------------------------------------
  def start_crafting
    @claim_time   = @recipe.craft_time * @number
    @result_item  = nil
    @result_message = ""
    @elapsed = 0
    @buffer = Venka::Crafting::Timer_Type == :timer ? 0 : $craft[@craft_id].buffer_time
    @success = @failed = @result_level = false
    @result_exp = @result_amount = 0
    @started    = true
    @timer = 120
    @max_time = Crafting_Time_Max * @number
    @max_time = @claim_time if Venka::Crafting::Timer_Type == :timer
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: update
  #----------------------------------------------------------------------------
  def update
    super
    update_craft_bar while @started
    update_number if Craft_Stacks && self.active == true
  end
  #----------------------------------------------------------------------------
  # ○ new method: update_craft_bar
  #----------------------------------------------------------------------------
  def update_craft_bar
    Graphics.update
    Input.update
    activate_craft
    if Venka::Crafting::Timer_Type == :none
      @success = true
      rewards
    end
    rewards if Venka::Crafting::Timer_Type == :timer && @elapsed >= @max_time
    if Venka::Crafting::Timer_Type != :timer
      rewards if Input.trigger?(Input::C) || @elapsed >= @max_time
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: activate_craft
  #----------------------------------------------------------------------------
  def activate_craft
    return if Venka::Crafting::Timer_Type == :none
    play_sound
    rect = item_rect(index)
    unselect
    contents.clear_rect(rect)
#   rate = [@elapsed.to_f / @max_time, 1.0].min
    rate = [[@elapsed.to_f / @max_time, 1.0].min, 0.01].max
    if Venka::Crafting::Timer_Type == :timer
      @elapsed += 1
    else
      set_font(:help_text)
#     draw_text(rect.x, rect.y + font_height, rect.width, rect.height - font_height, Directions_Msg, 1)
      draw_text(120, 240 + font_height, 240, 28 - font_height, Directions_Msg, 0)
      if @elapsed < @max_time
        @elapsed += 1
      else
        @failed  = true
        @success = false
      end
    end
    if @claim_time + @buffer >= @elapsed and @elapsed >= @claim_time - @buffer
      @success = true
      gc1 = get_color(Claim_Gauge_Color1)
      gc2 = get_color(Claim_Gauge_Color2)
    else
      if @claim_time + @buffer < @elapsed
        @failed = true
      end
      @success = false
      gc1 = get_color(Craft_Gauge_Color1)
      gc2 = get_color(Craft_Gauge_Color2)
    end
#   draw_gauge(rect.x, rect.y, rect.width, rate, gc1, gc2)
    draw_gauge(120, 240, 240, rate, gc1, gc2)
  end
  #----------------------------------------------------------------------------
  # ○ new method: play_sound
  #----------------------------------------------------------------------------
  def play_sound
    return unless $craft[@craft_id].active_sound
    file_info = $craft[@craft_id].active_sound
    begin
      RPG::BGS.new(*file_info).play
    rescue
      RPG::SE.new(*file_info).play if @timer == 120
      @timer -= 1  if @timer > 0
      @timer = 120 if @timer == 0
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: rewards
  #----------------------------------------------------------------------------
  def rewards
    RPG::BGS.stop
    @started  = false
    level = $craft[@craft_id].level           # Check current level
    recipes = $craft.known_recipes            # Check current known recipes
    for i in 0...@ingredients.size            # Remove ingredients from bags
      if @ingredients[i].is_a?(Craft_Gold)
        $game_party.lose_gold(@required[i].round * @number)
      elsif !@ingredients[i].tool
        $game_party.lose_item(@ingredients[i], @required[i].round * @number) 
      end
    end
    # Get exp, items, and pop up message based on success
    @success ? success_rewards : failed_rewards
    # If crafting level changed, then do pop up message and play sound
    if level != $craft[@craft_id].level
      RPG::SE.new(*Level_Up_Sound).play
      @result_level = true
    end
    $craft.set_results(@craft_id, @result_exp, @result_message, @result_item, 
          @result_amount, @result_level)
    select(0)
    refresh
  end
  #----------------------------------------------------------------------------
  # ○ new method: success_rewards
  #----------------------------------------------------------------------------
  def success_rewards
    RPG::SE.new(*Success_Sound).play
    @result_exp     = @recipe.earned_exp * @number
    @result_message = Result_Msg
    @result_item    = @recipe.crafted_item
    @result_amount  = @recipe.crafted_amount * @number
    $game_party.gain_item(@result_item, @result_amount)
    $craft[@craft_id].gain_exp(@result_exp) if SceneManager.scene_is?(Scene_Crafting)
  end
  #----------------------------------------------------------------------------
  # ○ new method: failed_rewards
  #----------------------------------------------------------------------------
  def failed_rewards
    # Get the right sound file info
    sound_file = @failed ? Failure_Sound : Premature_Sound
    RPG::SE.new(*sound_file).play
    # Determine if you get a failure item
    @result_item = @failed ? @recipe.failed_item : @recipe.pre_failed_item
    # Get the right pop up message
    @result_message = @result_item ? Result_Msg : Failed_Msg
    # Determine if failure exp is allowed
    failed_exp = (@recipe.earned_exp * Failure_Exp_Rate).round * @number
    @result_exp = (Failure_Exp_Rate > 0 ? [failed_exp, 1].max : 0)
    # Give failure exp
    $craft[@craft_id].gain_exp(@result_exp) unless @result_exp == 0
    if @result_item && @failed
      @result_amount = @recipe.failed_amount * @number
    elsif @result_item
      @result_amount = @recipe.pre_failed_amount * @number
    end
    # Grant failure item if one exsists
    $game_party.gain_item(@result_item, @result_amount) if @result_item
  end
end
#==============================================================================
# ■ Crafting_Results_Window
#==============================================================================
class Crafting_Results_Window < Window_Base
  #----------------------------------------------------------------------------
  # ● upgraded method: initialize
  #----------------------------------------------------------------------------
  def initialize
    super(0, 0, Graphics.width * 0.8, fitting_height(4))
    self.opacity = Venka::Crafting::Result_Opacity
    self.back_opacity = Venka::Crafting::Result_BGOpacity
    self.openness = 0
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: refresh
  #----------------------------------------------------------------------------
  def refresh
    contents.clear
    return if $craft.results == []
    result_info
    resize_window
    draw_header
    draw_items_received
    draw_exp_received    if @exp > 0
    draw_level_up        if @leveled
    draw_new_recipes     if @learned
    wait_to_close
  end
  #----------------------------------------------------------------------------
  # ○ new method: result_info
  #----------------------------------------------------------------------------
  def result_info
    @craft_id = $craft.results[0]
    @results  = $craft.results[1]
    @learned  = $craft[@craft_id].learned_recipes
    @exp, @message, @item, @amount, @leveled = *@results
  end
  #----------------------------------------------------------------------------
  # ○ new method: resize_window
  #----------------------------------------------------------------------------
  def resize_window
    self.x = (Graphics.width - win_width) * 0.5
    self.y = (Graphics.height - win_height) * 0.5
    self.width  = win_width
    self.height = win_height
    create_contents
    open
  end
  #----------------------------------------------------------------------------
  # ○ new method: win_width
  #----------------------------------------------------------------------------
  def win_width
    set_font(:other_text)
    if @message == Venka::Crafting::Result_Msg
      text  = @message + "x#{@amount}" + @item.name
      width1 = text_size(text).width + 50 + standard_padding * 2
    else
      width1 = text_size(@message).width + 10 + standard_padding * 2
    end
    width2 = text_size(Venka::Crafting::Learn_Text).width + standard_padding * 2
    if @learned
      width = 0
      @learned.each do |recipe_id|
        recipe = $recipe[recipe_id]
        size   = text_size(recipe.display_name).width
        width  = size if size > width
      end
      width2 += width + 50
    end
    return [[width1, width2].max + 15, Graphics.width].min
  end
  #----------------------------------------------------------------------------
  # ○ new method: win_height
  #----------------------------------------------------------------------------
  def win_height
    h1 = Venka::Crafting::Fonts[:recipe_name][1] + standard_padding * 2
    h2 = [Venka::Crafting::Fonts[:other_text][1], 24].max
    height = h1 + h2 + (h2 * (@learned ? @learned.size : 0))
    height += h2 if @exp > 0
    height += [Venka::Crafting::Fonts[:button_text][1], 24].max if @leveled
    return height
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_header
  #----------------------------------------------------------------------------
  def draw_header
    set_font(:recipe_name)
    draw_text(0, 0, contents.width, font_height, Venka::Crafting::Results_Text, 1)
    @y = font_height
    color = normal_color
    contents.fill_rect(0, font_height - 2, contents_width, 1, color)
    color.alpha = 90
    contents.fill_rect(0, font_height - 1, contents_width, 1, color)
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_items_received
  #----------------------------------------------------------------------------
  def draw_items_received
    set_font(:other_text)
    x = 0
    case @message
    when Venka::Crafting::Result_Msg
      draw_text(x, @y, contents.width, font_height, @message)
      x += text_size(@message).width + 5
      if $imported[:MAIcon_Hue]
        draw_icon_with_hue(@item.icon_index, @item.icon_hue, x, @y)
      else
        draw_icon(@item.icon_index, x, @y)
      end
      x += 25
      draw_text(x, @y, contents.width - x, font_height, @item.name)
      x += text_size(@item.name).width + 5
      draw_text(x, @y, contents.width - x, font_height, "x#{@amount}")
    when Venka::Crafting::Failed_Msg
      draw_text(0, @y, contents.width, font_height, @message, 1)
    end
    @y += font_height
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_exp_received
  #----------------------------------------------------------------------------
  def draw_exp_received
    draw_text(0, @y, contents.width, font_height, Venka::Crafting::Exp_Earned)
    x = text_size(Venka::Crafting::Exp_Earned).width + 5
    text = $craft[@craft_id].max_level? ? Venka::Crafting::Max_Exp : @exp.to_s
    draw_text(x, @y, contents.width - x, font_height, text)
    @y += font_height
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_level_up
  #----------------------------------------------------------------------------
  def draw_level_up
    set_font(:button_text)
    draw_text(0, @y, contents.width, font_height, Venka::Crafting::Lv_Gain, 1)
    @y += font_height
  end
  #----------------------------------------------------------------------------
  # ○ new method: draw_new_recipes
  #----------------------------------------------------------------------------
  def draw_new_recipes
    set_font(:other_text)
    prefix = Venka::Crafting::Learn_Text
    @learned.each do |recipe_id|
      recipe = $recipe[recipe_id]
      x = 0
      draw_text(x, @y, contents.width, font_height, prefix)
      x += text_size(prefix).width + 5
      if $imported[:MAIcon_Hue]
        draw_icon_with_hue(recipe.crafted_item.icon_index, @item.icon_hue, x, @y)
      else
        draw_icon(recipe.crafted_item.icon_index, x, @y)
      end
      x += 25
      draw_text(x, @y, contents.width - x, font_height, recipe.display_name)
      @y += font_height
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: wait_to_close
  #----------------------------------------------------------------------------
  def wait_to_close
    loop do
      Graphics.update
      Input.update
      update
      break if Input.trigger?(Input::C)
    end
    self.close
  end
end
#==============================================================================
# ■ Scene_Crafting
#==============================================================================
class Scene_Crafting < Scene_Base;                      include Venka::Crafting
  #----------------------------------------------------------------------------
  # ○ new method: prepare
  #----------------------------------------------------------------------------
  def prepare(craft_id)
    @craft_id = craft_id
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: start
  #----------------------------------------------------------------------------
  def start
    super
    create_background if $craft[@craft_id].bg_image
    craft_sounds
    create_all_windows
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_all_windows
  #----------------------------------------------------------------------------
  def create_all_windows
    create_title_window
    create_list_window
    create_detail_window
    create_result_window
    if $imported[:CraftingStats_Addon]
      create_status_window
      create_confirm_window
    end
  end
  #----------------------------------------------------------------------------
  # ● upgraded method: terminate
  #----------------------------------------------------------------------------
  def terminate
    super
    dispose_background if $craft[@craft_id].bg_image
    if $craft[@craft_id].bg_music
      fadeout_all(60)
      @map_bgm.replay
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft_sounds
  #----------------------------------------------------------------------------
  def craft_sounds
    RPG::SE.new(*Start_Scene).play
    if $craft[@craft_id].bg_music
      @map_bgm = RPG::BGM.last
      fadeout_all(60)
      RPG::BGM.new(*$craft[@craft_id].bg_music).play
    end
  end
  #----------------------------------------------------------------------------
  # ○ new method: dispose_background
  #----------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_background
  #----------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
    begin;      bitmap = Cache.title1($craft[@craft_id].bg_image)
    rescue;     bitmap = Cache.picture($craft[@craft_id].bg_image)
    end
    rect = Rect.new(0, 0, Graphics.width, Graphics.height)
    @background_sprite.bitmap.stretch_blt(rect, bitmap, bitmap.rect)
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_title_window
  #----------------------------------------------------------------------------
  def create_title_window
    @title_window = Crafting_Title_Window.new
    @title_window.viewport = @viewport
    @title_window.craft = @craft_id
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_list_window
  #----------------------------------------------------------------------------
  def create_list_window
    @list_window = Recipe_List_Window.new(0, @title_window.height)
    @list_window.viewport = @viewport
    @list_window.craft = @craft_id
    @list_window.set_handler(:ok,      method(:to_detail_window))
    @list_window.set_handler(:cancel,  method(:return_scene))
  end
  #----------------------------------------------------------------------------
  # ○ new method: to_detail_window
  #----------------------------------------------------------------------------
  def to_detail_window
    @detail_window.activate.select(0)
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_detail_window
  #----------------------------------------------------------------------------
  def create_detail_window
    @detail_window = Crafting_Details_Window.new
    @detail_window.viewport = @viewport
    @detail_window.set_handler(:craft,      method(:craft_start))
    @detail_window.set_handler(:cancel,  method(:return_to_list))
    @list_window.detail_window = @detail_window
  end
  #----------------------------------------------------------------------------
  # ○ new method: craft_start
  #----------------------------------------------------------------------------
  def craft_start
    Sound.play_ok
    @detail_window.start_crafting
    while @detail_window.started
      Graphics.update
      Input.update
      update
    end
    @list_window.refresh
    @result_window.refresh if Pop_up_Window
    to_detail_window
  end
  #----------------------------------------------------------------------------
  # ○ new method: return_to_list
  #----------------------------------------------------------------------------
  def return_to_list
    Sound.play_cancel
    @detail_window.unselect
    @list_window.activate
  end
  #----------------------------------------------------------------------------
  # ○ new method: create_result_window
  #----------------------------------------------------------------------------
  def create_result_window
    @result_window = Crafting_Results_Window.new
    @result_window.viewport = @viewport
  end
end

 

Spoiler

#===============================================================================
# Crafting Script Customize Settings - v3.8                 updated: 10/27/2014
#===============================================================================
# - Introduction -
#------------------------------------------------------------------------------
#  A script that allows the player to craft items. There's a menu to help the 
#  player keep track of their recipes and items needed to make their items.
#  You can have multiple crafts (Cooking, Smithing, Alchemy, etc). Each craft
#  has it's own exp, levels and recipes.
#  
#  You can set up a gauge that shows progress on crafting an item (you can turn 
#  the gauge off, make it a progress bar or set it as an interactive gauge). 
#  The interactive gauge will change colors when you can claim an item. If you 
#  press enter when the color changes, then you successfully craft the item. If 
#  you do it before the change then you consume the ingredients and make 
#  nothing (with the option of still earning some exp). If you try to claim the 
#  item after the gauge's color changes back to it's original color, then you 
#  have waited too long and you can receive a failed item (and the option of 
#  some exp).
#
#  For example, if you're cooking and you cook for too long then you could 
#  receive a burnt item.
#  
#  You can also make items that you can carry in the player's inventory that 
#  allows them to craft wherever they go. I used a Mortar and Pestle in the
#  demo for Alchemy.
#
#------------------------------------------------------------------------------
# - Instructions -
#------------------------------------------------------------------------------
#  This script is not plug and play since the database has been adjusted to 
#  show off what this script can do.
#  
#  Place this script below Materials, but above Main. If you are using this 
#  script with modern algebra's Icon Hues, then put this script below that one.
#  
#------------------------------------------------------------------------------
# - Item/Weapon/Armor Note Tags -
#------------------------------------------------------------------------------
#  Use the following note tag in any item, weapon, or armor that you don't 
#  want consumed when crafting. The item should be listed in the recipe's 
#  required ingredients.
#     <tool>
#  
#------------------------------------------------------------------------------
# - Script Calls -
#------------------------------------------------------------------------------
# To call the scene use:
#   craft(craft_id)
#      craft_id = This is the ID set for the craft at Craft_Info
#
#    EXAMPLE: craft(1)
#      This would call the Craft_Info at ID 1, which is "Cooking". So the 
#      windows would open and show recipes and info for Cooking.
#  
# To teach the player a new recipe use:
#   learn_recipe(recipe_id)
#      recipe_id is the ID in Recipes.
#
#    EXAMPLE: learn_recipe(1)
#      This would call the recipe that matches Recipes[1]. Which is the 
#      Loaf of Bread recipe for cooking. So it will show when the cook book 
#      is open, but not any other craft books.
#  
# To delete a recipe use:
#   forget_recipe(recipe_id)
#      recipe_id is the ID in Recipes.
#      NOTE: It's the same as learn_recipe but it removes the recipe.
#
# To check the current crafting level:
#   $craft[craft_id].level                   - player's level
#   $craft[craft_id].exp                     - player's total craft exp
#   $craft[craft_id].change_level(level)     - grant or lose levels
#      craft_id = This is the ID set for the craft at Craft_Info
#      level = the levels you want to add or loose.
#   $craft[craft_id].set_level(level)        - change to a specific level
#      craft_id = This is the ID set for the craft at Craft_Info
#      level = the levels you want to set the craft to.
#   recipe_learned?(recipe_id)               - checks if recipe is learned
#      You'd want to use this in a conditional branch to see if a skill is 
#      learned. You do NOT need to use this to prevent from learning a recipe
#      twice (you can only ever learn a recipe once).
#
#   EXAMPLES: $craft[2].level      - Checks the Smithing Level
#             $craft[3].exp        - Checks the total exp earned for Alchemy
#             $craft[1].change_level(3)     - Would grant 3 levels to Cooking
#                NOTE: You can use negative numbers to loose levels.
#             $craft[1].change_level(-1)    - Would loose 1 level to Cooking
#             $craft[3].set_level(8)        - Would set alchemy to level 8
#
#==============================================================================
$imported = {} unless $imported
$imported[:Venka_Crafting] = true
#===============================================================================
# ■ Venka Module
#===============================================================================
module Venka; module Crafting
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - General Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Window_Opacity     = 255      # Window overall opacity. Number 0 - 255
  Window_BGOpacity   = 180      # Window background opacity (default 192)
  Auto_Learn         = false    # Automatically learn recipes when leveling
  Gold_Icon          = 0        # Icon Index used for Gold Coins
  Gold_Text          = "\\*\\r[26]"   # Text used to represent currency
  Gold_Hue           = 0        # Icon Hue (if using modern alegbra's Icon Hues)
  Use_Line_Dividers  = true     # Toggle the display of line separators
  Failure_Exp_Rate   = 0.25     # Exp received when failed. Ex 0.25 is 25%
  Include_Equipment  = false    # Include equipped items in total owned items?
  Use_Craft_Exp      = true     # Use craft exp and levels true/false
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Craft Time Settings - 
  #----------------------------------------------------------------------------
  # This effects how the timer gauge will function. It can be :active, :timer,
  # or :none. 
  #   :active - The player must try to hit the action key while the gauge is 
  #             green to get a successfully crafted item. Too soon or too late 
  #             will result in failed items.
  #   :timer  - This will be a bar to show progress made. The time on the bar 
  #             will be set to the craft_time for the recipe. There are no 
  #             failure items or key presses.. it's just a progress bar.
  #   :none   - Skip the gauge all together, instantly craft the item.
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Timer_Type = :active#timer         # Set to :active, :timer, or :none
  Crafting_Time_Max  = 1000    # Max craft time (total time)
  Crafting_Buffer    = 30      # Buffer to activated timer (window for claiming)
  Default_Craft_Time = 500     # Default craft time (when to claim item)
  Time_Variance      = 100     # Variance to craft time, set to 0 to disable
  Accelerate_Time    = true    # Craft time gets faster as you out level them
  # This is the rate to speed up craft time. This should be between 0.1 and 0.9
  Accelerate_Rate    = 0.9     # The lower the number, the faster it speeds up.
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Craft Stack Settings -
  #----------------------------------------------------------------------------
  # This is where you can set out if you want the player to be able to craft 
  # stacks of items. If you have the Timer_Type set to :none, then all other 
  # settings that effect the timers won't matter.
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Craft_Stacks = true        # Set to true to allow crafting of stacks of items
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Recipe List Sort Setting - 
  #----------------------------------------------------------------------------
  # You can set how the list will sort. You can sort it by required crafting 
  # level, alphabetically by the item's name that is crafted, or the default 
  # method of showing them in the order they were created.
  # If there is a typo in the choice setting, the it defaults to :default
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Sort_Type = :default      # choices are :level, :alphabet, or :default
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Gauge Color Settings - 
  #----------------------------------------------------------------------------
  # You can use window skin color code by simply putting the number (0 - 31) 
  # OR use RBG Colors by putting (red, blue, green, opacity) 0 - 255 each.
  #    Examples:    Exp_Gauge_Color1 = 27
  #                 Exp_Gauge_Color1 = [10, 100, 215, 100]
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Exp_Gauge_Color1   = [110,   0, 215, 200]   # Left side of the exp gauge
  Exp_Gauge_Color2   = [180, 150, 255, 230]   # Right side of the exp gauge
  Craft_Gauge_Color1 = 10                     # Left side of the crafting gauge
  Craft_Gauge_Color2 = 21                     # Right side of the crafting gauge
  Claim_Gauge_Color1 = [ 25, 100,   0, 255]   # Left side of the claim gauge
  Claim_Gauge_Color2 = [  0, 255,   0, 240]   # Right side of the claim gauge
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Sound Settings -
  #----------------------------------------------------------------------------
  # The file should be one found in the SE folder. Volume is 1 - 100
  # Pitch can be 50 - 200
  # Use this format: [ "FileName", Volume, Pitch ]
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Start_Scene      = ["Book1", 80, 100]            # Sound on book open
  Success_Sound    = ["Item1", 80, 75]             # Crafted successfully
  Premature_Sound  = ["SciFi Buzzer", 80, 100]    # Crafted too soon
  Failure_Sound    = ["SciFi Cancel", 80, 50]            # Crafted too late
  Level_Up_Sound   = ["Sound2", 80, 100]           # Gained crafting level
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Text Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Craft_Button_Text = "Start"        # What the begin crafting button displays
  Directions_Msg    = "Press \\r\\*[37] when the bar is green" # Instructions Text
  Possessed_Text    = "Currently Owned:"                    # Total Owned Text
  Ingredients_Text  = "Ingredients:"                        # Ingredients Text
  Needed_Owned_Text = "Need/Have"                           # Needed/Owned Text
  Level_Text = "CLV: "                                      # Level Text
  EXP_Text   = "  CRE"                                      # Exp Text
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Results Pop-up Window Settings -
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Pop_up_Window    = true     # Use the pop up window
  Result_Opacity   = 255      # Result window's over all opacity. Number 0 - 255
  Result_BGOpacity = 215      # Result window's background opacity (default 192)
  Results_Text = "Results"    # Text shown at the top of the Results Window
  Failed_Msg = "No good..."   # Fail message
  Result_Msg = "Made:"                             # Success Message
  Lv_Gain    = "Got better!"                             # Level up message
  Exp_Earned = "Credence:"                              # Exp Earned message
  Max_Exp    = "Mastered!"                               # Message for max exp
  Learn_Text = "Learned:"                                 # Learned prefix
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Font Settings -
  #----------------------------------------------------------------------------
  # :title_text   = the text craft's name in the Title Window.
  # :recipe_name  = the recipe's name at the top of the detail window
  # :recipe_list  = font used in the recipe list window
  # :header_text  = the "Ingredients: Needed/Owned" line in the detail window
  # :description  = the crafted item's description text.
  # :help_text    = the text that appears when crafting an item.
  # :other_text   = all other text
  # :button_text  = the Create/Cancel Buttons test
  # 
  # For each text type you need to set up the Fonts, Size, Boldness and Color.
  # Use the following format:
  #   [["Font_Name, Font_Name, etc], Font_Size, Bold?, Color]],
  #      Font_Name = an array holding font choices. The fist one is your first 
  #         choice to use, but if the player doesn't have that font on their 
  #         computer, it will go through the list until it finds one it can use
  #      Font_Size = the size font you want to use
  #      Bold? = this should be true for bold, false to turn bold off
  #      Color = This is the same format as setting colors for Gauge Color.
  #         Use [red, blue, green, opacity] or window skin color number.
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Line_Color = [150, 150, 250, 225] # Color used for divider lines
  Fonts = {       # [["Fonts"]],           Size, Bold?, Color
    :title_text  => [["Cambria", "Calibri"], 24, true,  0],
    :recipe_name => [["Cambria", "Calibri"], 25, true,  14],
    :recipe_list => [["Cambria", "Calibri"], 24, true,  0],
    :header_text => [["Cambria", "Calibri"], 24, true,  1],
    :description => [["Cambria", "Calibri"], 22, false, 0],
    :help_text   => [["Cambria", "Calibri"], 24, false, 17],
    :other_text  => [["Cambria", "Calibri"], 22, false, 0],
    :button_text => [["Cambria", "Calibri"], 24, true, [0, 255, 0, 200]],
    } # <- DO NOT REMOVE
  Craft_Info ||= {} # <- DO NOT REMOVE
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Craft_Info Settings -
  #----------------------------------------------------------------------------
  #  Craft_Info[ID] => {                          # ID must be a unique number
  #      :craft_name    => "Title",               # The name of the craft
  #          "Title" will be the name of the craft
  #      :craft_time    => n,                     # n would be the craft time
  #          You can set the default craft time of items by their craft type.
  #          This option can be omitted. If you do use this option, it will 
  #          overwrite the Default_Craft_Time set above for this craft type.
  #      :buffer_time   => n,                     # n would be the buffer time
  #          You can set the default buffer time of items by their craft type.
  #          The buffer time is the window of opportunity when you can craft 
  #          an item when using the :active crafting Timer_Type. You can omit 
  #          this setting and it will use the Crafting_Buffer time.
  #      :exp_table     => [A, B, C, D],          # Exp Curve
  #          A is the base exp needed (this number can be 10 or higher)
  #          B is the exp tacked on to each level (this can be 0 or higher)
  #          C is a curve that effects all levels (must be 10 or higher)
  #          D is another curve that effects high levels mostly (must be 10+)
  #          NOTE: This functions exactly like class exp in the database
  #      :max_level     => x,                     # Max Craft Level
  #          x is the maximum level for the craft (1-99)
  #      :mastered      => "Text",                # Title seen at Max Level
  #          "Text" is text shown when the exp gauge for the craft is maxed out
  #      :bg_image      => "File_Name",           # Background image for scene
  #          "File_Name" is file found Graphics/Titles1 or Graphics/Picture.
  #          Use nil to omit this option.
  #      :bg_music      => "File_Name",           # Background music for scene
  #          "File_Name" is file found Audio/BGM. Use nil to omit
  #      :active_sound  => ["File_Name", Volume, Pitch],  # Sound while crafting
  #          For this one, it will check in the Audio/BGS folder first if it 
  #          doesn't find the file, then it'll check in Audio/SE. If the file 
  #          is a SE (sound effect) it will play ever 2 seconds. Can be omitted.
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=begin  
  Craft_Info[1] = {  # Cooking
    :craft_name    => "Cook",
    :craft_time    => 30,
    :buffer_time   => 90,
    :exp_table     => [ 10, 5, 12, 20],
    :max_level     => 3,
    :mastered      => "Top Chef",
    :bg_image      => "Book",
    :bg_music      => nil,
    :active_sound  => ["Fire", 100, 100],
    } # <-DO NOT REMOVE
  Craft_Info[2] = {  # Blacksmith
    :craft_name    => "Smith",
    :exp_table     => [ 12, 3, 20, 15],
    :max_level     => 30,
    :mastered      => "Master Smith",
    :bg_image      => "CrossedSwords",
    :bg_music      => nil,
    :active_sound  => ["Hammer", 100, 100],
    } # <-DO NOT REMOVE
  Craft_Info[3] = {  # Alchemy
    :craft_name    => "Alchemy",
    :exp_table     => [ 10, 0, 10, 10],
    :max_level     => 35,
    :mastered      => "Potion Genius",
    :bg_image      => "Hexagram",
    :bg_music      => ["Dungeon7", 90, 100],
    :active_sound  => ["Drips", 100, 100],
    } # <-DO NOT REMOVE
  Craft_Info[4] = {  # Fishing
    :craft_name    => "Fishing",
    :exp_table     => [ 10, 0, 10, 10],
    :max_level     => 99,
    :mastered      => "Master Angler",
    :bg_image      => "Island",
    :bg_music      => nil,
    } # <-DO NOT REMOVE
  Craft_Info[5] = {  # Mining
    :craft_name    => "Mining",
    :exp_table     => [ 10, 0, 10, 10],
    :max_level     => 99,
    :mastered      => "Excavator",
    :bg_image      => "Crystal",
    :bg_music      => nil,
    } # <-DO NOT REMOVE
  Craft_Info[6] = {  # Lumberjack
    :craft_name    => "Lumberjack",
    :exp_table     => [ 10, 0, 10, 10],
    :max_level     => 99,
    :mastered      => "Paul Bunyan",
    :bg_image      => nil,
    :bg_music      => nil,
    } # <-DO NOT REMOVE
=end    
  Craft_Info[1] = {  # Mixology
    :craft_name    => "Mixology",
#   :craft_time    => 90,
#   :buffer_time   => 180,
    :craft_time    => 60,
    :buffer_time   => 150,
    :exp_table     => [16, 4, 16, 16],
    :max_level     => 40,
    :mastered      => "Mixologist Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Bubbling", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[2] = {  # Smithing
    :craft_name    => "Smithing",
    :craft_time    => 90,
    :buffer_time   => 180,
    :exp_table     => [12, 3, 15, 20],
    :max_level     => 50,
    :mastered      => "Forgeprint Master",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Hammer", 100, 100],
    } # <-DO NOT REMOVE
  Craft_Info[3] = {  # Satineer
    :craft_name    => "Satineer",
    :craft_time    => 70,
    :buffer_time   => 180,
    :exp_table     => [15, 0, 10, 30],
    :max_level     => 50,
    :mastered      => "Seamstress Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Equip3", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[4] = {  # Jeweler
    :craft_name    => "Jeweler",
    :craft_time    => 75,
    :buffer_time   => 240,
    :exp_table     => [13, 2, 25, 20],
    :max_level     => 50,
    :mastered      => "Gem Appraiser Pro",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Metal Cursor", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[5] = {  # Aetherology
    :craft_name    => "Aetherology",
    :craft_time    => 120,
    :buffer_time   => 60,
    :exp_table     => [30, 0, 15, 10],
    :max_level     => 50,
    :mastered      => "Void Weaver",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Fog1", 100, 50],
    } # <-DO NOT REMOVE
  Craft_Info[6] = {  # Cosmetology
    :craft_name    => "Cosmetology",
    :craft_time    => 90,
    :buffer_time   => 90,
    :exp_table     => [15, 5, 10, 20],
    :max_level     => 40,
    :mastered      => "Beauty Guru",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Scraping", 100, 150],
    } # <-DO NOT REMOVE
  Craft_Info[7] = {  # Smelting
    :craft_name    => "Smelting",
    :craft_time    => 90,
    :buffer_time   => 180,
    :exp_table     => [12, 3, 15, 20],
    :max_level     => 40,
    :mastered      => "Metal Melter",
    :bg_image      => nil,
    :bg_music      => nil,
    :active_sound  => ["Fire", 100, 90],
    } # <-DO NOT REMOVE
  
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  # - Recipe Settings -
  #----------------------------------------------------------------------------
  # To create a recipe you will need to fill out the information below. Most of 
  # these entries are optional. The only ones that MUST be defined are the ID, 
  # :recipe_type, :crafted_item and :ingredients. The id is requred so the 
  # script can find the recipe. The :recipe_type is so it know which crafting 
  # category it belongs to. The :crafted_item is what it will produce (failed 
  # and prefailed items are optional). And lastly, you will need to set up 
  # atleast one required item to craft in :ingredients. It can be an item, gold, 
  # weapons or armor or any combo of these items. There are 10 recipes set up 
  # in the demo that should demonstrate the various things you can do.
  # 
  # Recipe[ID] => {      The ID must be a unique number.
  #   :recipe_type  => x,
  #         x = the Craft_Info ID this recipe belongs to.
  #             If it was 1 then it'd be a cooking recipe, 2 is blacksmith, etc
  #   :auto_learn    => false,
  #         This can be omitted. This option only works if Auto_Learn = true
  #         You'll set this option to false if you want this recipe to be 
  #         learned from a special source (like a NPC, quest, boss kill, etc).
  #   :req_level    => y
  #         y = the crafting level needed to make the recipe
  #   :display_name => "text"
  #         text is the text that will appear in place of the crafted item's 
  #         name. The crafted items icon will still show.
  #   :shop_fee => n,         # The cost to craft the recipe at a shop keeper
  #         n = a number in gold pieces. This only matters if using the Shop
  #             Craft & Decompile Add on script.
  #   :craft_time   => t,
  #         t = time in frames (60 frames = 1 second). This is the time when 
  #             the recipe can claim success. Before the time results in lost
  #             ingredients and no item. After this time results in lost
  #             ingredients and a failed attempt item is granted.
  #         NOTE: You can omit this one to use the Default_Craft_Time above
  #   :earned_exp   => exp,
  #         exp = the amount of exp received on successful crafting of the item
  #   :crafted_item => [:Type/Item_ID, Amount],
  #   :failed_item  => [:Type/Item_ID, Amount], # Item made if crafted too late
  #   :pre_failed   => [:Type/Item_ID, Amount], # Item made if crafted too soon
  #   :ingredients  => [[:Type/ItemID, Amount], [:Type/ItemID, Amount], ... ]
  #         Type = i for Items
  #                a for Armor
  #                w for Weapons
  #                g for Gold
  #         Item_ID = item's id in the database
  #         Amount  = the amount of items to reward
  # 
  # NOTE: :ingredients can have multiple entries. The following entries can be
  #     omitted - :failed_item, :pre_failed, and :craft_time
  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Recipes ||= {}
  #--------------------------------------------------------------------------
  # - Custom Recipes Start Here -
  #--------------------------------------------------------------------------
=begin  
  Recipes[1] = {     # Loaf of Bread
    :recipe_type  => 1,            # Cooking Recipe
    :auto_learn   => true,         # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Bake Bread", # Name that appears on the recipe
    :shop_fee     => 20,           # Fee charged if crafted at a shop
    :craft_time   => 200,          # Time it takes to make the item
    :earned_exp   => 3,            # Exp gained on success
    :crafted_item => [:i20, 2],    # Makes 2x Loaf of Bread
    :failed_item  => [:i29, 1],    # 1x Piece of Charcoal if failed attempt
    :pre_failed   => [:i19, 1],    # Failed item if crafted before timer
    :ingredients  => [ # 2x Eggs,  1x Flour,   1x Fresh Milk, 5 Gold
                     [:i21, 2], [:i22, 1], [:i23, 1], [:g5],
    ]} # <- DO NOT REMOVE
  Recipes[2] = {     # Stew
    :recipe_type  => 1,          # Cooking Recipe
    :auto_learn   => false,      # Must learn this recipe from the Cook NPC
    :req_level    => 2,          # Level required to use this recipe
    :craft_time   => 250,        # Time it takes to make the item
    :earned_exp   => 5,          # Exp gained on success
    :crafted_item => [:i24, 1],  # Makes 1x Stew
   #:failed_item  => [:i29, 1],  # Omitting failed item. You'd just get no item
    :ingredients  => [# 2x Meat, 1x Carrot, 1x Bell Pepper, 1x Onion
                     [:i25, 2], [:i26, 1], [:i27, 1], [:i28, 1],
  ]} # <- DO NOT REMOVE
  Recipes[3] = {     # Cestus
    :recipe_type  => 2,          # Smithing Recipe
    :auto_learn   => false,      # Store bought recipe (add on required)
    :req_level    => 3,          # Level required to use this recipe
    :craft_time   => 400,        # Time it takes to make the item
    :earned_exp   => 0,          # Exp gained on success (0 exp test)
    :crafted_item => [:w7, 1],   # Makes 1x Cestus
    :failed_item  => [:i36, 1],  # 1x Slag on failed attempt
    :ingredients  => [ # 3x Iron Ore, x3 Claw
                     [:i33, 3], [:i37, 3],
  ]} # <- DO NOT REMOVE
  Recipes[4] = {     # Chain Mail
    :recipe_type  => 2,          # Smithing Recipe
    :req_level    => 2,          # Level required to use this recipe
    :craft_time   => 400,        # Time it takes to make the item
    :earned_exp   => 5,          # Exp gained on success
    :crafted_item => [:a31, 1],  # Makes 1x Chain Mail
    :failed_item  => [:i36, 1],  # 1x Slag on failed attempt
    :ingredients  => [# 2x Iron Ore, 3x Leather Straps, 1x Hammer
                     [:i33, 2], [:i34, 3], [:w43, 1]
  ]} # <- DO NOT REMOVE
  Recipes[5] = {     # Battle Axe
    :recipe_type  => 2,          # Smithing Recipe
    :req_level    => 1,          # Level required to use this recipe
   #:craft_time   => 300,        # Time omitted to use default time of 500
    :earned_exp   => 4,          # Exp gained on success
    :crafted_item => [:w2, 1],   # Makes 1x Battle Axe
    :failed_item  => [:i36, 1],  # 1x Slag on failed attempt
    :pre_failed   => [:i36, 1],  # 1x Slag on pre-timer fail
    :ingredients  => [# 1x Iron Ore, 1x Wooden Shaft
                     [:i33, 1], [:i35, 1],
  ]} # <- DO NOT REMOVE
  Recipes[6] = {     # Potion
    :recipe_type  => 3,          # Alchemy Recipe
    :auto_learn   => false,      # Eric auto learns this with the actor add-on
    :req_level    => 1,          # Level required to use this recipe
    :craft_time   => 350,        # Time it takes to make the item
    :earned_exp   => 4,          # Exp gained on success
    :crafted_item => [:i1, 1],   # Makes 1x Potion
    :failed_item  => [:i45,1],   # 1x Gelatinous Goo when crafted too late
   #:pre_failed   => [:i45,1],   # 1x Gelatinous Goo when crafted too soon
    :ingredients  => [# 1x Lizard Hearts, 1x Sea Shell, 1x Bunsen Burner
                     [:i40, 1], [:i42, 1], [:i45, 1],
  ]} # <- DO NOT REMOVE
  Recipes[7] = {     # Stimulant
    :recipe_type  => 3,          # Alchemy Recipe
    :auto_learn   => false,      # Eric will auto learn this recipe
    :req_level    => 2,          # Level required to use this recipe
    :craft_time   => 500,        # Time it takes to make the item
    :earned_exp   => 7,          # Exp gained on success
    :crafted_item => [:i5, 1],   # Makes 1x Stimulant
    :failed_item  => [:i45,1],   # 1x Gelatinous Goo when crafted too late
    :ingredients  => [# 1x Sea Shell, 1x Pixie Dust
                     [:i42, 1], [:i41, 1],
  ]} # <- DO NOT REMOVE
  Recipes[8] = {     # Magic Water
    :recipe_type  => 3,          # Alchemy Recipe
    :req_level    => 3,          # Level required to use this recipe
    :auto_learn   => false,      # Eric will auto learn this recipe
    :craft_time   => 450,        # Time it takes to make the item
    :earned_exp   => 12,         # Exp gained on success
    :crafted_item => [:i4, 1],   # Makes 1x Magic Water
    :failed_item  => [:i45,1],   # 1x Gelatinous Goo when crafted too late
    :ingredients  => [# 1x Pixie Dust, 1x Diamond Dust
                     [:i41, 1], [:i43, 1],
  ]} # <- DO NOT REMOVE
  Recipes[9] = {     # Hi-Potion
    :recipe_type  => 3,          # Alchemy Recipe
    :req_level    => 5,          # Level required to use this recipe
    :crafted_item => [:i2, 1],   # Makes 1x Hi-Potion
    :ingredients  => [# 3x Potions, 1x Diamond Dust
                     [:i1, 3], [:i43, 1],
  ]} # <- DO NOT REMOVE
  Recipes[10] = {     # Bamboo Pole
    :recipe_type  => 4,            # Fishing Recipe
    :req_level    => 1,            # Level required to use this recipe
    :craft_time   => 80,           # Time it takes to make the item
    :earned_exp   => 5,            # Exp gained on success
    :crafted_item => [:i53, 1],    # Makes 1x Bamboo Pole
    :failed_item  => [:i57, 1],    # 1x Bamboo
    :pre_failed   => [:i57, 1],    # 1x Bamboo
    :ingredients  => [ # 1x Bamboo,  1x Twine
                     [:i57, 1], [:i58, 1],
    ]} # <- DO NOT REMOVE
  Recipes[11] = {     # Fishing Pole
    :recipe_type  => 4,            # Fishing Recipe
    :req_level    => 10,           # Level required to use this recipe
    :craft_time   => 120,          # Time it takes to make the item
    :earned_exp   => 100,          # Exp gained on success
    :crafted_item => [:i54, 1],    # Makes 1x Fishing Pole
    :failed_item  => [:i53, 1],    # 1x Bamboo Pole
    :pre_failed   => [:i53, 1],    # 1x Bamboo Pole
    :ingredients  => [# Bamboo Pole,  1x Bamboo,  1x Twine
                     [:i53, 1], [:i57, 1], [:i58, 1],
    ]} # <- DO NOT REMOVE
  Recipes[12] = {     # Heavy Rod
    :recipe_type  => 4,            # Fishing Recipe
    :req_level    => 30,           # Level required to use this recipe
    :craft_time   => 200,          # Time it takes to make the item
    :earned_exp   => 500,          # Exp gained on success
    :crafted_item => [:i55, 1],    # Makes 1x Heavy Rod
    :failed_item  => [:i54, 1],    # 1x Fishing Pole
    :pre_failed   => [:i54, 1],    # 1x Fishing Pole
    :ingredients  => [# Fishing Pole,  1x Bamboo,  1x Twine
                     [:i53, 1], [:i57, 1], [:i58, 1],
    ]} # <- DO NOT REMOVE
=end    
  Recipes[0] = {     # Lemon Ale (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Lemon Ale (pint)",  # Name that appears on the recipe
    :shop_fee     => 350,          # Fee charged if crafted at a shop
    :craft_time   => 160,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 12,           # Exp gained on success
    :crafted_item => [:i41,1],     # Makes a pint of Lemon Ale
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 2 Lemons, 1 each of Valstrig Vinegar and Empty Flask.
                       # Also requires a tool, Mixer.                     
                     [:i70,2],[:i77,1],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[1] = {     # Lemon Ale (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Lemon Ale (quart)",  # Name that appears on the recipe
    :shop_fee     => 750,          # Fee charged if crafted at a shop
    :craft_time   => 180,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 15,           # Exp gained on success
    :crafted_item => [:i42,1],     # Makes a quart of Lemon Ale
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 4 Lemons, 1 each of Valstrig Vinegar and Empty Flask.
                       # Also requires a tool, Mixer.                     
                     [:i70,4],[:i77,1],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[2] = {     # Pinberry Ludo (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Pinberry Ludo (pint)",  # Name that appears on the recipe
    :shop_fee     => 600,          # Fee charged if crafted at a shop
    :craft_time   => 240,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 16,           # Exp gained on success
    :crafted_item => [:i43,1],     # Makes a pint of Pinberry Ludo
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 3 Pinberries, 2 Valstrig Vinegar and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i71,3],[:i77,2],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[3] = {     # Pinberry Ludo (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Pinberry Ludo (quart)",  # Name that appears on the recipe
    :shop_fee     => 1300,         # Fee charged if crafted at a shop
    :craft_time   => 280,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 18,           # Exp gained on success
    :crafted_item => [:i44,1],     # Makes a quart of Pinberry Ludo
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 5 Pinberries, 2 Valstrig Vinegar and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i71,5],[:i77,2],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[4] = {     # Gibbler Dram (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 2,            # Level required to use this recipe
    :display_name => "Gibbler Dram (pint)",  # Name that appears on the recipe
    :shop_fee     => 450,          # Fee charged if crafted at a shop
    :craft_time   => 300,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 28,           # Exp gained on success
    :crafted_item => [:i45,1],     # Makes a pint of Gibbler Dram
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 5 Sairen Cherries, 3 Valstrig Vinegar and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,5],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[5] = {     # Gibbler Dram (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 2,            # Level required to use this recipe
    :display_name => "Gibbler Dram (quart)",  # Name that appears on the recipe
    :shop_fee     => 900,          # Fee charged if crafted at a shop
    :craft_time   => 360,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 36,           # Exp gained on success
    :crafted_item => [:i46,1],     # Makes a quart of Gibbler Dram
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 9 Sairen Cherries, 3 Valstrig Vinegar and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,9],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[6] = {     # Sairen Rum (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 3,            # Level required to use this recipe
    :display_name => "Sairen Rum (pint)",  # Name that appears on the recipe
    :shop_fee     => 550,          # Fee charged if crafted at a shop
    :craft_time   => 300,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 40,           # Exp gained on success
    :crafted_item => [:i47,1],     # Makes a pint of Sairen Rum
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 2 Lemons, 4 Sairen Cherries, 2 Valstrig Vinegar,
                       # and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i70,2],[:i72,5],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[7] = {     # Sairen Rum (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 3,            # Level required to use this recipe
    :display_name => "Sairen Rum (quart)",  # Name that appears on the recipe
    :shop_fee     => 1200,         # Fee charged if crafted at a shop
    :craft_time   => 360,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 48,           # Exp gained on success
    :crafted_item => [:i48,1],     # Makes a quart of Sairen Rum
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 3 Lemons, 6 Sairen Cherries, 3 Valstrig Vinegar,
                       # and 1 Empty Flask. Also requires a tool, Mixer.
                     [:i70,3],[:i72,6],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[8] = {     # Key Lime Rusko (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 4,            # Level required to use this recipe
    :display_name => "Key Lime Rusko (pint)",  # Name that appears on the recipe
    :shop_fee     => 680,          # Fee charged if crafted at a shop
    :craft_time   => 180,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 24,           # Exp gained on success
    :crafted_item => [:i49,1],     # Makes a pint of Key Lime Rusko
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 4 Key Limes, 3 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i73,4],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[9] = {     # Key Lime Rusko (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 4,            # Level required to use this recipe
    :display_name => "Key Lime Rusko (quart)",  # Name that appears on the recipe
    :shop_fee     => 1300,         # Fee charged if crafted at a shop
    :craft_time   => 200,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 30,           # Exp gained on success
    :crafted_item => [:i50,1],     # Makes a quart of Key Lime Rusko
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 7 Key Limes, 4 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i73,7],[:i77,4],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[10] = {     # Gobai Plum Rum (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 8,            # Level required to use this recipe
    :display_name => "Gobai Plum Rum (pint)",  # Name that appears on the recipe
    :shop_fee     => 650,          # Fee charged if crafted at a shop
    :craft_time   => 360,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 52,           # Exp gained on success
    :crafted_item => [:i51,1],     # Makes a pint of Gobai Plum Rum
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 3 Sairen Cherries, 3 Gobai Cherries, 2 Gobai Plums, 
                       # 2 Gobai Apples, 3 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,3],[:i74,3],[:i75,2],[:i76,2],
                     [:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[11] = {     # Gobai Plum Rum (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 8,            # Level required to use this recipe
    :display_name => "Gobai Plum Rum (quart)",  # Name that appears on the recipe
    :shop_fee     => 1300,         # Fee charged if crafted at a shop
    :craft_time   => 400,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 60,           # Exp gained on success
    :crafted_item => [:i52,1],     # Makes a quart of Gobai Plum Rum
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 5 Sairen Cherries, 5 Gobai Cherries, 3 Gobai Plums, 
                       # 3 Gobai Apples, 4 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,5],[:i74,5],[:i75,3],[:i76,3],
                     [:i77,4],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[12] = {     # Gobai Apple Rum (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 8,            # Level required to use this recipe
    :display_name => "Gobai Apple Rum (pint)",  # Name that appears on the recipe
    :shop_fee     => 650,          # Fee charged if crafted at a shop
    :craft_time   => 180,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 52,           # Exp gained on success
    :crafted_item => [:i53,1],     # Makes a pint of Gobai Apple Rum
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 1 Sairen Cherry, 5 Gobai Cherries, 4 Gobai Apples,
                       # 3 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,1],[:i74,5],[:i76,4],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[13] = {     # Gobai Apple Rum (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 8,            # Level required to use this recipe
    :display_name => "Gobai Apple Rum (quart)",  # Name that appears on the recipe
    :shop_fee     => 1300,         # Fee charged if crafted at a shop
    :craft_time   => 240,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 60,           # Exp gained on success
    :crafted_item => [:i54,1],     # Makes a quart of Gobai Apple Rum
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 1 Sairen Cherry, 7 Gobai Cherries, 4 Gobai Apples,
                       # 3 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i72,1],[:i74,7],[:i76,4],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[14] = {     # Alogara (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 11,           # Level required to use this recipe
    :display_name => "Alogara (pint)",  # Name that appears on the recipe
    :shop_fee     => 1950,         # Fee charged if crafted at a shop
    :craft_time   => 480,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 72,           # Exp gained on success
    :crafted_item => [:i55,1],     # Makes a pint of Alogara
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 2 Lemons, 4 Sairen Cherries, 4 Key Limes,
                       # 2 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i70,2],[:i72,4],[:i73,4],[:i77,2],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[15] = {     # Alogara (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 11,           # Level required to use this recipe
    :display_name => "Alogara (quart)",  # Name that appears on the recipe
    :shop_fee     => 4850,         # Fee charged if crafted at a shop
    :craft_time   => 640,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 88,           # Exp gained on success
    :crafted_item => [:i56,1],     # Makes a quart of Alogara
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 3 Lemons, 5 Sairen Cherries, 6 Key Limes,
                       # 3 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i70,3],[:i72,5],[:i73,6],[:i77,3],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[16] = {     # Volemia (pint)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 14,           # Level required to use this recipe
    :display_name => "Volemia (pint)",  # Name that appears on the recipe
    :shop_fee     => 3650,         # Fee charged if crafted at a shop
    :craft_time   => 540,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 96,           # Exp gained on success
    :crafted_item => [:i57,1],     # Makes a pint of Volemia
    :failed_item  => [:i65,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i63,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 7 Pinberries, 4 Sairen Cherries, 4 Gobai Cherries,
                       # 5 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i71,7],[:i72,4],[:i74,4],[:i77,5],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE
  Recipes[17] = {     # Volemia (quart)
    :recipe_type  => 1,            # Mixology Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 14,           # Level required to use this recipe
    :display_name => "Volemia (quart)",  # Name that appears on the recipe
    :shop_fee     => 9700,         # Fee charged if crafted at a shop
    :craft_time   => 720,          # Time it takes to make the item
    :buffer_time  => 300,          # Added time for crafting
    :earned_exp   => 112,          # Exp gained on success
    :crafted_item => [:i58,1],     # Makes a quart of Volemia
    :failed_item  => [:i66,1],     # Makes Swill if failed attempt
    :pre_failed   => [:i64,1],     # Makes Swill if crafted before timer
    :ingredients  => [ # 12 Pinberries, 8 Sairen Cherries, 8 Gobai Cherries,
                       # 7 Valstrig Vinegar, and 1 Empty Flask.
                       # Also requires a tool, Mixer.
                     [:i71,12],[:i72,8],[:i74,8],[:i77,7],[:i40,1],[:i78,1],
    ]} # <- DO NOT REMOVE  
  Recipes[100] = {     # Knife
    :recipe_type  => 2,            # Smithing Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Knife",      # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:w3,  1],    # Makes a Knife
    :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Broken Knife, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:w501,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE  
  Recipes[101] = {     # Knife
    :recipe_type  => 2,            # Smithing Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Knife",      # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:w3,  1],    # Makes a Knife
    :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:i100,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE  
  Recipes[200] = {     # Stockings
    :recipe_type  => 3,            # Satineering Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Stockings",  # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:a6,  1],    # Makes Stockings
#   :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:i100,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[300] = {     # Stockings
    :recipe_type  => 4,            # Satineering Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Stockings",  # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:a6,  1],    # Makes Stockings
#   :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:i100,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[400] = {     # Stockings
    :recipe_type  => 5,            # Satineering Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Stockings",  # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:a6,  1],    # Makes Stockings
#   :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:i100,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[500] = {     # Stockings
    :recipe_type  => 6,            # Satineering Recipe
    :auto_learn   => false,        # Auto-learn this recipe
    :req_level    => 1,            # Level required to use this recipe
    :display_name => "Stockings",  # Name that appears on the recipe
    :shop_fee     => 25,           # Fee charged if crafted at a shop
    :craft_time   => 60,           # Time it takes to make the item
    :buffer_time  => 900,          # Added time for crafting
    :earned_exp   => 4,            # Exp gained on success
    :crafted_item => [:a6,  1],    # Makes Stockings
#   :pre_failed   => [:w501,1],    # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, and 1 Brass Coin.
                       # Also requires the following tools: 
                       # Corundum Mold, Steel Grinder, Mallet.
                     [:i100,1], [:i99,1], [:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[600] = {     # Iron Ingot (1)
    :recipe_type  => 7,                # Smelting Recipe
    :auto_learn   => false,            # Auto-learn this recipe
    :req_level    => 1,                # Level required to use this recipe
    :display_name => "Iron Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,               # Fee charged if crafted at a shop
    :craft_time   => 60,               # Time it takes to make the item
    :buffer_time  => 900,              # Added time for crafting
    :earned_exp   => 4,                # Exp gained on success
    :crafted_item => [:i108, 1],       # Makes one Iron Ingot
    :pre_failed   => [:i100, 1],       # Failed item if crafted before timer
    :ingredients  => [ # 3 Iron Chunks.
                       # Also requires the following tools: 
                       # Shovel.
                     [:i100,3], [:i84,1], #[:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[601] = {     # Iron Ingot (1)
    :recipe_type  => 7,                # Smelting Recipe
    :auto_learn   => false,            # Auto-learn this recipe
    :req_level    => 1,                # Level required to use this recipe
    :display_name => "Iron Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,               # Fee charged if crafted at a shop
    :craft_time   => 90,               # Time it takes to make the item
    :buffer_time  => 900,              # Added time for crafting
    :earned_exp   => 6,                # Exp gained on success
    :crafted_item => [:i108, 1],       # Makes one Iron Ingot
    :pre_failed   => [:i100, 1],       # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Ore.
                       # Also requires the following tools: 
                       # Shovel.
                     [:i115,1], [:i84,1], #[:i89,1], [:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[602] = {     # Iron Ingot (2)
    :recipe_type  => 7,                # Smelting Recipe
    :auto_learn   => false,            # Auto-learn this recipe
    :req_level    => 1,                # Level required to use this recipe
    :display_name => "Iron Ingot (2)", # Name that appears on the recipe
    :shop_fee     => 25,               # Fee charged if crafted at a shop
    :craft_time   => 120,              # Time it takes to make the item
    :buffer_time  => 900,              # Added time for crafting
    :earned_exp   => 8,                # Exp gained on success
    :crafted_item => [:i108, 2],       # Makes two Iron Ingots
    :pre_failed   => [:i100, 1],       # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Ore, and 2 Iron Chunks.
                       # Also requires the following tools: 
                       # Shovel.
                     [:i115,1], [:i100, 2], [:i84,1], #[:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[603] = {     # Brass Ingot (1)
    :recipe_type  => 7,                 # Smelting Recipe
    :auto_learn   => false,             # Auto-learn this recipe
    :req_level    => 1,                 # Level required to use this recipe
    :display_name => "Brass Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,                # Fee charged if crafted at a shop
    :craft_time   => 300,               # Time it takes to make the item
    :buffer_time  => 300,               # Added time for crafting
    :earned_exp   => 6,                 # Exp gained on success
    :crafted_item => [:i107, 1],        # Makes one Brass Ingot
    :pre_failed   => [:i99, 1],         # Failed item if crafted before timer
    :ingredients  => [ # 2 Corundum Chunks, and 1 Copper Chunk.
                       # Also requires the following tools: 
                       # Shovel.
                     [:i101,2], [:i103, 1], [:i84,1], #[:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[604] = {     # Brass Ingot (1)
    :recipe_type  => 7,                 # Smelting Recipe
    :auto_learn   => false,             # Auto-learn this recipe
    :req_level    => 1,                 # Level required to use this recipe
    :display_name => "Brass Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,                # Fee charged if crafted at a shop
    :craft_time   => 330,               # Time it takes to make the item
    :buffer_time  => 300,               # Added time for crafting
    :earned_exp   => 8,                 # Exp gained on success
    :crafted_item => [:i107, 1],        # Makes one Brass Ingot
    :pre_failed   => [:i99, 1],         # Failed item if crafted before timer
    :ingredients  => [ # 1 Corundum Ore, and 1 Copper Ore.
                       # Also requires the following tools: 
                       # Shovel.
                     [:i116,1], [:i117, 1], [:i84,1], #[:i80,1], [:i88,1],
    ]} # <- DO NOT REMOVE
  Recipes[605] = {     # Brass Ingot (2)
    :recipe_type  => 7,                 # Smelting Recipe
    :auto_learn   => false,             # Auto-learn this recipe
    :req_level    => 1,                 # Level required to use this recipe
    :display_name => "Brass Ingot (2)", # Name that appears on the recipe
    :shop_fee     => 25,                # Fee charged if crafted at a shop
    :craft_time   => 390,               # Time it takes to make the item
    :buffer_time  => 300,               # Added time for crafting
    :earned_exp   => 12,                # Exp gained on success
    :crafted_item => [:i107, 2],        # Makes two Brass Ingots
    :pre_failed   => [:i99, 1],         # Failed item if crafted before timer
    :ingredients  => [ # 1 Corundum Chunk, 1 Copper Chunk,
                       # 1 Corundum Ore, and 1 Copper Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i101,1], [:i103,1], [:i116,1], [:i117, 1], [:i84,1],
    ]} # <- DO NOT REMOVE
  Recipes[606] = {     # Corundum Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Corundum Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 180,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 10,                   # Exp gained on success
    :crafted_item => [:i109, 1],           # Makes one Corundum Ingot
    :pre_failed   => [:i101, 1],           # Failed item if crafted before timer
    :ingredients  => [ # 2 Corundum Chunks.
                       # Also requires the following tools:
                       # Shovel.
                     [:i101,2], [:i84,1], #[:i103,1], [:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[607] = {     # Corundum Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Corundum Ingot (1)", # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 210,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 12,                   # Exp gained on success
    :crafted_item => [:i109, 1],           # Makes one Corundum Ingot
    :pre_failed   => [:i101, 1],           # Failed item if crafted before timer
    :ingredients  => [ # 2 Corundum Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i116,2], [:i84,1], #[:i103,1], [:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[608] = {     # Corundum Ingot (2)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Corundum Ingot (2)", # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 240,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 12,                   # Exp gained on success
    :crafted_item => [:i109, 2],           # Makes two Corundum Ingots
    :pre_failed   => [:i101, 1],           # Failed item if crafted before timer
    :ingredients  => [ # 2 Corundum Chunks, and 1 Corundum Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i101,2], [:i116,1], [:i84,1], #[:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[609] = {     # Steel Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Steel Ingot (1)",    # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 240,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 12,                   # Exp gained on success
    :crafted_item => [:i110, 1],           # Makes one Steel Ingot
    :pre_failed   => [:i100, 1, :i101, 1], # Failed item if crafted before timer
    :ingredients  => [ # 2 Corundum Chunks, and 2 Iron Chunks.
                       # Also requires the following tools:
                       # Shovel.
                     [:i101,2], [:i100,2], [:i84,1], #[:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[610] = {     # Steel Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Steel Ingot (1)",    # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 330,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 16,                   # Exp gained on success
    :crafted_item => [:i110, 1],           # Makes one Steel Ingot
    :pre_failed   => [:i100, 1, :i101, 1], # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Ore, and 1 Corundum Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i115,1], [:i116,1], [:i84,1], #[:i103,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[611] = {     # Steel Ingot (2)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 3,                    # Level required to use this recipe
    :display_name => "Steel Ingot (2)",    # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 420,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 20,                   # Exp gained on success
    :crafted_item => [:i110, 2],           # Makes two Steel Ingots
    :pre_failed   => [:i100, 1, :i101, 1], # Failed item if crafted before timer
    :ingredients  => [ # 1 Iron Chunk, 1 Corundum Chunk,
                       # 1 Iron Ore, and 1 Corundum Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i100,1], [:i101,1], [:i115, 1], [:i116,1], [:i84,1],
    ]} # <- DO NOT REMOVE
  Recipes[612] = {     # Copper Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 5,                    # Level required to use this recipe
    :display_name => "Copper Ingot (1)",   # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 420,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 12,                   # Exp gained on success
    :crafted_item => [:i111, 1],           # Makes one Copper Ingot
    :pre_failed   => [:i103, 1],           # Failed item if crafted before timer
    :ingredients  => [ # 2 Copper Chunks, and 1 Copper Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i103,2], [:i117,1], [:i84,1], #[:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[613] = {     # Copper Ingot (1)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 5,                    # Level required to use this recipe
    :display_name => "Copper Ingot (1)",   # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 480,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 16,                   # Exp gained on success
    :crafted_item => [:i111, 1],           # Makes one Copper Ingot
    :pre_failed   => [:i103, 1],           # Failed item if crafted before timer
    :ingredients  => [ # 2 Copper Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i117,2], [:i84,1], #[:i103,2], [:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
  Recipes[614] = {     # Copper Ingot (2)
    :recipe_type  => 7,                    # Smelting Recipe
    :auto_learn   => false,                # Auto-learn this recipe
    :req_level    => 7,                    # Level required to use this recipe
    :display_name => "Copper Ingot (2)",   # Name that appears on the recipe
    :shop_fee     => 25,                   # Fee charged if crafted at a shop
    :craft_time   => 600,                  # Time it takes to make the item
    :buffer_time  => 300,                  # Added time for crafting
    :earned_exp   => 24,                   # Exp gained on success
    :crafted_item => [:i111, 2],           # Makes two Copper Ingots
    :pre_failed   => [:i103, 2],           # Failed item if crafted before timer
    :ingredients  => [ # 3 Copper Chunks, and 2 Copper Ore.
                       # Also requires the following tools:
                       # Shovel.
                     [:i103,3], [:i117,2], [:i84,1], #[:i116,1], [:i117, 1],
    ]} # <- DO NOT REMOVE
         
#===============================================================================
# ■ Notetag settings. Skip edits here unless you know what you're doing
#===============================================================================
end; end
module Venka::Notetag
  Tool = /<(?:TOOL|tool)>/i
end

 

 

Share this post


Link to post
Share on other sites
Posted (edited)

Edit, Everything works on my. bars/text shows up, had to switch to true on auto learn to to test it out first time.

 

I tried replacing the recipe numbers, 0 with 1, & having them all in order 1 2 3 4, wasn't an issue.

"Press \\r\\*[37] when the bar is green" I don't think that will work when in "    " quotes, if that's an issue(might just on my end).

I tired swapping the script order. Crafting Script Customize Settings - v3.8  goes above 3.7 in the script order. that wasn't the is.

 

Might be a script conflict with other scripts in your order try place these two & it's menu addon if used higher up on the script list.

 

Now I've done 

learn_recipe(600)

$craft[7].set_level(40)

craft(7)

add crafting items.

Still works, besides the "Press \\r\\*[37]

 

no issue with not having bar.

 

edit

learn_recipe(600)
learn_recipe(601)
learn_recipe(602)
learn_recipe(603)
learn_recipe(604)
learn_recipe(605)
learn_recipe(606)

checked as well

Edited by EXVA

Share this post


Link to post
Share on other sites
37 minutes ago, EXVA said:

"Press \\r\\*[37] when the bar is green"

That is a thing from a different script. It's Modern Algebra's Global Text Codes, and I use it to reference button icons, that change depending on a variable setting.
(it's a reference to the specific icons I have set for 'C')

40 minutes ago, EXVA said:

Crafting Script Customize Settings - v3.8  goes above 3.7 in the script order.

What I meant by using all the scripts is that I'm using: (in the following order)
Customize
Main v.3.8
Difficulty Settings
Menu Access
Shop Recipes
Shop Craft and Decompile
Actor Stat Changes
I'm not using any of the other versions of Main. Should I be??

Share this post


Link to post
Share on other sites
Posted (edited)

No that should be fine, all I meant is customize is above crafting in the script order.

#===============================================================================
# Crafting Script Customize Settings - v3.8                 updated: 10/27/2014
#===============================================================================
 Crafting Script v3.7                                      updated: 12/15/2014
#  Based off of Cooking Script v1.0 for RPG Maker VX by GubiD 

Keep Menu Addon & try moving Difficulty Settings & the others all the way to the bottom below MAIN SCRIPTS so they don't function to see if it's one of them messing with it.

What I don't understand is why your script would work for me & not you, so it's always good to copy the other scripts away to bottom for testing purposes unless you can make  a new project folder to just test these scripts, I'm thinking it has to be a conflict somewhere.

I only use the first two & menu, so if it's something wrong with the difficulty one I won't know how to fix it & thats what it seems like it starting to look like.

Edited by EXVA

Share this post


Link to post
Share on other sites

The only thing I can think of is that item(rect) is somehow involved.

Anyway, thanks for trying.

I tried disabling the scripts suggested, and nothing changed. I strongly believe that the help text and gauge are being drawn incorrectly somehow, but unless I send the entire project off for examination, I don't think this is getting resolved at all.

Share this post


Link to post
Share on other sites
17 hours ago, PhoenixSoul said:

I send the entire project off for examination

That usually is the fastest way to get help, but if you have a lot of custom assets then making a duplicate and removing the custom assets would be best, plus it will let you test your issue on another project.

So, if you can make a small demo, then either EXVA or myself can test it and see if we can find the issue.

I'm still away from home and not back until next week.

  • Like 1

Share this post


Link to post
Share on other sites

Alright...
@EXVA
@roninator2
This here is the demo. In-game, there's a dev cheat menu, press Input:A and Input:Z simultaneously to access it. The option 'Crafting Test' is there.
To access the debug menu, either press [F9] or Input:L and Input:R simultaneously, or access in menu ('Switchboards'-an arcade machine reference).

Share this post


Link to post
Share on other sites
Posted (edited)

This was extremely improper on roninator2's part, please pull/delete the files you've posted, mainly  for volunteering me, :). JK

Firstly PhoenixSoul I suggest never including your data map files beyond what's needed in to show the issue your having.

The demo could have been built better if all the files were just for the demo you can ignore the above comment,

The demo didn't work on my end either, had to remove a few scripts to properly launch it without crashing it.

The game freezes up a lot too, so I removed the intro text of the game to speed up finding this issue within the scripts.

 

Load this in your project editor & pull the two scripts out, the bar should be working, but the icon a bit glitched on the screen at the bottom.

Don't just drop it into your folder overwriting the original back it up, open a second editor to pull the scripts.

Scripts.rvdata2

I moved your edits into my script & then I edited your main.

Venka-Crafting Stations = Crafting Script Customize Settings - v3.8

Crafting Script v3.8  MAIN  lines edited 

1208

 draw_text(rect.x + 65, rect.y + font_height - 75, 240, 28 - font_height, Directions_Msg, 1)
      #draw_text(120, 240 + font_height - 50, 240, 28 - font_height, Directions_Msg, 1)

1229

   draw_gauge(rect.x + 75, rect.y - 75, 240, rate, gc1, gc2)
    #draw_gauge(120, 240 - 50, 240, rate, gc1, gc2)

I tried to figure out exactly why your bar & text wasn't showing up so I had to tinker with these lines.

The main issue was the game launched from the editor worked just fine, but when launched from the game.exe it wouldn't show the bar/text.

It was the most bizarre weird glitch I have ever seen, I honestly can't figure out what caused it nor could I find the secondary cause in the 

Crafting Script Customize Settings - v3.8, placing the edits in my Venka-Crafting Stations fixed it by I have no idea why, you'll need to add your other edits that are missing.

I see I missed these.

    :title_text  => [["Consolas Italic"], 20, true,  0],
    :recipe_name => [["Consolas Italic"], 20, true,  14],
    :recipe_list => [["Consolas Italic"], 12, true,  0],
    :header_text => [["Consolas Italic"], 20, true,  1],
    :description => [["Consolas Italic"], 13, false, 0],
    :help_text   => [["Consolas Italic"], 20, false, 17],
    :other_text  => [["Consolas Italic"], 20, false, 0],
    :button_text => [["Consolas Italic"], 20, true, [0, 255, 0, 200]],

Edited by EXVA
  • Like 1

Share this post


Link to post
Share on other sites

Well, this seems to work now. At first, I was thinking "Oh great, a font I don't think I have..."
(this would only cause nothing to appear because Venka knows why)
I'm willing to guess the font I chose is not one you have, and that's fine, but for some reason, when using it for the one text that's problematic, it's what doesn't show up. Yeah, I went with a specific aesthetic, Cambria fits it well. So, I tried changing the font to one that would be more readable, because Italics tend to get cut off (that's a font renderer thing), but it didn't show up with any other until I switched it to Arial. I also decided to create a new font type and have it so that the affected text is only shown during the crafting process.

Anyway, it works now, but I noticed that there's a significant delay between the initiation of the crafting process, and the bar showing up, for just those two crafting types. Makes me wonder, many things, but for certain, if other settings are playing a role in this, or maybe, this Intel Celeron is just too much like crap. Mercy knows.
 

On 8/29/2022 at 7:32 PM, EXVA said:

The demo didn't work on my end either, had to remove a few scripts to properly launch it without crashing it.

I'm curious though, what was crashing (error messages and such would of been more helpful), because that was technically, a release candidate, so, if I need to incorporate other bug fixes, now's the time to let me know!!!!!

On 8/29/2022 at 7:32 PM, EXVA said:

The game freezes up a lot too, so I removed the intro text of the game to speed up finding this issue within the scripts.

It does? Huh. I know it's not running at anywhere near 60 FPS on my 2007 DELL, but unless your PC is lower specs than mine (or maybe it's a Windows 10 thing?), this shouldn't be a thing. Again, more context would be appreciated, because if there are bugs, I need to know. Thank you.

Share this post


Link to post
Share on other sites

The  problem I had was with your driving scripts they weren't working because I was missing a custom library file or something.

  • Thanks 1

Share this post


Link to post
Share on other sites

Last year I downgraded to a older acer aspire E 15 laptop it's about 6 years old & only 2.3ghz,

it's plenty capable, ace games can be very unoptimized & even mine suffers from having a lot

of parallel events running needing 3.0ghz to run smoothly at 60fps even after I optimized it.

Clicking through the first menu to fast & using different menus in the demo caused crashing

but I chalk that part to the removal of the driving scripts to get it working in the first place.

Edited by EXVA
  • Thanks 1

Share this post


Link to post
Share on other sites
On 8/31/2022 at 9:50 PM, EXVA said:

driving scripts

Double dammit...
I forgot completely, to put the MODE7 DLL files in with the demo upload. Sorry about that.

On 8/31/2022 at 10:01 PM, EXVA said:

Last year I downgraded to a older acer aspire E 15 laptop it's about 6 years old & only 2.3ghz

The CPU is slightly better than mine it seems (if that is the CPU's clock speed).

On 8/31/2022 at 10:01 PM, EXVA said:

VX Ace games can be very unoptimized...

Oh yes, and I've played one where the devs outright encourage saving the game often because the game (RGSS3 Player itself) is likely to crash at any given time. I think it's really a problem with the battle system, but that's what happens when everything shown in the battle scene (aside from the menu UI) is a bunch of animations.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted