Hotkey Number Modifier
Authors: Jellalferd
Version: .7
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin
IntroductionThis script modifies the number of hotkeys you have.
Features
- Modifies the amount of Hotkeys
Screenshots(http://img135.imageshack.us/img135/2428/screenshotfrt.png)
DemoThe script is pretty much plug and play, so I think no demo is required.
Script
module BlizzCFG
Hotkeys = 3
end
class Hotkeys
BlizzABS::Cache::Keys = 0...BlizzCFG::Hotkeys
BlizzABS::Cache::HotkeyRange = 1..BlizzCFG::Hotkeys
end
class Scene_Hotkeys
def update_choice
# set x position
@choice.x = 160 + @index * 32
# if pressed B
if Input.trigger?(Input::B)
# play cancel sound
$game_system.se_play($data_system.cancel_se)
# create map scene
$scene = Scene_Map.new
# if C is pressed
elsif Input.trigger?(Input::C)
# play sound
$game_system.se_play($data_system.decision_se)
# not active
@active = false
# the one that was active the last time is now active
@skill_window.active = @last_active
@item_window.active = (!@last_active)
# if RIGHT is being pressed
elsif Input.repeat?(Input::RIGHT)
# if RIGHT is pressed or index is less than 9
if Input.trigger?(Input::RIGHT) || @index < BlizzCFG::Hotkeys-1
# play sound
$game_system.se_play($data_system.cursor_se)
# set new index
@index = (@index + 1) % BlizzCFG::Hotkeys
end
# if LEFT is being pressed
elsif Input.repeat?(Input::LEFT)
# if LEFT is pressed or index is equal or greater than 1
if Input.trigger?(Input::LEFT) || @index >= 1
# play sound
$game_system.se_play($data_system.cursor_se)
# set new index
@index = (@index + BlizzCFG::Hotkeys-1) % BlizzCFG::Hotkeys
end
end
end
end
InstructionsJust modify this line:
Compatibility
- I haven't tested it with Direct Hotkeys yet.
- The direct edit in Scene_Hotkeys should make it incompatible with Z-Hud...for now.
Credits and Thanks
Author's NotesI got inspired to make this because of this:
(http://img15.imageshack.us/img15/2969/snap645.png)
Very nice script! I enjoy having 10 hotkeys, but I still may use this to give the player the option for less.
Alright, I've been testing it more, and apparently it doesn't work with some specific numbers.
The first one I've encountered is 5.
If you have it set to 5, Hotkeys 1-4 work, but 5 doesn't.
Is it because of this - 1?
BlizzABS::Cache::Keys = 0..BlizzCFG::Hotkeys-1
No.
In the actual Blizz-ABS Script, the line is:
That's ten keys. If the -1 wasn't there, it'd be one higher than the specified value.
Also,if that were the problem, it'd be a flaw with all other numbers, so far, it's only happened on the number 5.
Just add an extra dot in the range and you need not do the -1 at the end.
BlizzABS::Cache::Keys = 0...BlizzCFG::Hotkeys
...I can't believe I forgot that. ;_;