LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : 1, 2, 3, 4, 5, 6  Next

View previous topic View next topic Go down Message [Page 1 of 6]

EVENTALIST
EVENTALIST
#1 XAS - Hot Keys Script Empty XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
XAS - Hot Keys
Version: 1.3
Author: Mr Wiggles
Date: July 6, 2010

Version History



  • Version 1.3 7/6/10 - Bug with Input Module
  • Version 1.0 7/3/10 - Original Release


Planned Future Versions

  • Nothing that i know of.


Description


This makes it so that the player can hot key an item, weapon, shield, or a skill to any of the 1-5 number keys, and will display the hot keys in a HUD.

Features

  • They where listed in the description.


Screenshots
XAS - Hot Keys Script Oudoou

Instructions
Fill in the constants bellow, paste this script above main and bellow XAS in your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
Place the "Hot_Keys_HUD" picture file into your game directory Graphics/Pictures folder.

script


"Hot_Keys_HUD" picture:
XAS - Hot Keys Script Hot_ke10

#===============================================================================
# XAS - Hot Key HUD
#===============================================================================
# By Mr_Wiggles
# Version 1.3
# 7/6/10
#-------------------------------------------------------------------------------
# Instructions:
# Fill in the constants bellow, paste this script above main and bellow XAS in
# your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
#
# Place the "Hot_Keys_HUD" picture file into your game directory
# Graphics/Pictures folder.
#-------------------------------------------------------------------------------
# Directions of Use:
# Simple just press a number key (1 - 5) when the quick skill or item menu is
# Showing.
#===============================================================================
HUD_X = 0 # X pos of HUD
HUD_Y = 0 # Y pos of HUD

# Set true if XAS 3.7f
# set false if XAS 3.6
XASVER_37 = true

#===============================================================================
# Numkeys Module
#===============================================================================
module Input
Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
class << self
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')

def testkey(key)
Key.call(key) & 0x01 == 1
end

alias hud_key_update update
def update
hud_key_update
@pressed = []
for key in Numkey.values
key -= 1000
@pressed.push(key) if testkey(key)
end
end

def pressed?(key)
key -= 1000
@pressed = [] if @pressed.nil?
return true if @pressed.include?(key)
return false
end

alias hud_key_press? press?
def press?(key)
return pressed?(key) if key.to_f > 1000
hud_key_press?(key)
end
end
end

#===============================================================================
# Game Player
#===============================================================================
class Game_Player < Game_Character
attr_accessor :hud_equip

alias hot_key_hud_init initialize
def initialize
hot_key_hud_init
@hud_equip = []
end

def equip_item_to_hud(n, item)
if item.nil?
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
@hud_equip[n] = item
end
end

#===============================================================================
# Quick Skill Window
#===============================================================================
if XASVER_37 == false
class Xas_Scene_Skill
alias hud_quick_menu_main main
def main
@hot_key_hud = Hot_Key_HUD.new
hud_quick_menu_main
@hot_key_hud.dispose
end

alias hotkey_hud_qucik_menu_update update
def update
hotkey_hud_qucik_menu_update
# Hot Key num 1
if Input.press?(Input::Numkey[1])
$game_player.equip_item_to_hud(0, @skill_window.skill)
# Hot Key num 2
elsif Input.press?(Input::Numkey[2])
$game_player.equip_item_to_hud(1, @skill_window.skill)
# Hot Key num 3
elsif Input.press?(Input::Numkey[3])
$game_player.equip_item_to_hud(2, @skill_window.skill)
# Hot Key num 4
elsif Input.press?(Input::Numkey[4])
$game_player.equip_item_to_hud(3, @skill_window.skill)
# Hot Key num 5
elsif Input.press?(Input::Numkey[5])
$game_player.equip_item_to_hud(4, @skill_window.skill)
end
@hot_key_hud.update
end
end
else
class Quick_Menu_Skill
alias hud_quick_menu_main main
def main
@hot_key_hud = Hot_Key_HUD.new
hud_quick_menu_main
@hot_key_hud.dispose
end

