(Keep in mind that this is a 'VX' request.)
Can someone please help change this script. I want it to be a 'button pressing' script call.
So by calling the script to activate you'll need to press a button on your keyboard.
Example: pressing "S" on your keyboard will call/activate this script.
I'm not really sure how to describe it. Sorry.
This is the script:
This script haves nothing to do with what i'm saying but this is kinda like how i want it.
Can someone please help change this script. I want it to be a 'button pressing' script call.
So by calling the script to activate you'll need to press a button on your keyboard.
Example: pressing "S" on your keyboard will call/activate this script.
I'm not really sure how to describe it. Sorry.
This is the script:
Code:
#===============================================================================
#
# Shanghai Simple Script - Pick Item Event
# Last Date Updated: 2010.05.25
# Level: Easy
#
# This script prompts open a window to allow the player to select an item,
# weapon, or armor from the inventory to give the NPC, show the NPC, or whatever
# floats your boat. Works only on the map.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below â–¼ Materials but above â–¼ Main. Remember to save.
#
# These commands go into the script call event. Use any one of these.
# $game_variables[1] = pick_item_event
# $game_variables[1] = pick_weapon_event
# $game_variables[1] = pick_armor_event
#
# This will return the selected item's item ID, weapon ID, or armor ID to the
# game variable you stored. 0 is returned if the player cancels.
#
# <key item>
# Place this tagin the noteboxes of your items, weapons, or armors to make
# you unable to select those items for the pick item event.
#===============================================================================
$imported = {} if $imported == nil
$imported["PickItemEvent"] = true
module SSS
# This sets how many items will be shown by rows and columns.
PICK_ITEM_ROWS = 8
PICK_ITEM_COLS = 8
end
#==============================================================================
# RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# key_item
#--------------------------------------------------------------------------
def key_item
return @key_item if @key_item != nil
@key_item = false
self.note.split(/[\r\n]+/).each { |line|
case line
when /<(?:KEY_ITEM|key item)>/i
@key_item = true
end
}
return @key_item
end
end
#==============================================================================
# ** Game_Interpreter
#==============================================================================
class Game_Interpreter
#--------------------------------------------------------------------------
# * Pick Item Event
#--------------------------------------------------------------------------
def pick_item_event
return 0 unless $scene.is_a?(Scene_Map)
return $scene.pick_item_event(:item)
end
#--------------------------------------------------------------------------
# * Pick Weapon Event
#--------------------------------------------------------------------------
def pick_weapon_event
return 0 unless $scene.is_a?(Scene_Map)
return $scene.pick_item_event(:weapon)
end
#--------------------------------------------------------------------------
# * Pick Armor Event
#--------------------------------------------------------------------------
def pick_armor_event
return 0 unless $scene.is_a?(Scene_Map)
return $scene.pick_item_event(:armor)
end
end
#==============================================================================
# ** Window_Pick_Item
#==============================================================================
class Window_Pick_Item < Window_Selectable
#--------------------------------------------------------------------------
# * initialize
#--------------------------------------------------------------------------
def initialize(type)
@type = type
w = SSS::PICK_ITEM_COLS * 24 + 32
x = Graphics.width - w
h = [SSS::PICK_ITEM_ROWS * 24 + 32, Graphics.height - 184].min
y = Graphics.height - h - 128
super(x, y, w, h)
self.index = 0
self.openness = 0
@column_max = SSS::PICK_ITEM_COLS
@spacing = 0
refresh
end
#--------------------------------------------------------------------------
# * Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@data = []
case @type
when :item, :items
for item in $game_party.items
next unless item.is_a?(RPG::Item)
@data.push(item) if include?(item)
end
when :weapon, :weapons
for item in $game_party.items
next unless item.is_a?(RPG::Weapon)
@data.push(item) if include?(item)
end
when :armor, :armors, :armour, :armours
for item in $game_party.items
next unless item.is_a?(RPG::Armor)
@data.push(item) if include?(item)
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Include?
#--------------------------------------------------------------------------
def include?(item)
return false if item.nil?
return true
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
unless item.nil?
icon = item.icon_index
draw_icon(icon, rect.x, rect.y, enabled?(item))
draw_item_amount(item, rect.clone)
end
end
#--------------------------------------------------------------------------
# * Enabled?
#--------------------------------------------------------------------------
def enabled?(item)
return false if item.nil?
return false if item.key_item
return true
end
#--------------------------------------------------------------------------
# * Draw Item Amount
#--------------------------------------------------------------------------
def draw_item_amount(item, rect)
self.contents.font.size = 12
number = $game_party.item_number(item)
self.contents.font.color.alpha = enabled?(item) ? 255 : 128
self.contents.draw_text(rect.x, rect.y + WLH/3, 24, WLH * 2/3, number, 2)
end
end
#==============================================================================
# ** Window_Pick_Item_Help
#==============================================================================
class Window_Pick_Item_Help < Window_Base
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def initialize(pick_item_window)
@pick_item_window = pick_item_window
y = @pick_item_window.y - 56
w = [@pick_item_window.width, 200].max
x = Graphics.width - w
super(x, y, w, 56)
self.openness = 0
refresh
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
super
refresh if @last_item != @pick_item_window.item
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
item = @last_item = @pick_item_window.item
draw_icon(item.icon_index, 0, 0)
self.contents.draw_text(24, 0, contents.width - 24, WLH, item.name)
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias terminate_sss_pick_item_event terminate unless $@
def terminate
unless @pick_item_window.nil?
@pick_item_window.dispose
@pick_item_window = nil
@pick_item_help.dispose
@pick_item_help = nil
end
terminate_sss_pick_item_event
end
#--------------------------------------------------------------------------
# * Pick Item Event
#--------------------------------------------------------------------------
def pick_item_event(type = :item)
case type
when :item, :items, :weapon, :weapons, :armor, :armors, :armour, :armours
@pick_item_window = Window_Pick_Item.new(type)
@pick_item_help = Window_Pick_Item_Help.new(@pick_item_window)
else
return 0
end
value = 0
@pick_item_window.open
@pick_item_help.open
loop do
update_basic
@pick_item_window.update
@pick_item_help.update
if Input.trigger?(Input::
Sound.play_cancel
value = 0
break
elsif Input.trigger?(Input::C)
item = @pick_item_window.item
if @pick_item_window.enabled?(item)
Sound.play_decision
value = item.id
break
else
Sound.play_buzzer
end
end
end
@pick_item_window.close
@pick_item_help.close
loop do
update_basic
@pick_item_window.update
@pick_item_help.update
break if @pick_item_window.openness == 0
end
@pick_item_window.dispose
@pick_item_window = nil
@pick_item_help.dispose
@pick_item_help = nil
return value
end
end
#===============================================================================
#
# END OF FILE
#
#===============================================================================
This script haves nothing to do with what i'm saying but this is kinda like how i want it.
Code:
#####################################################
# On-Screen Equip #
# by new (momo) #
# for My Lazy Afternoon #
# plug and play #
# insert under �–� Materials, above �–� Main Process #
# date created: 2/23/2013 #
#####################################################
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
$game_map.interpreter.update # Update interpreter
$game_map.update # Update map
$game_player.update # Update player
$game_system.update # Update timer
@spriteset.update # Update sprite set
@message_window.update # Update message window
unless $game_message.visible # Unless displaying a message
update_transfer_player
update_encounter
update_call_menu
update_call_debug
update_scene_change
call_equip
end
end
#--------------------------------------------------------------------------
# �—� call equip
#--------------------------------------------------------------------------
def call_equip
return if $game_system.menu_disabled # Menu forbidden?
if Input.press?(Input::X) # when L button is pressed
Sound.play_decision
$game_temp.next_scene = nil
Sound.play_decision
$scene = Scene_OSEquip.new
end
end
end
#==============================================================================
# ** Window_OSEquip
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_OSEquip < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y corrdinate
# actor : actor
#--------------------------------------------------------------------------
def initialize(x, y, actor)
super(x, y, 272, WLH + 32)
@item_max = 1
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
for item in @actor.weapons do @data.push(item) end
@item_max = @data.size
self.contents.font.color = system_color
draw_item_name(@data[0], 4, WLH * 0)
end
#--------------------------------------------------------------------------
# * Update Help Text
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(item == nil ? "" : item.description)
end
end
#==============================================================================
# ** Scene_OSEquip
#------------------------------------------------------------------------------
# This class performs the equipment screen processing.
#==============================================================================
class Scene_OSEquip < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
# equip_index : equipment index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@help_window = Window_Help.new
@equip_window = Window_OSEquip.new(136, 112, @actor)
@equip_window.help_window = @help_window
@equip_window.index = @equip_index
@item_window = Window_EquipItem.new(0, 208, 544, 208, @actor, 0)
@item_window.help_window = @help_window
@item_window.active = false
@item_window.index = -1
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@help_window.dispose
@equip_window.dispose
dispose_item_windows
end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
update_equip_window
update_item_windows
if @equip_window.active
update_equip_selection
elsif @item_window.active
update_item_selection
end
end
#--------------------------------------------------------------------------
# * Dispose of Item Window
#--------------------------------------------------------------------------
def dispose_item_windows
@item_window.dispose
end
#--------------------------------------------------------------------------
# * Update Item Window
#--------------------------------------------------------------------------
def update_item_windows
@item_window.visible = true
@item_window.update
end
#--------------------------------------------------------------------------
# * Update Equipment Window
#--------------------------------------------------------------------------
def update_equip_window
@equip_window.update
end
#--------------------------------------------------------------------------
# * Update Equip Region Selection
#--------------------------------------------------------------------------
def update_equip_selection
if Input.trigger?(Input::
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
Sound.play_decision
@equip_window.active = false
@item_window.active = true
@item_window.index = 0
end
end
#--------------------------------------------------------------------------
# * Update Item Selection
#--------------------------------------------------------------------------
def update_item_selection
if Input.trigger?(Input::
Sound.play_cancel
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
elsif Input.trigger?(Input::C)
Sound.play_equip
@actor.change_equip(0, @item_window.item)
@equip_window.active = true
@item_window.active = false
@item_window.index = -1
@equip_window.refresh
@item_window.refresh
end
end
end