Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Leon_Westbrooke on January 18, 2008, 02:53:48 am

Title: [XP] Castlevania CoD style Crafting System
Post by: Leon_Westbrooke on January 18, 2008, 02:53:48 am
Castlevania CoD style Crafting System
Authors: Leon_Westbrooke
Version: 1.3
Type: Crafting
Key Term: Misc System



Introduction
This script is based on the Castlevania: Curse of Darkness system.  It allows you to specify 1 or more recipes per item made.  For instance, 2 ways to make a 'Full Potion'.


Features




Screenshots
(http://i50.photobucket.com/albums/f310/virtuouspaladin9/craft1.jpg)



Demo
Craft_System_Demo.zip (http://www.filefactory.com/file/143bac)


Instructions
The instructions are in the script.


Compatibility
I know of no known compatability issues.


Credits and Thanks
Please, credit Leon for this script, but I in turn, credit Tiberius_XXVII for teaching me to script.


Author's Notes
No notes.
Title: Re: Castlevania CoD style Crafting System
Post by: Nortos on January 18, 2008, 03:00:22 am
looks good :) I'll take a look at it later when I have time
Title: Re: Castlevania CoD style Crafting System
Post by: Evilbob on January 18, 2008, 04:58:53 am
Lol I miss read it and was like, WTF call of duty didn't have a crafting system did it?  Nice script though!
Title: Re: Castlevania CoD style Crafting System
Post by: Fantasist on January 19, 2008, 11:00:57 am
Nice script, I can learn from it. I should explore the RMXP data structure more *downloads demo and tries out*

EDIT: You need to have an account in RMXP Unlimited to dl the demo, could you host it on File Factory or Sendspace :)
Title: Re: Castlevania CoD style Crafting System
Post by: Sally on January 19, 2008, 02:31:08 pm
COD is a great game... :) :o
Title: Re: Castlevania CoD style Crafting System
Post by: Leon_Westbrooke on January 20, 2008, 09:30:30 pm
I sincerely apologize with the demo's upload location.  It has been changed from RMXP_Unlimited, to mega upload.  If anyone cannot get it from there, please, PM me. I'll be more than happy to send you the demo.
Title: Re: Castlevania CoD style Crafting System
Post by: Fantasist on January 21, 2008, 03:53:44 am
Okay, thanks but I personally prefer non-megaupload download. Just mentioning :)
Title: Re: Castlevania CoD style Crafting System
Post by: Nortos on January 21, 2008, 04:38:27 am
*cough* sendspace *cough*

:)
Title: Re: Castlevania CoD style Crafting System
Post by: Blizzard on January 21, 2008, 05:55:06 am
*cough* filefactory *cough*

:)
Title: Re: Castlevania CoD style Crafting System
Post by: Leon_Westbrooke on January 21, 2008, 03:09:50 pm
I have posted a new url using filefactory instead of megaupload.  Just a small update.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Kathis on February 05, 2008, 03:47:25 pm
This might just be me, but I believe you forgot to post the script and we are required to hunt it off the demo...
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Nortos on February 05, 2008, 04:58:57 pm
no you do have to get it off demo there's post limit unless Blizz increased it
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Blizzard on February 05, 2008, 05:02:28 pm
It's 50000 characters if I'm not wrong. I can increase it if Leon needs it, though.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Kathis on February 05, 2008, 11:54:53 pm
I see was not aware of that..however looking at the script in the demo... is it possible to make it so that the recipies don't show unless it is "unlocked" ? that way its not like "Hey I have all the herbs and I am only level 2 lets make the strongest potion in the game!" >_>;; or create the strongest weapon or armor or anything really...
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Sally on June 07, 2008, 10:23:24 pm
download link down, please reupload.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: tSwitch on June 12, 2008, 12:11:19 pm
I don't have the demo, but here's the script for you.