alias hotkey_hud_qucik_menu_update update
def update
hotkey_hud_qucik_menu_update
# Hot Key num 1
if Input.press?(Input::Numkey[1])
$game_player.equip_item_to_hud(0, @skill_window.skill)
# Hot Key num 2
elsif Input.press?(Input::Numkey[2])
$game_player.equip_item_to_hud(1, @skill_window.skill)
# Hot Key num 3
elsif Input.press?(Input::Numkey[3])
$game_player.equip_item_to_hud(2, @skill_window.skill)
# Hot Key num 4
elsif Input.press?(Input::Numkey[4])
$game_player.equip_item_to_hud(3, @skill_window.skill)
# Hot Key num 5
elsif Input.press?(Input::Numkey[5])
$game_player.equip_item_to_hud(4, @skill_window.skill)
end
@hot_key_hud.update
end
end
end

#===============================================================================
# Quick Item Window
#===============================================================================
if XASVER_37 == false
class Xas_Scene_Item
alias hud_quick_menu_main main
def main
@hot_key_hud = Hot_Key_HUD.new
hud_quick_menu_main
@hot_key_hud.dispose
end

alias hud_key_update update
def update
hud_key_update
# Hot Key num 1
if Input.press?(Input::Numkey[1])
$game_player.equip_item_to_hud(0, @item_window.item)
# Hot Key num 2
elsif Input.press?(Input::Numkey[2])
$game_player.equip_item_to_hud(1, @item_window.item)
# Hot Key num 3
elsif Input.press?(Input::Numkey[3])
$game_player.equip_item_to_hud(2, @item_window.item)
# Hot Key num 4
elsif Input.press?(Input::Numkey[4])
$game_player.equip_item_to_hud(3, @item_window.item)
# Hot Key num 5
elsif Input.press?(Input::Numkey[5])
$game_player.equip_item_to_hud(4, @item_window.item)
end
@hot_key_hud.update
end
end
else
class Quick_Menu_Item
alias hud_quick_menu_main main
def main
@hot_key_hud = Hot_Key_HUD.new
hud_quick_menu_main
@hot_key_hud.dispose
end

alias hud_key_update update
def update
hud_key_update
# Hot Key num 1
if Input.press?(Input::Numkey[1])
$game_player.equip_item_to_hud(0, @item_window.item)
# Hot Key num 2
elsif Input.press?(Input::Numkey[2])
$game_player.equip_item_to_hud(1, @item_window.item)
# Hot Key num 3
elsif Input.press?(Input::Numkey[3])
$game_player.equip_item_to_hud(2, @item_window.item)
# Hot Key num 4
elsif Input.press?(Input::Numkey[4])
$game_player.equip_item_to_hud(3, @item_window.item)
# Hot Key num 5
elsif Input.press?(Input::Numkey[5])
$game_player.equip_item_to_hud(4, @item_window.item)
end
@hot_key_hud.update
end
end
end

#===============================================================================
# HUD Window
#===============================================================================
class Hot_Key_HUD < Window_Base
def initialize(x = HUD_X - 10, y = HUD_Y - 15)
super(x, y, 220, 80)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@actor = $game_party.actors[0]
refresh
end

def refresh
self.contents.clear
bitmap = RPG::Cache.picture("Hot_Keys_HUD")
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
for i in 0..4
x = 32 * i + 4
item = $game_player.hud_equip[i]
next if item.nil?
if item.is_a?(RPG::Weapon)
item = nil if $game_party.weapon_number(item.id) == 0 and
@actor.weapon_id != item.id
elsif item.is_a?(RPG::Armor)
item = nil if $game_party.armor_number(item.id) == 0 and
@actor.armor1_id != item.id
elsif item.is_a?(RPG::Item)
item = nil if $game_party.item_number(item.id) == 0 or
!$game_party.item_can_use?(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))
end
end

