ArcanaMagek
Member
Now I get this really weird thing going on with my project...
I'm working on a script and I aliased Scene_Map and now all my sprites and my character move really fast :huh:
I don't understand this at all! Can somebody help me?
I'll post my script here:
I'm working on a script and I aliased Scene_Map and now all my sprites and my character move really fast :huh:
I don't understand this at all! Can somebody help me?
I'll post my script here:
Code:
#===============================================================================
# ** Shortcut Skills
#===============================================================================
#*By Starsoft (a.k.a Khaliid)
#===============================================================================
# *Version: 2.50
# *Created: 12.08.09
# *SDK: Not needed!
# *RM: XP
#===============================================================================
# *Description:
# This script is for people who want to use hotkeys in their games.
# Hotkeys are buttons pressed in Scene_Skill to memorize skills.
# These memorized skills can then be used on the map by pressing the hotkey.
#===============================================================================
# *Future Plans:
# -Also usable in Scene_Item.[ ]
# -Window + sound for confirmation. [V]
# -HUD [V]
#===============================================================================
#$$$$$$$$$$$$$$$$$$$$$$$$$$ PART 1: Scene_Map $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#===============================================================================
class Scene_Map
#=============================================================================
# * Alias Listing
#=============================================================================
alias_method :hotkeys_map_update, :update
alias_method :yourhud_update, :update
alias_method :yourhud_main, :main
#=============================================================================
# * Frame Update
#=============================================================================
def main
yourhud_main
@yourhud = Window_YourHUD.new
@yourhud.dispose
end
def update
hotkeys_map_update
yourhud_update
@skill = $stored_skill
@item = $stored_item
#if Input.trigger?(Input::Q)
#if @item == nil
#else
if @skill == nil
else
yourhud_update
@yourhud.update
end
#end
if Input.trigger?(Input::A)
if @skill == nil
else
$game_temp.common_event_id = @skill.common_event_id
end
end
end
end
#===============================================================================
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ END OF PART 1 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#$$$$$$$$$$$$$$$$$$$$$$$$$$ PART 2: Scene_Skill $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#===============================================================================
class Scene_Skill
#=============================================================================
# * Alias Listing
#=============================================================================
alias_method :hotkeys_skill_update, :update
#=============================================================================
# * Frame Update
#=============================================================================
def update
hotkeys_skill_update
if @group_window.active
else
if Input.trigger?(Input::A)
$game_system.se_play($data_system.equip_se)
$stored_skill = @skill_window.skill
@confirm_window = Window_Confirm.new
end
if Input.trigger?(Input::B)
@confirm_window.dispose
end
end
end
end
#===============================================================================
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ END OF PART 2 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#$$$$$$$$$$$$$$$$$$$$$$$$$$ PART 3: Scene_Item $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#===============================================================================
#class Scene_Item
#=============================================================================
# *Alias Listing
#=============================================================================
# alias_method :hotkeys_item_update, :update
#=============================================================================
# * Frame Update
#=============================================================================
# def update
# hotkeys_item_update
# if Input.trigger?(Input::A)
# $stored_item = @item_window.item
# end
# end
#end
#===============================================================================
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ END OF PART 3 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#$$$$$$$$$$$$$$$$$$$$$$$$$ PART 4: Scene Windows $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#===============================================================================
class Window_Confirm < Window_Base
def initialize
super(0, 420, 640, 65)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
skill = $stored_skill
hotkey_color = Color.new(220, 210, 20)
self.contents.font.color = hotkey_color
self.contents.draw_text(0, 0, 640, 32, "Assigned " + skill.name + " to hotkey.", 0)
end
#===============================================================================
end #$$$$$$$$$$$$$$$$$$$$$$$$$ END OF SCRIPT $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#===============================================================================
class Window_YourHUD < Window_Base
def initialize
super(0, 0, 150, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
refresh
end
def refresh
self.contents.clear
skill = $stored_skill
hotkey_color = Color.new(220, 210, 20)
self.contents.font.color = hotkey_color
if skill == nil
self.contents.draw_text(0, 0, 150, 32, "No Skill", 1)
else
self.contents.draw_text(0, 0, 150, 32, skill.name, 0)
end
end
end