#========================================
#  Leon's Crafting System
#  v1.03
#-------------------------------------------------------
#
#  Features:
#    By default, if the player has the items for a recipe, they will learn it.
#    You can set some to be triggered by events.
#
#  Instructions:
#    Put below all default scripts, but above Main.
#    Follow the examples in the module, and put in the numbers where needed.
#     it is the easiest way to make it usable without too much coding.
#
#  To make an item so an event must be triggered:
#     Add the ID number to the right area.  The right area for:
#       Items:  Item_Event_Triggered = []
#       Weapons:  Weapon_Event_Triggered = []
#       Armors:  Armor_Event_Triggered = []
#
#  If the item is evented, and needs to be added to the list, use this in script
#  (without the 'For Items', 'For Weapons', and 'For Armors'):
#    For items:
#      $game_party.event_item.push(item_id)
#      $game_party.compile
#
#    For weapons:
#      $game_party.event_weapon.push(weapon_id)
#      $game_party.compile
#
#    For armors:
#      $game_party.event_armor.push(armor_id)
#      $game_party.compile
#
#  If you want each item to be added via 'recipe':
#    Set each item to be 'evented'.
#    To add them, use this in call script (without the 'For Items', 'For Weapons', and 'For Armors'):
#      For Items:
#        $game_party.item_recipe_availible.push(item_id)
#        $game_party.item_recipes_made[item_id] = 0
#      For Weapons:
#        $game_party.weapon_recipe_availible.push(weapon_id)
#        $game_party.weapon_recipes_made[weapon_id] = 0
#      For Armors:
#        $game_party.armor_recipe_availible.push(armor_id)
#        $game_party.armor_recipes_made[armor_id] = 0
#     
#
#
#  Additional Information:
#    If you are having troubles with the Craft_Item_Comp, Craft_Weapon_Comp, and
#    Craft_Armor_Comp:
#      The way it is set up is:
#        Craft_Item_Comp = {
#        item.id => [[item_id, item_type, number_needed], [item_id, item_type, number_needed]]
#        }
#      Make sure you have it set up like that, and you can have many more than that.  Also, as stated
#      below, the item_types are: 0-item, 1-weapon, 2-armor
#
#========================================


#========================================
#  module Craft_Items
#    Notes:
#      item.types are:  0-item, 1-weapon, 2-armor
#========================================
module Craft_Items
  #---------------------------------------------
  #  Recipes for Items
  #  Craft_Item_Comp = {item_id => [[item.id, item.type, # needed], etc...]
  #---------------------------------------------
  Craft_Item_Comp = {
  128 => [[140, 0, 1], [141, 0, 1], [142, 0, 1]]
  }
  #---------------------------------------------
  #  Recipes for Weapons
  #  Craft_Weapon_Comp = {weapon_id => [[item.id, item.type, # needed], etc...]
  #---------------------------------------------
  Craft_Weapon_Comp = {
  1 => [[1, 0, 1], [2, 0, 1]],
  2 => [[1, 0, 1], [2, 0, 1]],
  3 => [[1, 0, 1], [2, 0, 1]],
  4 => [[1, 0, 1], [2, 0, 1]],
  5 => [[1, 0, 1], [2, 0, 1]],
  6 => [[1, 0, 1], [2, 0, 1]],
  7 => [[1, 0, 1], [2, 0, 1]],
  8 => [[1, 0, 1], [2, 0, 1]],
  9 => [[1, 0, 1], [2, 0, 1]],
  10 => [[1, 0, 1], [2, 0, 1]],
  11 => [[1, 0, 1], [2, 0, 1]],
  12 => [[1, 0, 1], [2, 0, 1]],
  13 => [[1, 0, 1], [2, 0, 1]]
  }
  #---------------------------------------------
  #  Recipes for Armors
  #  Craft_Armor_Comp = {Armor_id => [[item.id, item.type, # needed], etc...]
  #---------------------------------------------
  Craft_Armor_Comp = {
  #3 => [[2, 0, 1], [1, 1, 1]]
  }
  #---------------------------------------------
  #  Tells which item recipes are evented.
  #  Item_Event_Triggered = [id1, id2...etc]
  #---------------------------------------------
  Item_Event_Triggered = []
  #---------------------------------------------
  #  Tells which weapon recipes are evented.
  #  Weapon_Event_Triggered = [id1, id2...etc]
  #---------------------------------------------
  Weapon_Event_Triggered = []
  #---------------------------------------------
  #  Tells which armor recipes are evented.
  #  Armor_Event_Triggered = [id1, id2...etc]
  #---------------------------------------------
  Armor_Event_Triggered = []