def equip(item)
if item.nil?
$game_system.se_play($data_system.buzzer_se)
return
end
if item.is_a?(RPG::Skill)
if !@actor.skill_can_use?(item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.xas_skill_id = item.id
elsif item.is_a?(RPG::Weapon)
@actor.equip(0, item.id)
elsif item.is_a?(RPG::Armor)
@actor.equip(1, item.id)
elsif item.is_a?(RPG::Item)
item_tool_id = XAS::XASITEM_ID[item.id]
if item_tool_id != nil
unless $game_party.item_can_use?(item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.xas_item_id = item.id
end
end
$game_system.se_play($data_system.equip_se)
end

def update
@actor = $game_party.actors[0]
@hot_keys = $game_player.hud_equip
refresh
return if !$scene.is_a?(Scene_Map)
if Input.press?(Input::Numkey[1])
equip($game_player.hud_equip[0])
elsif Input.press?(Input::Numkey[2])
equip($game_player.hud_equip[1])
elsif Input.press?(Input::Numkey[3])
equip($game_player.hud_equip[2])
elsif Input.press?(Input::Numkey[4])
equip($game_player.hud_equip[3])
elsif Input.press?(Input::Numkey[5])
equip($game_player.hud_equip[4])
end
end
end

#===============================================================================
# Scene Map
#===============================================================================
class Scene_Map
alias hot_key_hud_init main
def main
@hot_key_hud = Hot_Key_HUD.new
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
hot_key_hud_init
@hot_key_hud.dispose
end

alias hot_key_hud_update update
def update
hot_key_hud_update
@hot_key_hud.update
@hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
@hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
end
end


Support


Post and problems you may encounter here, or suggestions for an update.

Known Compatibility Issues
None that i know of.

Restrictions
Do not post this any place with out my permission.

EVENTALIST
Show Signature
EVENTALIST
Tutorial Wizardmaster
Tutorial Wizardmaster
#2 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

calvin624

calvin624
Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
Hey Wiggles,

I tried hotkeying nothing and got the following error:

"Hotkey Line 255: NoMethodError occurred. undefined method 'icon_name' for nil:NilClass."

Just a head's up.

Amazing script though, works beautifully.
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
EVENTALIST
EVENTALIST
#3 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
yea, i did not try to hot key nothing... Razz

thanks for the heads up its a simple fix.

[edited script]
EVENTALIST
Show Signature
EVENTALIST
Tutorial Wizardmaster
Tutorial Wizardmaster
#4 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

calvin624

calvin624
Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
I figured it would be Smile

This is something many XAS game creators have longed for, they're going to love it!

It adds so much functionality and doesn't break up the game like the Quick Menu does (having to go in and select a bow and arrow every time you need it).

Great work!
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
EVENTALIST
EVENTALIST
#5 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
oh about your suggestion for using 6-0 as well for hot keys, the reason i made it (for right now) 1-5 is cause those keys are close to the action (A,S,D,Q,W), and i just thought that 6-0 where to much out of the way. (finger knots Razz )

but i can make a version that you can choose to use all 10 num keys if you wish, just that you'll have to edit the HUD gfx to account for the extra 5 icons.
EVENTALIST
Show Signature
EVENTALIST
Tutorial Wizardmaster
Tutorial Wizardmaster
#6 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

calvin624

calvin624
Tutorial Wizardmaster
Tutorial Wizardmaster
Tutorial Wizardmaster
profile
That's true, I never thought of that.

Don't just do it on my account, see if there is any more demand for 6-0 to be included. I'll see if I can fashion a HUD in keeping with the rest of XAS v3.7f.

Might be an idea to include the 'FADE' functionality - if there are future versions.
Tutorial Wizardmaster
Show Signature
Tutorial Wizardmaster
http://xasabs.com
EVENTALIST
EVENTALIST
#7 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
yea i will add the 'fade' function in, its not that hard of a function to add really, also i add in some other things, like disable the keys when XAS commands are disabled and make the HUD not visible when the disable XAS HUD switch is on.

so yea in the future there will be an update for some stuff i have left out and didn't think of until now. Rolling Eyes
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#8 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

unrivaledneo

unrivaledneo
Active Member
Active Member
Active Member
profile
I did run into a problem maybe it is just me. But this script doesnt allow sprints, and jumps. I tried moving around the script but not really much you can move it around. But I have it in the Addon-Section with the other scripts and I cant run or Jump... though maybe its just me. Great script BTW works great other than that.
Active Member
Show Signature
Active Member
EVENTALIST
EVENTALIST
#9 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
I'll look into it.
EVENTALIST
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
#10 XAS - Hot Keys Script Empty Re: XAS - Hot Keys Script
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
*new post to bump*

looked into it and i fixed the problem, and it wasn't you, it was an error on my part. its fixed now.
EVENTALIST
Show Signature
EVENTALIST

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 6]

Go to page : 1, 2, 3, 4, 5, 6  Next

 

Chatbox system disabled
Personal messaging disabled