Silencher 0 Report post Posted October 12, 2011 Hey all, First if this is the wrong forum let me know. I can't seem to find the script requests forum anymore. I'm looking for a script that would essentially allow me to use an event to open a screen similar to a shop screen that would have a list of items that are 'craftable' and then show the player what the ingredients are and what the stats of the items to be created are. I would like all types of items to be craftable, regular items, weapons, armor, etc. I would also like for there to be a way to add/remove the items that are craftable. I had a similar script for RMXP but now I'm looking for one for VX and I'm not sure that they use the same code(I'm pretty sure they don't) so, yeah. Share this post Link to post Share on other sites
Kiriashi 117 Report post Posted October 12, 2011 There are plenty of Crafting type scripts for RGSS, and I would imagine RGSS2 (What VX 'runs' on.) Just do a little googling. For example: http://www.rpgrevolution.com/forums/index.php?showtopic=21799 Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 12, 2011 Yeah I've been googling around, the one you listed isn't quite what I am looking for though it's very close. Share this post Link to post Share on other sites
Leon 55 Report post Posted October 12, 2011 Here, try this one. Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 12, 2011 Thanks Lizzie, that should work well. =) Share this post Link to post Share on other sites
Leon 55 Report post Posted October 12, 2011 No prob. ^_^ another satisfied customer! Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 13, 2011 (edited) Actually, I was wrong, the script doesn't work. I get this error when I run my project: Script 'Crafting' line 118: NameError occurred. undefined method 'gain_weapon' for class 'Game_Party'. Line in question is this: alias leon_cs_gameparty_gainweapon gain_weapon NOTE: I do have other scripts currently, so I made a new project and added just this script and it gave the exact same error message, just to rule out possible interference from other scripts. Note 2: I think the reason is your script is for XP not VX, I didn't have any issues with running my game if I used it on XP, although I actually can't figure out how to call the script in XP to test it. Do you have a VX version? If not I'll have to keep looking around. Edited October 13, 2011 by Silencher Share this post Link to post Share on other sites
Leon 55 Report post Posted October 13, 2011 i know why... my script was XP...i didn't notice that this is VX. X.X i'm so sorry! my bad... If I knew VX, i'd rewrite it for you... Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 13, 2011 (edited) No problem, I found another script that works more or less well. The only problem is that it's difficult to control the recipes, so I'm hoping a scripter can tweak it. It's KCG_ComposeItem which I've included below. Currently you turn a switch on and activate shop processing and include the crafting items as the items 'sold'. I'd really like it so that you don't have to include the 'sold' items, but instead could have a script where the recipes known are stored in some kind of a bank, and when you go to shop processing with the 'crafting switch' turned to on, it pulls that bank of 'known recipes' rather than whatever the shop processing is. If this could be done, that would be great, if not I will see about trying to event it, but the conditional branches looming ahead of me are pretty daunting, since I'd like to have many recipes in my game that would need to be learned via items and/or events. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ #_/ ? Synthesize Items - KGC_ComposeItem ? VX ? #_/ ? Last Update: 2008/08/01 ? #_/ ? Translation by Mr. Anonymous ? #_/ ? Special credit to Moon for Testing ? #_/----------------------------------------------------------------------------- #_/ This script opens the ability for the designer to allow items, weapons, & #_/ armor to be created by the player through specified "recipies". It also #_/ extends the normal shop event into becoming a Synthesize Shop, controlled #_/ by a simple ON/OFF switch. #_/============================================================================= #_/ Install: Insert below KGC_UsableEquipment #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ #==============================================================================# # ? Customization ? # #==============================================================================# module KGC module ComposeItem # ? Compose Shop Switch ? # This allows you to assign which SwitchID (Event Commands, Page 1 "Game # Progression", Control Switch) you wish to control the Synthesis Shop. # When that switch is turned ON, the Synthesis Shop replaces the normal # shop screen. When OFF, the shop is normal. COMPOSE_CALL_SWITCH = 5 # ? Recipe Tables ? # The following lines allow you to create recipe tables of synthesizable # items, weapons, and other equipment. Please do note overwrite: # RECIPE_ITEM = [] # Item # RECIPE_WEAPON = [] # Weapon # RECIPE_ARMOR = [] # Armor # Instead, add your custom recipes tables after those lines. # # ? Format # RECIPE_TYPE[itemID] = [Cost, "Type:ID",Quantity] # # ? Key # Cost: Amount of money charged. # Type: (I.Items W.Weapons A.Armor) # ID: The ID number for the above specified material type. # Quantity: The required amount of materials used. # # "Type:ID,Quantity" can be used multiple times for multiple items with their # corresponding quantity. Also, the must be no space between the comma and # the given quantity. # The required quantity of an item is treated as 1 if quantity is omitted. # Untested: It seems if you set Quantity to 0, the item is still required, # but not 'consumed' or used. # Also note that the item to be synthesized can be written as an array, # allowing you to create multiple items of the same type that can be # synthesized from the same recipe. # Note: Do not alter or remove the next three lines, that is done below them. RECIPE_ITEM = [] # Item RECIPE_WEAPON = [] # Weapon RECIPE_ARMOR = [] # Armor # ? Custom Recipe Tables Inserted Below ? # Examples: # *Note: I use the default database items for these examples. # Recipe for ItemID:8 (Elixer) # Requirements: ItemID 2 (High potion), 4 (Magic water), 7 (Dispel herb) # with a quantity of 1 for each(because it's omitted), at a cost of 0. # RECIPE_ITEM[EXAMPLE] = [0, "I:2,2", "W:4,2", "A:7,2"]. # Recipe for WeaponID:16 (Flamberge) # Requirements: WeaponID:10 (Bastard Sword)x1, ItemID:16 (Flame scroll)x2 # at a cost of 800 gold. # Recipe for ArmorID:29 (Life Ring) AND ArmorID:30 (Sage's Ring) # Requirements: ArmorID:23 (Fire Ring)x1, ItemID:9 (Life up)x1, # ItemID:10 (Mana up)x1, ItemID:4 (Magic water)x5 # at a cost of 1,000 gold. # ? Recipes For the Demo Only ? # The following recipes are for items used in the demo. You may remove or # alter these to your liking. #RECIPES!!!!!!!!!!!!!!!!!!!!!!!: #~~~~~~~~~Recipe Template~~~~~~~~~ #RECIPE_ITEM[iTEM_ID] = [Gold_Cost, "I/W/A::ID,Quantity(starts at 2)", "I/W/A::ID,Quantity(starts at 2)", ] RECIPE_ITEM[1] = [0, "I:2,",] # ? Compose Item Command Name ? # This is displayed at the position of the "Buy" command. VOCAB_COMPOSE_ITEM = "Synthesize" # ? Parameter Changes Button ? # Button that switches the required materials list with the parameter changes # list. (The changes only show for equipment, obviously) # SWITCH_INFO_BUTTON = Input::nil disables this. SWITCH_INFO_BUTTON = nil # ? Compact Material List ? # This toggle allows you to compact(shrink) the recipe list when true. COMPACT_MATERIAL_LIST = true # ? Hide Command Window Toggle ? # This toggle hides the command window (Synthesize, Sell, Cancel, Gold) after # the synthesize option has been selected. The gold window is moved to the # lower right corner. # true = command window is hidden # false = command window is shown HIDE_COMMAND_WINDOW = true # ? Hide Gold Window Toggle ? # This toggle is to be used in conjunction with HIDE_COMMAND_WINDOW = true # true = Hides the Gold/Money window. # false = Disply the Gold/Money window. # *Note: If HIDE_COMMAND_WINDOW = false, The gold window is always displayed. HIDE_GOLD_WINDOW = true # ? Hide Zero Cost Toggle ? # true = When a synthesis recipe has a cost of 0, the cost is not displayed. # false = When a synthesis recipe has a cost of 0, the cost is displayed. HIDE_ZERO_COST = true # ? ??????????????? # true : ?????????????????????? # false : ?????????????????? # Not sure what this is supposed to do at the moment. SHOW_COMPOSED_RECIPE = false # synth once to reveal name? Shit # ? Hide Recipe Requirements Toggle ? # This toggle allows you to hide recipe and materials required when you lack # the items needed to create an item. # true = Hide recipe and items required when you lack the items needed # false = Show recipe requirements when you lack the items needed. HIDE_SHORTAGE_COST = false ### hides when you lack gold # ? Unknown Recipe Toggle ? # true = Hides the names of recipes that cannot be synthesized. # false = All recipe names are visible. HIDE_SHORTAGE_MATERIAL = false # ? ?? or ??????????????? #Recipes are not known or can not be lifted synthesis # true : ?? or ?????????? # false : ??????????? # Not sure what this is supposed to do at the moment. NEED_RECIPE_OPEN_OR_CLEAR = false # fucks everything # ? Mask Unknown Recipe Toggle ? # true = mask the names of recipes that cannot be synthesized. # false = All recipe names are visible. MASK_UNKNOWN_RECIPE_NAME = false # ? Text Displayed on Masked Recipes ? # If only one character is specified, it extends the length of the recipe # name. Example: If UNKNOWN_NAME_MASK = "?", and let's say the recipe is # for a Long Sword, then the displayed text would be "??????????" UNKNOWN_NAME_MASK = "???" # ? Hide Recipe Information Text ? # This toggle allows you to mask the text displayed in the "Help" (topmost) # window of a recipe that the player doesn't meet the requirements to make. # true = mask the recipe's help text # false = display the text normally HIDE_UNKNOWN_RECIPE_HELP = false # ? Information Text Displayed on Masked Recipes ? # This allows you to change the text displayed in the "Help" (topmost) window # of an unknown recipe. (When HIDE_UNKNOWN_RECIPE_HELP = true) UNKNOWN_RECIPE_HELP = "You first have to obtain all resources!" # ? Sell and Cancel Options in Command Window ? # Added by Mr. Anonymous. # This toggle allows you to remove the sell and cancel selections on the # synthesize shop when set to true. HIDE_SELL_CANCEL = true end end #??????????????????????????????????????? $imported = {} if $imported == nil $imported["ComposeItem"] = true # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # # Unless you know what you're doing, it's best not to alter anything beyond # # this point, as this only affects the tags used for "Notes" in database. # # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # # Whatever word(s) are after the separator ( | ) in the following lines are # what are used to determine what is searched for in the "Notes" section. module KGC::ComposeItem module Regexp # Recipe Tag RECIPE = /([iWA])\s*:\s*(\d+)(\s*,\s*\d+)?/i end end #??????????????????????????????????????? #============================================================================== # ? KGC::Commands #============================================================================== module KGC::Commands module_function #-------------------------------------------------------------------------- # ? ??????????? # type : ??????? (0..???? 1..?? 2..??) # id : ????? ID # enabled : true..?? false..??? #-------------------------------------------------------------------------- def set_recipe_cleared(type, id, enabled = true) item = nil case type when 0, :item # ???? item = $data_items[id] when 1, :weapon # ?? item = $data_weapons[id] when 2, :armor # ?? item = $data_armors[id] end $game_party.set_recipe_cleared(item, enabled) if item != nil end #-------------------------------------------------------------------------- # ? ??????????? # type : ??????? (0..???? 1..?? 2..??) # id : ????? ID # enabled : true..?? false..??? #-------------------------------------------------------------------------- def set_recipe_opened(type, id, enabled = true) item = nil case type when 0, :item # ???? item = $data_items[id] when 1, :weapon # ?? item = $data_weapons[id] when 2, :armor # ?? item = $data_armors[id] end $game_party.set_recipe_opened(item, enabled) if item != nil end end #??????????????????????????????????????? #============================================================================== # ? Vocab #============================================================================== module Vocab # ???? ComposeItem = KGC::ComposeItem::VOCAB_COMPOSE_ITEM end #??????????????????????????????????????? #============================================================================== # ? RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- @@__masked_name = KGC::ComposeItem::UNKNOWN_NAME_MASK # ???? @@__expand_masked_name = false # ??????????? if @@__masked_name != nil @@__expand_masked_name = (@@__masked_name.scan(/./).size == 1) end #-------------------------------------------------------------------------- # ? ?????????????? #-------------------------------------------------------------------------- def create_compose_item_cache @__compose_cost = 0 @__compose_materials = [] # ????? recipe = nil case self when RPG::Item # ???? recipe = KGC::ComposeItem::RECIPE_ITEM[self.id] when RPG::Weapon # ?? recipe = KGC::ComposeItem::RECIPE_WEAPON[self.id] when RPG::Armor # ?? recipe = KGC::ComposeItem::RECIPE_ARMOR[self.id] end return if recipe == nil recipe = recipe.dup @__compose_cost = recipe.shift # ???????? recipe.each { |r| if r =~ KGC::ComposeItem::Regexp::RECIPE material = Game_ComposeMaterial.new material.kind = $1.upcase # ???????? material.id = $2.to_i # ??? ID ??? if $3 != nil material.number = [$3[/\d+/].to_i, 0].max # ?????? end @__compose_materials << material end } end #-------------------------------------------------------------------------- # ? ???? #-------------------------------------------------------------------------- def masked_name if KGC::ComposeItem::MASK_UNKNOWN_RECIPE_NAME if @@__expand_masked_name # ??????????? return @@__masked_name * self.name.scan(/./).size else return @@__masked_name end else return self.name end end #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- def compose_cost create_compose_item_cache if @__compose_cost == nil return @__compose_cost end #-------------------------------------------------------------------------- # ? ???????? #-------------------------------------------------------------------------- def compose_materials create_compose_item_cache if @__compose_materials == nil return @__compose_materials end #-------------------------------------------------------------------------- # ? ??????? #-------------------------------------------------------------------------- def is_compose? return !compose_materials.empty? end end #??????????????????????????????????????? #============================================================================== # ? Game_Party #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- # ? ??????????? #-------------------------------------------------------------------------- def clear_composed_flag @item_composed = {} @weapon_composed = {} @armor_composed = {} end #-------------------------------------------------------------------------- # ? ???????????? #-------------------------------------------------------------------------- def clear_recipe_cleared_flag @item_recipe_cleared = {} @weapon_recipe_cleared = {} @armor_recipe_cleared = {} end #-------------------------------------------------------------------------- # ? ???????????? #-------------------------------------------------------------------------- def clear_recipe_opened_flag @item_recipe_opened = {} @weapon_recipe_opened = {} @armor_recipe_opened = {} end #-------------------------------------------------------------------------- # ? ??????????????? # item : ???? # flag : true..???? false..??? #-------------------------------------------------------------------------- def set_item_composed(item, flag = true) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ??????????????????? clear_composed_flag if @item_composed == nil # ??????????? case item when RPG::Item # ???? @item_composed[item.id] = flag when RPG::Weapon # ?? @weapon_composed[item.id] = flag when RPG::Armor # ?? @armor_composed[item.id] = flag end end #-------------------------------------------------------------------------- # ? ??????????? # item : ???? #-------------------------------------------------------------------------- def item_composed?(item) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ??????????????????? clear_composed_flag if @item_composed == nil # ?????? case item when RPG::Item # ???? return @item_composed[item.id] when RPG::Weapon # ?? return @weapon_composed[item.id] when RPG::Armor # ?? return @armor_composed[item.id] end return false end #-------------------------------------------------------------------------- # ? ??????????????? # item : ???? # flag : true..???? false..??? #-------------------------------------------------------------------------- def set_item_composed(item, flag = true) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ??????????????????? clear_composed_flag if @item_composed == nil # ??????????? case item when RPG::Item # ???? @item_composed[item.id] = flag when RPG::Weapon # ?? @weapon_composed[item.id] = flag when RPG::Armor # ?? @armor_composed[item.id] = flag end end #-------------------------------------------------------------------------- # ? ??????? # item : ???? #-------------------------------------------------------------------------- def recipe_cleared?(item) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ????????????????? clear_recipe_cleared_flag if @item_recipe_cleared == nil # ?? case item when RPG::Item # ???? return @item_recipe_cleared[item.id] when RPG::Weapon # ?? return @weapon_recipe_cleared[item.id] when RPG::Armor # ?? return @armor_recipe_cleared[item.id] end return false end #-------------------------------------------------------------------------- # ? ????????????? # item : ???? # flag : true..?? false..??? #-------------------------------------------------------------------------- def set_recipe_cleared(item, flag = true) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ????????????????? clear_recipe_cleared_flag if @item_recipe_cleared == nil # ????????? case item when RPG::Item # ???? @item_recipe_cleared[item.id] = flag when RPG::Weapon # ?? @weapon_recipe_cleared[item.id] = flag when RPG::Armor # ?? @armor_recipe_cleared[item.id] = flag end end #-------------------------------------------------------------------------- # ? ??????? # item : ???? #-------------------------------------------------------------------------- def recipe_opened?(item) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ????????????????? clear_recipe_opened_flag if @item_recipe_opened == nil # ?? case item when RPG::Item # ???? return @item_recipe_opened[item.id] when RPG::Weapon # ?? return @weapon_recipe_opened[item.id] when RPG::Armor # ?? return @armor_recipe_opened[item.id] end return false end #-------------------------------------------------------------------------- # ? ????????????? # item : ???? # flag : true..?? false..??? #-------------------------------------------------------------------------- def set_recipe_opened(item, flag = true) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? # ????????????????? clear_recipe_opened_flag if @item_recipe_opened == nil # ????????? case item when RPG::Item # ???? @item_recipe_opened[item.id] = flag when RPG::Weapon # ?? @weapon_recipe_opened[item.id] = flag when RPG::Armor # ?? @armor_recipe_opened[item.id] = flag end end #-------------------------------------------------------------------------- # ? ??????????? # item : ???? #-------------------------------------------------------------------------- def item_can_compose?(item) return false unless item_compose_cost_satisfy?(item) return false unless item_compose_material_satisfy?(item) return true end #-------------------------------------------------------------------------- # ? ????????????? # item : ???? #-------------------------------------------------------------------------- def item_compose_cost_satisfy?(item) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? return (gold >= item.compose_cost) end #-------------------------------------------------------------------------- # ? ????????????? # item : ???? #-------------------------------------------------------------------------- def item_compose_material_satisfy?(item) return false unless item.is_a?(RPG::BaseItem) # ?????? return false unless item.is_compose? # ???????? item.compose_materials.each { |material| num = item_number(material.item) return false if num < material.number || num == 0 # ???? } return true end #-------------------------------------------------------------------------- # ? ????????????? # item : ???? #-------------------------------------------------------------------------- def number_of_composable(item) return 0 unless item.is_a?(RPG::BaseItem) # ?????? return 0 unless item.is_compose? # ???????? number = ($imported["LimitBreak"] ? item.number_limit : 99) if item.compose_cost > 0 number = [number, gold / item.compose_cost].min end # ????? item.compose_materials.each { |material| next if material.number == 0 # ??? 0 ??? n = item_number(material.item) / material.number number = [number, n].min } return number end end #??????????????????????????????????????? #============================================================================== # ? Game_ComposeMaterial #------------------------------------------------------------------------------ # ?????????????????? #============================================================================== class Game_ComposeMaterial #-------------------------------------------------------------------------- # ? ?????????? #-------------------------------------------------------------------------- attr_accessor :kind # ??????? (/[iWA]/) attr_accessor :id # ????? ID attr_accessor :number # ??? #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def initialize @kind = "I" @id = 0 @number = 1 end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def item case @kind when "I" # ???? return $data_items[@id] when "W" # ?? return $data_weapons[@id] when "A" # ?? return $data_armors[@id] else return nil end end end #??????????????????????????????????????? #============================================================================== # ? Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ? ?????????? # item : ???? (????????????) # x : ??? X ?? # y : ??? Y ?? # enabled : ??????false ????????? #-------------------------------------------------------------------------- def draw_compose_item_name(item, x, y, enabled = true) return if item == nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color = normal_color self.contents.font.color.alpha = enabled ? 255 : 128 masked = !$game_party.item_composed?(item) && !$game_party.recipe_cleared?(item) self.contents.draw_text(x + 24, y, 172, WLH, masked ? item.masked_name : item.name) end end #??????????????????????????????????????? #============================================================================== # ? Window_ComposeNumber #------------------------------------------------------------------------------ # ?????????????????????????????? #============================================================================== class Window_ComposeNumber < Window_ShopNumber #-------------------------------------------------------------------------- # ? ?????????? #-------------------------------------------------------------------------- attr_accessor :sell_flag # ????? #-------------------------------------------------------------------------- # ? ????????? # x : ?????? X ?? # y : ?????? Y ?? #-------------------------------------------------------------------------- alias initialize_KGC_ComposeItem initialize unless $@ def initialize(x, y) @sell_flag = false initialize_KGC_ComposeItem(x, y) end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def refresh y = 96 self.contents.clear if @sell_flag draw_item_name(@item, 0, y) else draw_compose_item_name(@item, 0, y) end self.contents.font.color = normal_color self.contents.draw_text(212, y, 20, WLH, "x") self.contents.draw_text(248, y, 20, WLH, @number, 2) self.cursor_rect.set(244, y, 28, WLH) if !KGC::ComposeItem::HIDE_ZERO_COST || @price > 0 draw_currency_value(@price * @number, 4, y + WLH * 2, 264) end end end #??????????????????????????????????????? #============================================================================== # ? Window_ComposeItem #------------------------------------------------------------------------------ # ????????????????????????????? #============================================================================== class Window_ComposeItem < Window_ShopBuy #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def refresh @data = [] for goods_item in @shop_goods case goods_item[0] when 0 item = $data_items[goods_item[1]] when 1 item = $data_weapons[goods_item[1]] when 2 item = $data_armors[goods_item[1]] end # ?????????? @data.push(item) if include?(item) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # ? ???????????????? # item : ???? #-------------------------------------------------------------------------- def include?(item) return false if item == nil # ????? nil ?????? return false unless item.is_compose? # ????????????? # ???????? if KGC::ComposeItem::SHOW_COMPOSED_RECIPE return true if $game_party.item_composed?(item) end # ?? or ???????? if $game_party.recipe_cleared?(item) || $game_party.recipe_opened?(item) return true end # ???????? if KGC::ComposeItem::HIDE_SHORTAGE_COST return false unless $game_party.item_compose_cost_satisfy?(item) end # ???????? if KGC::ComposeItem::HIDE_SHORTAGE_MATERIAL return false unless $game_party.item_compose_material_satisfy?(item) end if KGC::ComposeItem::NEED_RECIPE_OPEN_OR_CLEAR # ?? or ??????? unless $game_party.recipe_cleared?(item) || $game_party.recipe_opened?(item) return false end end return true end #-------------------------------------------------------------------------- # ? ?????????????????? # item : ???? #-------------------------------------------------------------------------- def enable?(item) return $game_party.item_can_compose?(item) end #-------------------------------------------------------------------------- # ? ????? # index : ???? #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] number = $game_party.item_number(item) limit = ($imported["LimitBreak"] ? item.number_limit : 99) rect = item_rect(index) self.contents.clear_rect(rect) draw_compose_item_name(item, rect.x, rect.y, enable?(item)) # ????? if !KGC::ComposeItem::HIDE_ZERO_COST || item.compose_cost > 0 rect.width -= 4 self.contents.draw_text(rect, item.compose_cost, 2) end end if KGC::ComposeItem::HIDE_UNKNOWN_RECIPE_HELP #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def update_help item = (index >= 0 ? @data[index] : nil) if item == nil || $game_party.item_composed?(item) || $game_party.recipe_cleared?(item) # ????? nil or ???? or ?????? [Window_ShopBuy] ???? super else @help_window.set_text(KGC::ComposeItem::UNKNOWN_RECIPE_HELP) end end end end #??????????????????????????????????????? #============================================================================== # ? Window_ComposeStatus #------------------------------------------------------------------------------ # ?????????????????????????????? #============================================================================== class Window_ComposeStatus < Window_ShopStatus #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- MODE_MATERIAL = 0 # ????? MODE_STATUS = 1 # ?????????? #-------------------------------------------------------------------------- # ? ????????? # x : ?????? X ?? # y : ?????? Y ?? #-------------------------------------------------------------------------- def initialize(x, y) @mode = MODE_MATERIAL super(x, y) end #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- def change_mode case @mode when MODE_MATERIAL @mode = MODE_STATUS when MODE_STATUS @mode = MODE_MATERIAL end self.oy = 0 refresh end #-------------------------------------------------------------------------- # ? ?????????? #-------------------------------------------------------------------------- def create_contents if @mode == MODE_STATUS super return end self.contents.dispose ch = height - 32 if @item != nil mag = (KGC::ComposeItem::COMPACT_MATERIAL_LIST ? 1 : 2) ch = [ch, WLH * (mag + @item.compose_materials.size * mag)].max end self.contents = Bitmap.new(width - 32, ch) end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def refresh create_contents self.contents.font.size = Font.default_size case @mode when MODE_MATERIAL draw_material_list when MODE_STATUS super end end #-------------------------------------------------------------------------- # ? ???????? #-------------------------------------------------------------------------- def draw_material_list return if @item == nil number = $game_party.item_number(@item) self.contents.font.color = system_color self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession) self.contents.font.color = normal_color self.contents.draw_text(4, 0, 200, WLH, number, 2) self.contents.font.size = 16 if KGC::ComposeItem::COMPACT_MATERIAL_LIST mag = (KGC::ComposeItem::COMPACT_MATERIAL_LIST ? 1 : 2) @item.compose_materials.each_with_index { |material, i| y = WLH * (mag + i * mag) draw_material_info(0, y, material) } end #-------------------------------------------------------------------------- # ? ??????? #-------------------------------------------------------------------------- def draw_material_info(x, y, material) m_item = material.item return if m_item == nil number = $game_party.item_number(m_item) enabled = (number > 0 && number >= material.number) draw_item_name(m_item, x, y, enabled) if KGC::ComposeItem::COMPACT_MATERIAL_LIST m_number = (material.number == 0 ? "-" : sprintf("%d", material.number)) self.contents.draw_text(x, y, width - 32, WLH, sprintf("%d/%s", number, m_number), 2)####### else m_number = (material.number == 0 ? "-" : sprintf("%2d", material.number)) self.contents.draw_text(x, y + WLH, width - 32, WLH, sprintf("%2d/%2s", number, m_number), 2)######### end end end #??????????????????????????????????????? #============================================================================== # ? Scene_Map #============================================================================== class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # ? ???????????? #-------------------------------------------------------------------------- alias call_shop_KGC_ComposeItem call_shop def call_shop # ???????????? if $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH] # ??????? $game_temp.next_scene = nil $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH] = false $scene = Scene_ComposeItem.new else call_shop_KGC_ComposeItem end end end #??????????????????????????????????????? #============================================================================== # ? Scene_ComposeItem #------------------------------------------------------------------------------ # ????????????????? #============================================================================== class Scene_ComposeItem < Scene_Shop #-------------------------------------------------------------------------- # ? ???? #-------------------------------------------------------------------------- def start super # ???????????? if KGC::ComposeItem::HIDE_COMMAND_WINDOW @command_window.visible = false @gold_window.y = Graphics.height - @gold_window.height @gold_window.z = @status_window.z + 100 @gold_window.visible = !KGC::ComposeItem::HIDE_GOLD_WINDOW @dummy_window.y = @command_window.y @dummy_window.height += @command_window.height end # [scene_Shop] ????????????? @buy_window ??? @buy_window.dispose @buy_window = Window_ComposeItem.new(0, @dummy_window.y) @buy_window.height = @dummy_window.height @buy_window.active = false @buy_window.visible = false @buy_window.help_window = @help_window # ????????????? @number_window.dispose @number_window = Window_ComposeNumber.new(0, @buy_window.y) @number_window.height = @buy_window.height @number_window.create_contents @number_window.active = false @number_window.visible = false @status_window.dispose @status_window = Window_ComposeStatus.new(@buy_window.width, @buy_window.y) @status_window.height = @buy_window.height @status_window.create_contents @status_window.visible = false # ???????????????????????????? if KGC::ComposeItem::HIDE_COMMAND_WINDOW @command_window.active = false @dummy_window.visible = false @buy_window.active = true @buy_window.visible = true @buy_window.update_help @status_window.visible = true @status_window.item = @buy_window.item end end #-------------------------------------------------------------------------- # ? ???????????? #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::ComposeItem s2 = Vocab::ShopSell s3 = Vocab::ShopCancel # Added 4/11 [Mr. Anonymous] if KGC::ComposeItem::HIDE_SELL_CANCEL @command_window = Window_Command.new(150, [s1], 1) else @command_window = Window_Command.new(384, [s1, s2, s3], 3) end #@command_window = Window_Command.new(384, [s1, s2, s3], 3) @command_window.y = 56 if $game_temp.shop_purchase_only @command_window.draw_item(1, false) end end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def update super if KGC::ComposeItem::SWITCH_INFO_BUTTON != nil && Input.trigger?(KGC::ComposeItem::SWITCH_INFO_BUTTON) Sound.play_cursor @status_window.change_mode end end #-------------------------------------------------------------------------- # ? ??????????? #-------------------------------------------------------------------------- def update_buy_selection @number_window.sell_flag = false # ????????????? B ?????????? if KGC::ComposeItem::HIDE_COMMAND_WINDOW && Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new return end @status_window.item = @buy_window.item if Input.trigger?(Input::C) @item = @buy_window.item # ????????????? if @item == nil Sound.play_buzzer return end # ????? or ?????????????????? number = $game_party.item_number(@item) limit = ($imported["LimitBreak"] ? @item.number_limit : 99) if !$game_party.item_can_compose?(@item) || number == limit Sound.play_buzzer return end # ????????? Sound.play_decision max = $game_party.number_of_composable(@item) max = [max, limit - number].min @buy_window.active = false @buy_window.visible = false @number_window.set(@item, max, @item.compose_cost) @number_window.active = true @number_window.visible = true return end super end #-------------------------------------------------------------------------- # ? ??????????? #-------------------------------------------------------------------------- def update_sell_selection @number_window.sell_flag = true super end #-------------------------------------------------------------------------- # ? ??????? #-------------------------------------------------------------------------- def decide_number_input if @command_window.index != 0 # ???????? super return end Sound.play_shop @number_window.active = false @number_window.visible = false # ???? operation_compose @gold_window.refresh @buy_window.refresh @status_window.refresh @buy_window.active = true @buy_window.visible = true end #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- def operation_compose $game_party.lose_gold(@number_window.number * @item.compose_cost) $game_party.gain_item(@item, @number_window.number) # ?????? @item.compose_materials.each { |material| $game_party.lose_item(material.item, material.number * @number_window.number) } # ??????? $game_party.set_item_composed(@item) end end #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ #_/ The original untranslated version of this script can be found here: # http://f44.aaa.livedoor.jp/~ytomy/tkool/rpgtech/php/tech.php?tool=VX&cat=tech_vx/item&tech=compose_item #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_ Edited October 13, 2011 by Silencher Share this post Link to post Share on other sites
Bigace360 38 Report post Posted October 13, 2011 (edited) I don't know if you still want this, but here you go for VX. That was a little confusing, but hopfully it works the way you want it to. #======================================== # 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 call 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 = { 2 => [[1, 0, 2]] } #--------------------------------------------- # Recipes for Weapons # Craft_Weapon_Comp = {weapon_id => [[item.id, item.type, # needed], etc...] #--------------------------------------------- Craft_Weapon_Comp = { 1 => [[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 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, n, include_equip) leon_cs_gameparty_gainitem(item, n, include_equip) 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, 544, 64) self.contents.font.name = "Verdana" self.contents.font.size = 16 self.opacity = 140 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_List #============================================= class Window_Craft_List < Window_Selectable def initialize super(0, 64, 256, 416) self.contents.font.name = "Verdana" self.contents.font.size = 16 self.index = 0 self.opacity = 140 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.font.name = "Verdana" # "Items" window font self.contents.font.size = 16 for i in 0...@item_max draw_item(i) end end end def draw_item(index) item = @data[index] 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 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 + 32, 224, 32, item.name) self.contents.draw_text(x - 8, y + 32, 224, 32, $game_party.item_recipes_made[item.id].to_s, 2) else self.contents.draw_text(x, y + 32, 224, 32, "???????????") end when RPG::Weapon if $game_party.weapon_recipes_made[item.id] > 0 self.contents.draw_text(x, y + 32, 224, 32, item.name) self.contents.draw_text(x - 8, y + 32, 224, 32, $game_party.weapon_recipes_made[item.id].to_s, 2) else self.contents.draw_text(x, y + 32, 224, 32, "???????????") end when RPG::Armor if $game_party.armor_recipes_made[item.id] > 0 self.contents.draw_text(x, y + 32, 224, 32, item.name) self.contents.draw_text(x - 8, y + 32, 224, 32, $game_party.armor_recipes_made[item.id].to_s, 2) else self.contents.draw_text(x, y + 32, 224, 32, "???????????") end end end def update_cursor if @index < 0 # No cursor self.cursor_rect.empty elsif @index < @item_max # Normal self.cursor_rect.set(0, @index * 42, 40, 40) elsif @index >= 100 # Self self.cursor_rect.set(0, (@index - 100) * 42, 40, 40) else # All self.cursor_rect.set(0, 0, 40, @item_max * 40) 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.font.name = "Verdana" self.contents.font.size = 16 self.opacity = 140 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.draw_text(10, 32, 352, 32, item.description) 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.draw_text(10, 32, 352, 32, item.description) 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.draw_text(10, 32, 352, 32, item.description) 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 start perform_transition Input.update loop do Graphics.update Input.update update break if $scene != self end Graphics.update Graphics.freeze terminate end def perform_transition Graphics.transition(10, "Graphics/System/BattleStart", 80) end def start @info_window = Window_Craft_Info.new @list_window = Window_Craft_List.new @desc_window = Window_Craft_Desc.new(@list_window.list) end def terminate @info_window.dispose @list_window.dispose @desc_window.dispose @background.dispose end def return_scene $scene = Scene_Menu.new(0) end def update ci = Craft_Items @info_window.update("Select an item to create.") @list_window.update @desc_window.update if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) @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 Edited October 13, 2011 by bigace Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 13, 2011 This is great, it allows me to run the project. Just one thing though, what script to I call to actually use this and go to the crafting window? I'm not seeing instructions for it in the script, though I see how to add recipes which is cool. Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 13, 2011 (edited) Actually there seems to be some other issues cropping up too. When I try to equip something I get this error: --- Script 'Game_Actor' line 443: ArgumentError occurred. wrong number of arguments(2 for 3) This is the line of code it's talking about: $game_party.gain_item(last_item, 1) --- Also, if I try to add items to the inventory of the player, just a 'change item/change weapon event', I get this error. ---- Script 'Game_Interpreter' line 894: ArgumentError occurred. wrong number of arguments(2 for 3) This is the line of code it's talking about: $game_party.gain_item($data_items[@params[0]], value) ---- NOTE: To make sure there weren't script conflicts causing this, I tried just this script in a brand new project and it gave the same errorsin the same situations. Note 2: Could it be something to do with this line? I don't know ruby yet but it almost seems like this is stating anytime 'gain_item) is used it must have 3 arguments. def gain_item(item, n, include_equip) leon_cs_gameparty_gainitem(item, n, include_equip) compile end Edited October 13, 2011 by Silencher Share this post Link to post Share on other sites
Bigace360 38 Report post Posted October 13, 2011 Ya I got the second error, but I have no clue how to fix that. Sorry :( . Well unless someone knows RGSS2, your going to have to use the other one you found. Share this post Link to post Share on other sites
Silencher 0 Report post Posted October 13, 2011 Ah well thanks anyway, it was a good try. =) Share this post Link to post Share on other sites