end
#========================================
#  END module Craft_Items
#========================================


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Game_Party
 
  alias leon_cs_gameparty_initialize initialize
  alias leon_cs_gameparty_gainitem gain_item
  alias leon_cs_gameparty_gainweapon gain_weapon
  alias leon_cs_gameparty_gainarmor gain_armor
 
  attr_accessor :item_recipes_made
  attr_accessor :item_recipe_availible
  attr_accessor :weapon_recipes_made
  attr_accessor :weapon_recipe_availible
  attr_accessor :armor_recipes_made
  attr_accessor :armor_recipe_availible
  attr_accessor :event_item
  attr_accessor :event_weapon
  attr_accessor :event_armor
 
  def initialize
    #------------------------------------------------
    # Used to record what items have been made.
    #------------------------------------------------
    @item_recipes_made = {}
    #------------------------------------------------
    # Used to show availible item recipes.
    #------------------------------------------------
    @item_recipe_availible = []
    #------------------------------------------------
    # Used to record what items have been made.
    #------------------------------------------------
    @weapon_recipes_made = {}
    #------------------------------------------------
    # Used to show availible item recipes.
    #------------------------------------------------
    @weapon_recipe_availible = []
    #------------------------------------------------
    # Used to record what items have been made.
    #------------------------------------------------
    @armor_recipes_made = {}
    #------------------------------------------------
    # Used to show availible item recipes.
    #------------------------------------------------
    @armor_recipe_availible = []
    #------------------------------------------------
    #  Shows which ones need triggered events
    #------------------------------------------------
    @event_item = []
    @event_weapon = []
    @event_armor = []
    leon_cs_gameparty_initialize
  end
 
  def gain_item(item_id, n)
    leon_cs_gameparty_gainitem(item_id, n)
    compile
  end
 
  def gain_weapon(weapon_id, n)
    leon_cs_gameparty_gainweapon(weapon_id, n)
    compile
  end
 
  def gain_armor(armor_id, n)
    leon_cs_gameparty_gainarmor (armor_id, n)
    compile
  end
 
  def compile
    ci = Craft_Items
    for i in 0...ci::Craft_Item_Comp.keys.size
      @counter = 0
      for j in 0...ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]].size
        case ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][1]
        when 0
          item = ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][0]
          if @items.keys.include?(item) and @items[item] >= ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 1
          item = ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][0]
          if @weapons.keys.include?(item) and @weapons[item] >= ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 2
          item = ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][0]
          if @armors.keys.include?(item) and @armors[item] >= ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]][j][2]
            @counter += 1
          end
        end
        if @counter == ci::Craft_Item_Comp[ci::Craft_Item_Comp.keys[i]].size
          unless @item_recipe_availible.include?(ci::Craft_Item_Comp.keys[i])
            if ci::Item_Event_Triggered.include?(ci::Craft_Item_Comp.keys[i])
              if @event_item.include?(ci::Craft_Item_Comp.keys[i])
                @item_recipe_availible.push(ci::Craft_Item_Comp.keys[i])
                @item_recipes_made[ci::Craft_Item_Comp.keys[i]] = 0
                return
              end
            else
              @item_recipe_availible.push(ci::Craft_Item_Comp.keys[i])
              @item_recipes_made[ci::Craft_Item_Comp.keys[i]] = 0
            end
          end
        end
      end
    end
   
    for i in 0...ci::Craft_Weapon_Comp.keys.size
      @counter = 0
      for j in 0...ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]].size
        case ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][1]
        when 0
          item = ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][0]
          if @items.keys.include?(item) and @items[item] >= ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 1
          item = ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][0]
          if @weapons.keys.include?(item) and @weapons[item] >= ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 2
          item = ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][0]
          if @armors.keys.include?(item) and @armors[item] >= ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]][j][2]
            @counter += 1
          end
        end
        if @counter == ci::Craft_Weapon_Comp[ci::Craft_Weapon_Comp.keys[i]].size
          unless @weapon_recipe_availible.include?(ci::Craft_Weapon_Comp.keys[i])
            if ci::Weapon_Event_Triggered.include?(ci::Craft_Weapon_Comp.keys[i])
              if @event_weapon.include?(ci::Craft_Weapon_Comp.keys[i])
                @weapon_recipe_availible.push(ci::Craft_Weapon_Comp.keys[i])
                @weapon_recipes_made[ci::Craft_Weapon_Comp.keys[i]] = 0
                return
              end
            else
              @weapon_recipe_availible.push(ci::Craft_Weapon_Comp.keys[i])
              @weapon_recipes_made[ci::Craft_Weapon_Comp.keys[i]] = 0
            end
          end
        end
      end
    end
   
    for i in 0...ci::Craft_Armor_Comp.keys.size
      @counter = 0
      for j in 0...ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]].size
        case ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][1]
        when 0
          item = ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][0]
          if @items.keys.include?(item) and @items[item] >= ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 1
          item = ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][0]
          if @weapons.keys.include?(item) and @weapons[item] >= ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][2]
            @counter += 1
          end
        when 2
          item = ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][0]
          if @armors.keys.include?(item) and @armors[item] >= ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]][j][2]
            @counter += 1
          end
        end
        if @counter == ci::Craft_Armor_Comp[ci::Craft_Armor_Comp.keys[i]].size
          unless @armor_recipe_availible.include?(ci::Craft_Armor_Comp.keys[i])
            if ci::Armor_Event_Triggered.include?(ci::Craft_Armor_Comp.keys[i])
              if @event_armor.include?(ci::Craft_Armor_Comp.keys[i])
                @armor_recipe_availible.push(ci::Craft_Armor_Comp.keys[i])
                @armor_recipes_made[ci::Craft_Armor_Comp.keys[i]] = 0
                return
              end
            else
              @armor_recipe_availible.push(ci::Craft_Armor_Comp.keys[i])
              @armor_recipes_made[ci::Craft_Armor_Comp.keys[i]] = 0
            end
          end
        end
      end
    end
  end
 
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  END Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


