In a nutshell, if the player the items to make an item defined in the module, it is automatically added to the list.
Further, if you want, you can make it so that some items can't be made, and don't appear, until after a certain event (using call script to execute it.)
If that isn't enough, you can add the item to the list much like Deke's by saying each item needs to be triggered by an event, and add it using call script instead of based on items being held.
Further still, it doesn't tell what the concoction will make UNTIL it is made.
The instructions on how to use this are in the script, so please look there for them in the header.
Screenshot:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi50.photobucket.com%2Falbums%2Ff310%2Fvirtuouspaladin9%2Fcraft1.jpg&hash=f5db0d3256337804ecd82101718b1f6adaa5d3eb)
Script:
[spoiler="Script"]
#========================================
# 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
[/spoiler]
This looks like an excellent script. + rep.
I needed a crafting system. I was going to write my own, but I think you had better ideas so I think I will steal this from you, if you don't mind :police:
I'll credit you, naturally.
Excellent work, I still think I'll use Prexus' Crafting system though XD
I do like the feature of hiding items though.
I know this probably sounds N00BISH but, how do you access the craft menu?
$scene = Scene_Craft.new
Hey, rather old topic and a little dead so I may be accused of being a necrothreader but ok :)
I just got this script and I was wondering if anyone could help me out with adding it to hte main menu, so instead of having to use events to open it, I could have it in the main menu along with "Equip" "Status" and such :) Thanks guys.
I tried myself but I'm a noob with this scripting stuff :) learning, but slowly :P
Any help would be much appreciated, thanks :D
Well, Hez necro'd the thread to not much avail, but I'll try mine.
There's a few things I don't get, first off: The ID's of the weapons, armors and items. I have an idea though. On all 3 tabs, it gives the list of things, and they are all numbered going down.
For weapons it's 001: Bronze Sword and 002: Iron Sword etc, 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]]
Is the line from the script, which I'm ASSUMING is the example given. But either you're suppose to name the items which I'm sure you don't, or
But yeah, the whole thing is confusing to me, so if anyone can either explain or just make a demo that actually has the script put into use, I'd appreciate it.
Edit* Well I just said to hell with it, and I put some items in the game, and afterwards the crafting list was full of things to create. But when I tried to create an item, I'd get: Script 'Creation' line 481: TypeError eccured. no implicit conversion from nil to integer
Quote from: modern algebra on October 14, 2007, 03:19:05 PM
$scene = Scene_Craft.new
sorry, I'm still a beginner .. ;D ;D ;D
where I should place the code ... ??? ??? ???
thank you for the attention ... :lol: :lol: :lol:
in a script call (third page of events)
Quote from: modern algebra on December 06, 2009, 01:34:03 AM
in a script call (third page of events)
Thanks... buddy ;D ;D ;D
I would like to know a couple of things
I edited the first item to made a Potion with Water and Grass just to test it out
so Potion is 001 Water is 002 and grass is 003 in the item database
I changed the script to
Craft_Item_Comp = {
1 => [[2, 0, 1], [3, 0, 5]]
I also made 2 events, one gives me 1 Water and 5 Grass and the other that calls
$scene = Scene_Craft.new
so I get the Water and Grass from the event then I go to the other one to call the script and make it and is happens
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg26.imageshack.us%2Fimg26%2F7140%2F10328813.th.png&hash=b5a40bd4125cf281d67e7567ed46f777a8c25296) (http://img26.imageshack.us/i/10328813.png/)
also can I have it so even if the player don't have the right items or amount of items it still shows you how to made the item
and how do I change the ????????????????? to the item name you will make?
I would have to agree that a demo would be nice. Despite how much info is given in the header, it's not always stated in the best English, or is all the helpful information given to those that are not familiar with scripting (even with minimal amounts). In the header, there are many strings to insert, but it doesn't say where. I have tried entering them within the script, in events, and also with call scripts until they were strewn all over my game and had to start over. Maybe a little more detailed description on EXACTLY what to do with each string would be nice if a demo is not going to be provided.
I'm sure the script works great for those who are able to figure everything out, it's just my opinion to make things a little more "newbie-friendly" or give a downloadable demo so that people can look at the variables and figure things out on their own. I'm sure it would also eliminate alot of questions being posted on here. ;D
BUMP