[XP] Hotkey Number Modifier

Started by JellalFerd, June 16, 2011, 10:09:22 am

Previous topic - Next topic

JellalFerd

June 16, 2011, 10:09:22 am Last Edit: June 18, 2011, 02:41:09 am by JellalFerd
Hotkey Number Modifier
Authors: Jellalferd
Version: .7
Type: Blizz-ABS Plugin
Key Term: Blizz-ABS Plugin



Introduction
This script modifies the number of hotkeys you have.


Features


  • Modifies the amount of Hotkeys




Screenshots



Demo
The script is pretty much plug and play, so I think no demo is required.


Script
Spoiler: ShowHide

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



Instructions
Just modify this line:
Hotkeys = 3



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 Notes
I got inspired to make this because of this:
Spoiler: ShowHide
QuoteFrank says:
But obviously they put on that shirt on in the morning.
Hmmm..
Booty shirts are nice.
Depends on the girl.
Jellal says:
booty shirts
lolwut

mroedesigns

Very nice script! I enjoy having 10 hotkeys, but I still may use this to give the player the option for less.

JellalFerd

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.
QuoteFrank says:
But obviously they put on that shirt on in the morning.
Hmmm..
Booty shirts are nice.
Depends on the girl.
Jellal says:
booty shirts
lolwut

G_G

Is it because of this - 1?
BlizzABS::Cache::Keys = 0..BlizzCFG::Hotkeys-1

JellalFerd

No.
In the actual Blizz-ABS Script, the line is:
Keys = 0..9

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.
QuoteFrank says:
But obviously they put on that shirt on in the morning.
Hmmm..
Booty shirts are nice.
Depends on the girl.
Jellal says:
booty shirts
lolwut

ForeverZer0

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 am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

JellalFerd

...I can't believe I forgot that. ;_;
QuoteFrank says:
But obviously they put on that shirt on in the morning.
Hmmm..
Booty shirts are nice.
Depends on the girl.
Jellal says:
booty shirts
lolwut