#=============================================
#  Window_Craft_Info
#=============================================
class Window_Craft_Info < Window_Base
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
  end

  def update(help_text)
    self.contents.clear
    self.contents.draw_text(0, 0, 614, 32, help_text)
  end
end
#=============================================
#  END Window_Craft_Info
#=============================================


#=============================================
#  Window_Craft_Name
#=============================================
class Window_Craft_Name < Window_Base
  def initialize
    super(0, 64, 256, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 120, 32, "Name:")
    self.contents.draw_text(0, 0, 224, 32, "Made:", 2)
    self.contents.font.color = normal_color
  end
end
#=============================================
#  Window_Craft_Name
#=============================================


#=============================================
#  Window_Craft_List
#=============================================
class Window_Craft_List < Window_Selectable
  def initialize
    super(0, 128, 256, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    self.index = 0
    refresh
  end
 
  def list
    if @data[index] != nil
      return @data[index]
    end
  end
 
  def refresh
    ci = Craft_Items
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...$game_party.item_recipe_availible.size
      @data.push($data_items[$game_party.item_recipe_availible[i]])
    end
    for i in 0...$game_party.weapon_recipe_availible.size
      @data.push($data_weapons[$game_party.weapon_recipe_availible[i]])
    end
    for i in 0...$game_party.armor_recipe_availible.size
      @data.push($data_armors[$game_party.armor_recipe_availible[i]])
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
 
  def draw_item(index)
    item = @data[index]
    x = 4
    y = index * 32
    case item
    when RPG::Item
      if $game_party.item_recipes_made[item.id] > 0
        self.contents.draw_text(x, y, 224, 32, item.name)
        self.contents.draw_text(x - 8, y, 224, 32, $game_party.item_recipes_made[item.id].to_s, 2)
      else
        self.contents.draw_text(x, y, 224, 32, "???????????")
      end
    when RPG::Weapon
      if $game_party.weapon_recipes_made[item.id] > 0
        self.contents.draw_text(x, y, 224, 32, item.name)
        self.contents.draw_text(x - 8, y, 224, 32, $game_party.weapon_recipes_made[item.id].to_s, 2)
      else
        self.contents.draw_text(x, y, 224, 32, "???????????")
      end
    when RPG::Armor
      if $game_party.armor_recipes_made[item.id] > 0
        self.contents.draw_text(x, y, 224, 32, item.name)
        self.contents.draw_text(x - 8, y, 224, 32, $game_party.armor_recipes_made[item.id].to_s, 2)
      else
        self.contents.draw_text(x, y, 224, 32, "???????????")
      end
    end
  end
 
end
#=============================================
#  END Window_Craft_List
#=============================================

   
#=============================================
#  Window_Craft_Desc
#=============================================
class Window_Craft_Desc < Window_Base
  def initialize(item)
    super(256, 64, 384, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh(item)
  end
 
  def refresh(item)
    self.contents.clear
    ci = Craft_Items
    if item != nil
      self.contents.font.color = system_color
      self.contents.draw_text(0, 64, 352, 32, "Materials:", 1)
      self.contents.draw_text(0, 96, 150, 32, "Name:")
      self.contents.draw_text(190, 96, 120, 32, "Needed:")
      self.contents.draw_text(280, 96, 120, 32, "Own:")
      self.contents.font.color = normal_color
      @items = []
      bitmap = RPG::Cache.icon(item.icon_name)
      opacity = self.contents.font.color == normal_color ? 255 : 128
      self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      case item
      when RPG::Item
        if $game_party.item_recipes_made[item.id] > 0
          self.contents.draw_text(28, 0, 200, 32, item.name)
          self.contents.font.size = 16
          self.contents.draw_text(10, 32, 352, 32, item.description)
          self.contents.font.size = $defaultfontsize
        else
          self.contents.draw_text(28, 0, 200, 32, "???????????")
          self.contents.draw_text(10, 32, 352, 32, "????????????????????????")
        end
      when RPG::Weapon
        if $game_party.weapon_recipes_made[item.id] > 0
          self.contents.draw_text(28, 0, 200, 32, item.name)
          self.contents.font.size = 16
          self.contents.draw_text(10, 32, 352, 32, item.description)
          self.contents.font.size = $defaultfontsize
        else
          self.contents.draw_text(28, 0, 200, 32, "???????????")
          self.contents.draw_text(10, 32, 352, 32, "????????????????????????")
        end
      when RPG::Armor
        if $game_party.armor_recipes_made[item.id] > 0
          self.contents.draw_text(28, 0, 200, 32, item.name)
          self.contents.font.size = 16
          self.contents.draw_text(10, 32, 352, 32, item.description)
          self.contents.font.size = $defaultfontsize
        else
          self.contents.draw_text(28, 0, 200, 32, "???????????")
          self.contents.draw_text(10, 32, 352, 32, "????????????????????????")
        end
      end
      case item
      when RPG::Item
        #p ci::Craft_Item_Comp[item.id]
        for i in 0...ci::Craft_Item_Comp[item.id].size
          item2 = ci::Craft_Item_Comp[item.id][i][0]
          case ci::Craft_Item_Comp[item.id][i][1]
          when 0
            @items.push([$data_items[ci::Craft_Item_Comp[item.id][i][0]], ci::Craft_Item_Comp[item.id][i][2]])
          when 1
            @items.push([$data_weapons[ci::Craft_Item_Comp[item.id][i][0]], ci::Craft_Item_Comp[item.id][i][2]])
          when 2
            @items.push([$data_armors[ci::Craft_Item_Comp[item.id][i][0]], ci::Craft_Item_Comp[item.id][i][2]])
          end
        end
      when RPG::Weapon
        for i in 0...ci::Craft_Weapon_Comp[item.id].size
          item2 = ci::Craft_Weapon_Comp[item.id][i][0]
          case ci::Craft_Weapon_Comp[item.id][i][1]
          when 0
            @items.push([$data_items[ci::Craft_Weapon_Comp[item.id][i][0]], ci::Craft_Weapon_Comp[item.id][i][2]])
          when 1
           @items.push([$data_weapons[ci::Craft_Weapon_Comp[item.id][i][0]], ci::Craft_Weapon_Comp[item.id][i][2]])
          when 2
            @items.push([$data_armors[ci::Craft_Weapon_Comp[item.id][i][0]], ci::Craft_Weapon_Comp[item.id][i][2]])
          end
        end
      when RPG::Armor
        for i in 0...ci::Craft_Armor_Comp[item.id].size
          item2 = ci::Craft_Armor_Comp[item.id][i][0]
          case ci::Craft_Armor_Comp[item.id][i][1]
          when 0
            @items.push([$data_items[ci::Craft_Armor_Comp[item.id][i][0]], ci::Craft_Armor_Comp[item.id][i][2]])
          when 1
            @items.push([$data_weapons[ci::Craft_Armor_Comp[item.id][i][0]], ci::Craft_Armor_Comp[item.id][i][2]])
          when 2
            @items.push([$data_armors[ci::Craft_Armor_Comp[item.id][i][0]], ci::Craft_Armor_Comp[item.id][i][2]])
          end
        end
      end
      for i in 0...@items.size
        x = 5
        y = i * 32 + 128
        case @items[i][0]
        when RPG::Item
          if $game_party.item_number(@items[i][0].id) >= @items[i][1]
            self.contents.font.color = normal_color
          else
            self.contents.font.color = disabled_color
          end
          bitmap = RPG::Cache.icon(@items[i][0].icon_name)
          opacity = self.contents.font.color == normal_color ? 255 : 128
          self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
          self.contents.draw_text(x + 28, y, 200, 32, @items[i][0].name)
          self.contents.draw_text(x + 210, y, 50, 32, @items[i][1].to_s)
          self.contents.draw_text(x + 290, y, 50, 32, $game_party.item_number(@items[i][0].id).to_s)
        when RPG::Weapon
          if $game_party.weapon_number(@items[i][0].id) >= @items[i][1]
            self.contents.font.color = normal_color
          else
            self.contents.font.color = disabled_color
          end
          bitmap = RPG::Cache.icon(@items[i][0].icon_name)
          opacity = self.contents.font.color == normal_color ? 255 : 128
          self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
          self.contents.draw_text(x + 28, y, 200, 32, @items[i][0].name)
          self.contents.draw_text(x + 210, y, 50, 32, @items[i][1].to_s)
          self.contents.draw_text(x + 290, y, 50, 32, $game_party.weapon_number(@items[i][0].id).to_s)
        when RPG::Armor
          if $game_party.armor_number(@items[i][0].id) >= @items[i][1]
            self.contents.font.color = normal_color
          else
            self.contents.font.color = disabled_color
          end
          bitmap = RPG::Cache.icon(@items[i][0].icon_name)
          opacity = self.contents.font.color == normal_color ? 255 : 128
          self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
          self.contents.draw_text(x + 28, y, 200, 32, @items[i][0].name)
          self.contents.draw_text(x + 210, y, 50, 32, @items[i][1].to_s)
          self.contents.draw_text(x + 290, y, 50, 32, $game_party.armor_number(@items[i][0].id).to_s)
        end
      end
    end
  end
end
#=============================================
#  END Window_Craft_Desc
#=============================================


#=============================================
#  Scene_Craft
#=============================================
class Scene_Craft
  def main
    @info_window = Window_Craft_Info.new
    @list_window = Window_Craft_List.new
    @desc_window = Window_Craft_Desc.new(@list_window.list)
    @name_window = Window_Craft_Name.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
   
    @info_window.dispose
    @list_window.dispose
    @desc_window.dispose
    @name_window.dispose
  end
 
  def update
    ci = Craft_Items
    @info_window.update("Select an item to create.")
    @list_window.update
    @desc_window.update
    @name_window.update
    if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or Input.repeat?(Input::DOWN) or
        Input.repeat?(Input::UP)
      @desc_window.refresh(@list_window.list)
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(4)
    end
    if Input.trigger?(Input::C)
      @counter = 0
      case @list_window.list
      when RPG::Item
        for i in 0...ci::Craft_Item_Comp[@list_window.list.id].size
          case ci::Craft_Item_Comp[@list_window.list.id][i][1]
          when 0
            if $game_party.item_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 1
            if $game_party.weapon_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 2
            if $game_party.armor_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          end
        end
        if @counter == ci::Craft_Item_Comp[@list_window.list.id].size
          for i in 0...ci::Craft_Item_Comp[@list_window.list.id].size
            case ci::Craft_Item_Comp[@list_window.list.id][i][1]
            when 0
              if $game_party.item_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
                $game_party.lose_item(ci::Craft_Item_Comp[@list_window.list.id][i][0], ci::Craft_Item_Comp[@list_window.list.id][i][2])
              end
            when 1
              if $game_party.weapon_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
                $game_party.lose_weapon(ci::Craft_Item_Comp[@list_window.list.id][i][0], ci::Craft_Item_Comp[@list_window.list.id][i][2])
              end
            when 2
              if $game_party.armor_number(ci::Craft_Item_Comp[@list_window.list.id][i][0]) >= ci::Craft_Item_Comp[@list_window.list.id][i][2]
                $game_party.lose_armor(ci::Craft_Item_Comp[@list_window.list.id][i][0], ci::Craft_Item_Comp[@list_window.list.id][i][2])
              end
            end
          end
          $game_system.se_play($data_system.decision_se)
          $game_party.gain_item(@list_window.list.id, 1)
          $game_party.item_recipes_made[@list_window.list.id] += 1
          @list_window.refresh
          @desc_window.refresh(@list_window.list)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      when RPG::Weapon
        for i in 0...ci::Craft_Weapon_Comp[@list_window.list.id].size
          case ci::Craft_Weapon_Comp[@list_window.list.id][i][1]
          when 0
            if $game_party.item_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 1
            if $game_party.weapon_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 2
            if $game_party.armor_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          end
        end
        if @counter == ci::Craft_Weapon_Comp[@list_window.list.id].size
          for i in 0...ci::Craft_Weapon_Comp[@list_window.list.id].size
            case ci::Craft_Weapon_Comp[@list_window.list.id][i][1]
            when 0
              if $game_party.item_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
                $game_party.lose_item(ci::Craft_Weapon_Comp[@list_window.list.id][i][0], ci::Craft_Weapon_Comp[@list_window.list.id][i][2])
              end
            when 1
              if $game_party.weapon_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
                $game_party.lose_weapon(ci::Craft_Weapon_Comp[@list_window.list.id][i][0], ci::Craft_Weapon_Comp[@list_window.list.id][i][2])
              end
            when 2
              if $game_party.armor_number(ci::Craft_Weapon_Comp[@list_window.list.id][i][0]) >= ci::Craft_Weapon_Comp[@list_window.list.id][i][2]
                $game_party.lose_armor(ci::Craft_Weapon_Comp[@list_window.list.id][i][0], ci::Craft_Weapon_Comp[@list_window.list.id][i][2])
              end
            end
          end
        $game_system.se_play($data_system.decision_se)
        $game_party.gain_weapon(@list_window.list.id, 1)
        $game_party.weapon_recipes_made[@list_window.list.id] += 1
        @list_window.refresh
        @desc_window.refresh(@list_window.list)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      when RPG::Armor
        for i in 0...ci::Craft_Armor_Comp[@list_window.list.id].size
          case ci::Craft_Armor_Comp[@list_window.list.id][i][1]
          when 0
            if $game_party.item_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 1
            if $game_party.weapon_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          when 2
            if $game_party.armor_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
              @counter += 1
            end
          end
        end
        if @counter == ci::Craft_Armor_Comp[@list_window.list.id].size
          for i in 0...ci::Craft_Armor_Comp[@list_window.list.id].size
            case ci::Craft_Armor_Comp[@list_window.list.id][i][1]
            when 0
              if $game_party.item_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
                $game_party.lose_item(ci::Craft_Armor_Comp[@list_window.list.id][i][0], ci::Craft_Armor_Comp[@list_window.list.id][i][2])
              end
            when 1
              if $game_party.weapon_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
                $game_party.lose_weapon(ci::Craft_Armor_Comp[@list_window.list.id][i][0], ci::Craft_Armor_Comp[@list_window.list.id][i][2])
              end
            when 2
              if $game_party.armor_number(ci::Craft_Armor_Comp[@list_window.list.id][i][0]) >= ci::Craft_Armor_Comp[@list_window.list.id][i][2]
                $game_party.lose_armor(ci::Craft_Armor_Comp[@list_window.list.id][i][0], ci::Craft_Armor_Comp[@list_window.list.id][i][2])
              end
            end
          end
        $game_system.se_play($data_system.decision_se)
        $game_party.gain_armor(@list_window.list.id, 1)
        $game_party.armor_recipes_made[@list_window.list.id] += 1
        @list_window.refresh
        @desc_window.refresh(@list_window.list)
        else
          $game_system.se_play($data_system.buzzer_se)
        end
      end
    end
    return
  end
end
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Jragyn on August 31, 2008, 03:54:52 pm
It seems like a great idea!
With the download link not working, I just copied the script from namkor...
however, what do I do with it?
Do you use a tidbit of script to call this scene, like blizz's stat distribution thing?
This seems like a nifty idea, but I'm just too inept to grasp it from this point.
Can someone tell me the secret?
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Shining Riku on May 19, 2009, 11:11:42 pm
This is a great script, by the looks of things, but the demo's down and the script doesn't have a $scene_new craft thingy or anything. No instructions on ACTIVATING it at least.  :(

You may as well hand me a locked suitcase and tell me everything I need is inside it. An indestructible suitcase.

It's impossible to use in its current state. Anybody mind sharing its secrets so it can be used?
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Juan on May 19, 2009, 11:15:37 pm
Quote from: Shining Riku on May 19, 2009, 11:11:42 pm
This is a great script, by the looks of things, but the demo's down and the script doesn't have a $scene_new craft thingy or anything. No instructions on ACTIVATING it at least.  :(

You may as well hand me a locked suitcase and tell me everything I need is inside it. An indestructible suitcase.

It's impossible to use in its current state. Anybody mind sharing its secrets so it can be used?

I'm pretty sure it's
$scene = Scene_Craft.new
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Shining Riku on May 30, 2009, 07:57:10 pm
YES! Finally!

Thanks for the script snipet, Juan. Sorry I took so long to reply, I've been away from Chaos Project for a while.

I tested it already and it worked, so you've honestly saved me a crazy amount of trouble. THANK YOOOU!!!

(Powers up)
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Redsonic on February 10, 2010, 01:48:28 pm
This isn't working for me

I get 'TypeError, can't convert nil to integer' after I select the item to craft in the menu
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Aqua on February 10, 2010, 01:51:20 pm
*fwoosh*
Mega necropost~~~


Did you configure everything correctly?
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Redsonic on February 10, 2010, 01:53:00 pm
I believe so, yes.

All I did was edit the recipes (using the proper format), using database integers that actually exist in my project.

Booted it up, can't craft anything. Yes, the ids used exist in the database.

Screenshot: http://img.photobucket.com/albums/v316/redsonic/clipboard-2-3.jpg

Here's line 249
@weapon_recipes_made[ci::Craft_Weapon_Comp.keys[i]] = 0
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Redsonic on February 11, 2010, 10:29:12 pm
Fixed the problem.

Apparantly the script thought $defaultfontsize was nil or something. So I changed that to an integer (16) and that fixed the problem.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: RogerSmith on February 12, 2010, 07:32:48 pm
Well nevermind, I overlooked the fact that the script itself was posted.

ANYWAY, I think I downloaded this script before, and there was an error, hopefully this time it works.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: keyonne on August 20, 2010, 09:18:24 pm
I feel as though I'm becoming a nuisance here on this site, but I'm attempting to learn some basic scripting so I can modify scripts to what I need. This crafting system, first of all I have to say is very well done. I was wondering, however, if i can make the skill crafting individual - each character learns the skills separately, rather than the party as a whole. I wish to make it so each character can only learn so many crating types, so you must choose wisely and pair characters accordingly.

This will add some challenge to the game, as they will have to choose which crafting skills to work on and this will limit the upgrades their character can get to the types they have mastered.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: Jragyn on August 27, 2010, 08:58:26 pm
Hmm, perhaps you should investigate Prexus' Crafting system.
I used it for something similer in a game of my own.
To simulate the effect of different people having different crafting capabilities,
I just made an event that called a different crafting method-menu depending on the leading character.

The system has leveling built in, it has recipes to setup and the like.
Its pretty intense.
Title: Re: [XP] Castlevania CoD style Crafting System
Post by: keyonne on September 13, 2010, 12:23:13 pm
I'm not really understanding what you mean by a method-menu.