Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Warped Movement for Window Selectable
#1
Hey all
I was fiddling around with the movement of Window_Items. I found the way I represent here better. I decided to make it broader and have created a solution intended for subclasses of Window_Selectable
I will provide two versions. One if you want to only apply this on certain windows and not others. Another that just changes the functionality of Window_Selectable. (demo of both)

Also, if you have a better name for my script please do tell ^^

Here is the mix-in version for changing specific classes:
Code:
#==============================================================================
# ** Warped Movement mix-in for subclasses of Window Selectable
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2007-08-22 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
# This is a mix-in module for windows subclassing designed to 'enhance' the
# arrow-key movement system used to select the item by creating warping.
# That is, if you are at the bottom and press down you will go up to the top
# in the next column. Like-wise for down, left and right.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place the script anywhere above Main.
# To give a subclass of Window_Selectable let it include the module
#
# If you for example wanted to apply the module to Window_Item you should
# write this code: (Must be below the original Window_Item
# ------------------------------------------
# class Window_Item < Window_Selectable
# include Window_Selectable_Type_2
# end
# ------------------------------------------
#
# Here is a version for Window_Skill. You get the idea.
# ------------------------------------------
# class Window_Skill < Window_Selectable
# include Window_Selectable_Type_2
# end
# ------------------------------------------
#
# Note: Don't include this module in Window_Selectable ~
# May cause issues with Windows where the update method is used
#==============================================================================

#==============================================================================
# ** module Window_Selectable_Warped
#==============================================================================
module Window_Selectable_Warped
#----------------------------------------------------------------------------
# * Frame Update
#----------------------------------------------------------------------------
def update
last_index = @index
super
if last_index == @index && active && @item_max > 1
if Input.repeat?(Input::DOWN)
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index % @column_max + 1) % @column_max
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index % @column_max + 1)
@index = -@index % @item_max + @item_max % @column_max
@index -= @column_max if @index >= @item_max
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @item_max
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index = (@index - 1) % @item_max
end
end
end
end
Next we have the change for all Window_Selectable subclasses. This also requires less work.
Code:
#==============================================================================
# ** Warped Movement for Window Selectable
#------------------------------------------------------------------------------
# Zeriab
# Version 1.0
# 2007-08-22 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Description :
#
# This script is designed to 'enhance' the arrow-key movement system of
# Window_Selectable used to select the item by allowing warping.
# That is, if you are at the bottom and press down you will go up to the top
# in the next column. Like-wise for down, left and right.
#------------------------------------------------------------------------------
# * Instructions :
#
# Place the script below Window_Selectable and above Main.
#
# Note: May cause issue with scripts that are depent on the index not
# changing under certain circumstances
#==============================================================================

#==============================================================================
# ** Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
alias zeriab_warped_update update
#----------------------------------------------------------------------------
# * Frame Update
#----------------------------------------------------------------------------
def update
last_index = @index
# original update method is called
zeriab_warped_update
if last_index == @index && active && @item_max > 1
if Input.repeat?(Input::DOWN)
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index % @column_max + 1) % @column_max
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index % @column_max + 1)
@index = -@index % @item_max + @item_max % @column_max
@index -= @column_max if @index >= @item_max
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @item_max
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index = (@index - 1) % @item_max
end
end
end
end
Instructions are in the script headers. Enjoy ~

- Zeriab
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Enhanced Squad Movement DerVVulfman 5 5,233 02-24-2023, 04:40 PM
Last Post: DerVVulfman
   Drago Pixel Movement LiTTleDRAgo 1 5,254 07-08-2017, 12:12 PM
Last Post: LiTTleDRAgo
   DoubleX RMVXA Diagonal Movement DoubleX 0 4,162 08-15-2015, 02:13 PM
Last Post: DoubleX
   DoubleX RMVXA Pixel Movement DoubleX 1 5,542 08-15-2015, 04:51 AM
Last Post: DoubleX
   WASD Movement Helladen 2 7,667 02-27-2014, 05:10 AM
Last Post: Helladen
   Advanced Movement 1.2 Helladen 1 5,084 01-25-2014, 02:25 AM
Last Post: Helladen
   Battle Report Script Window style mageone 4 15,574 03-20-2013, 10:51 PM
Last Post: KasperKalamity
   Mr.Mo ABS Game Log Window JayRay 0 4,777 10-30-2012, 06:54 AM
Last Post: JayRay
   Semi Ace Window System XP kyonides 0 5,196 10-01-2012, 11:25 PM
Last Post: kyonides
   Skip Party Command Window Helladen 0 4,400 07-27-2012, 06:43 AM
Last Post: Helladen



Users browsing this thread: