[RPG MAKER VX ACE] Synthesys Shop

NeroRavyn

Villager
Member
Joined
Jul 21, 2018
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Hey all,
I am trying to implement a syntheses/crafting shop into my game. Currently I am using Coelocanth's item crafting script (found here https://rpgmaker.net/scripts/319/). The only issue I have with this script is that when crafting an item there is no form of confirmation (nor the quantity confirmation that is normally implemented to shops.)
I have seen other crafting scripts but I can't find any that are uncomplicated to implement. (I've tried to use Mr. Bubbles tactics ogre psp crafting system but the game crashes every time I use the script call. I've also seen Kread_Ex's system but I can't find the actual script)
If anyone knows of a fairly simple crafting system that has a confirmation (or the quantity confirmation) or know a way to add a conformation to Coelocanth's original script that would be super appreciated!
 

NeroRavyn

Villager
Member
Joined
Jul 21, 2018
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMVXA
I'm still looking for a way to add a confirmation to a syntheses shop.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,668
Reaction score
566
First Language
English
Primarily Uses
RMVXA
still looking
Look no more
Ruby:
#==============================================================================
# Coelocanth's item crafting system popup
# Version: 1.0
#==============================================================================
# License Information:
# Follow Coelocanth's Terms
#==============================================================================
# Function:
# Creates a popup window to display item crafted
#==============================================================================
# Code:
# Code ideas duplicated from Vlue Item Appraisal
#==============================================================================
class Scene_CraftBase < Scene_MenuBase
  alias r2_craft_coel_start start
  def start
    r2_craft_coel_start
    create_confirm_window
  end
  def create_confirm_window
    @window_confirm = Window_ConfirmPopup.new
    @window_confirm.set_handler(:ok, method(:craft_ok))
    @window_confirm.set_handler(:cancel, method(:craft_ok))
  end
  def craft_ok
    @window_confirm.deactivate
    @window_confirm.close
    @recipe_window.refresh
    @recipe_window.select(0)
    @recipe_window.activate
  end
end
class Scene_Crafting < Scene_CraftBase
  #--------------------------------------------------------------------------
  # * Item [OK]
  # remove ingredients, add new item to inventory
  #--------------------------------------------------------------------------
  def on_item_ok
    Sound.play_ok
    item.crafting_items.each \
    { |key,value| ok &= $game_party.gain_item($data_items[key], -value) }
    item.crafting_weapons.each \
    { |key,value| ok &= $game_party.gain_item($data_weapons[key], -value) }
    item.crafting_armors.each \
    { |key,value| ok &= $game_party.gain_item($data_armors[key], -value) }
    $game_party.gain_item(item, 1)
    $game_party.lose_gold(item.crafting_gold)
    @window_confirm.set_text(item)
    @window_confirm.activate
  end
end
class Window_ConfirmPopup < Window_Selectable
  def initialize
    super(120, 200, window_width, window_height)
    self.openness = 0
    deactivate
  end
  def window_width; 320; end
  def window_height; 48; end
  def refresh; end;
  def set_text(item)
    contents.clear
    text1, text2 = item.name, " crafted!"
    width = contents.text_size(text1 + text2).width + 30
    create_contents
    draw_text(24,1,contents.width,24,text1)
    change_color(normal_color)
    draw_text(24+contents.text_size(text1).width,1,contents.width,24,text2)
    draw_icon(item.icon_index,0,0)
    open
  end
  def process_ok
    if current_item_enabled?
      Input.update
      deactivate
      call_ok_handler
    else
      Sound.play_buzzer
    end
  end
end
 

NeroRavyn

Villager
Member
Joined
Jul 21, 2018
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Look no more
Ruby:
#==============================================================================
# Coelocanth's item crafting system popup
# Version: 1.0
#==============================================================================
# License Information:
# Follow Coelocanth's Terms
#==============================================================================
# Function:
# Creates a popup window to display item crafted
#==============================================================================
# Code:
# Code ideas duplicated from Vlue Item Appraisal
#==============================================================================
class Scene_CraftBase < Scene_MenuBase
  alias r2_craft_coel_start start
  def start
    r2_craft_coel_start
    create_confirm_window
  end
  def create_confirm_window
    @window_confirm = Window_ConfirmPopup.new
    @window_confirm.set_handler(:ok, method(:craft_ok))
    @window_confirm.set_handler(:cancel, method(:craft_ok))
  end
  def craft_ok
    @window_confirm.deactivate
    @window_confirm.close
    @recipe_window.refresh
    @recipe_window.select(0)
    @recipe_window.activate
  end
end
class Scene_Crafting < Scene_CraftBase
  #--------------------------------------------------------------------------
  # * Item [OK]
  # remove ingredients, add new item to inventory
  #--------------------------------------------------------------------------
  def on_item_ok
    Sound.play_ok
    item.crafting_items.each \
    { |key,value| ok &= $game_party.gain_item($data_items[key], -value) }
    item.crafting_weapons.each \
    { |key,value| ok &= $game_party.gain_item($data_weapons[key], -value) }
    item.crafting_armors.each \
    { |key,value| ok &= $game_party.gain_item($data_armors[key], -value) }
    $game_party.gain_item(item, 1)
    $game_party.lose_gold(item.crafting_gold)
    @window_confirm.set_text(item)
    @window_confirm.activate
  end
end
class Window_ConfirmPopup < Window_Selectable
  def initialize
    super(120, 200, window_width, window_height)
    self.openness = 0
    deactivate
  end
  def window_width; 320; end
  def window_height; 48; end
  def refresh; end;
  def set_text(item)
    contents.clear
    text1, text2 = item.name, " crafted!"
    width = contents.text_size(text1 + text2).width + 30
    create_contents
    draw_text(24,1,contents.width,24,text1)
    change_color(normal_color)
    draw_text(24+contents.text_size(text1).width,1,contents.width,24,text2)
    draw_icon(item.icon_index,0,0)
    open
  end
  def process_ok
    if current_item_enabled?
      Input.update
      deactivate
      call_ok_handler
    else
      Sound.play_buzzer
    end
  end
end
Thank you !!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,190
Members
137,772
Latest member
Kirakirna
Top