Project1
标题:
求强人修改快捷键。
[打印本页]
作者:
肖宋发
时间:
2009-8-6 14:11
标题:
求强人修改快捷键。
使用了快捷键脚本后怎么再添加其他快捷键啊?(比如按钮M时启动公共事件1啊??)
#==============================================================================
# ■ 本脚本源自www.66rpg.com,转载与使用请保留此信息
#==============================================================================
#==============================================================================
# 菜单快捷键 by Claimh
#------------------------------------------------------------------------------
# http://www.k3.dion.ne.jp/~claimh/
#==============================================================================
module SHORTCUT
USE_ITEM_SHORT = true #——开启物品菜单快捷键
USE_SKILL_SHORT = true #——开启特技菜单快捷键
USE_EQUIP_SHORT = true #——开启装备菜单快捷键
USE_SAVE_SHORT = true #——开启储存菜单快捷键
CHANGE_ITEM = Input::X #——物品快捷键的键位
CHANGE_SKILL = Input::Y #——特技快捷键的键位
CHANGE_EQUIP = Input::Z #——装备快捷键的键位
CHANGE_SAVE = Input::A #——储存快捷键的键位
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
end
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
include SHORTCUT
alias update_short update
def update
update_short
menu_shortcut
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def menu_shortcut
if Input.trigger?(CHANGE_ITEM) and USE_ITEM_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$item_short = true
call_item
end
end
if Input.trigger?(CHANGE_SKILL) and USE_SKILL_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$skill_short = true
call_skill
end
end
if Input.trigger?(CHANGE_EQUIP) and USE_EQUIP_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$equip_short = true
call_equip
end
end
if Input.trigger?(CHANGE_SAVE) and USE_SAVE_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$save_short = true
call_save
end
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_item
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Item.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_skill
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Skill.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_equip
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Equip.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_save
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Save.new
end
end
#==============================================================================
# Scene_Item
#==============================================================================
class Scene_Item
alias update_item_short update_item
def update_item
if Input.trigger?(Input::B) and $item_short
$item_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_item_short
end
end
#==============================================================================
# Scene_Skill
#==============================================================================
class Scene_Skill
alias update_skill_short update_skill
def update_skill
if Input.trigger?(Input::B) and $skill_short
$skill_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_skill_short
end
end
#==============================================================================
# Scene_Equip
#==============================================================================
class Scene_Equip
alias update_equip_short update_right
def update_right
if Input.trigger?(Input::B) and $equip_short
$equip_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_equip_short
end
end
#==============================================================================
# Scene_Save
#==============================================================================
class Scene_Save
alias update_save_short on_cancel
def on_cancel
if $save_short
$save_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_save_short
end
alias save_decision on_decision
def on_decision(filename)
if $save_short
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
$save_short
$scene = Scene_Map.new
end
save_decision
end
end
复制代码
作者:
「旅」
时间:
2009-8-6 14:29
#==============================================================================
# ■ 本脚本源自www.66rpg.com,转载与使用请保留此信息
#==============================================================================
#==============================================================================
# 菜单快捷键 by Claimh
#------------------------------------------------------------------------------
# http://www.k3.dion.ne.jp/~claimh/
#==============================================================================
module SHORTCUT
USE_ITEM_SHORT = true #——开启物品菜单快捷键
USE_SKILL_SHORT = true #——开启特技菜单快捷键
USE_EQUIP_SHORT = true #——开启装备菜单快捷键
USE_SAVE_SHORT = true #——开启储存菜单快捷键
CHANGE_ITEM = Input::X #——物品快捷键的键位
CHANGE_SKILL = Input::Y #——特技快捷键的键位
CHANGE_EQUIP = Input::Z #——装备快捷键的键位
CHANGE_SAVE = Input::A #——储存快捷键的键位
CHANGE_EVENT = 0x4D #——调用公共事件
EVENT_ID = 1 #——事件编号
USE_EVENT_SHORT = true #——开启事件快捷键
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
end
module Kboard
module_function
@R_Key_Hash = {}
@R_Key_Repeat = {}
GetKeyState = Win32API.new("user32","GetAsyncKeyState",['I'],'I')
def press?(rkey)
return GetKeyState.call(rkey) != 0
end
def repeat?(rkey)
result = GetKeyState.call(rkey)
if result != 0
if @R_Key_Repeat[rkey].nil?
@R_Key_Repeat[rkey] = 0
return true
end
@R_Key_Repeat[rkey] += 1
else
@R_Key_Repeat[rkey] = nil
@R_Key_Hash[rkey] = 0
end
if !@R_Key_Repeat[rkey].nil? and @R_Key_Repeat[rkey] > 4 # 4乃准确数字
@R_Key_Repeat[rkey] = 0
return true
else
return false
end
end
def trigger?(rkey)
result = GetKeyState.call(rkey)
if @R_Key_Hash[rkey] == 1 and result != 0
return false
end
if result != 0
@R_Key_Hash[rkey] = 1
return true
else
@R_Key_Hash[rkey] = 0
return false
end
end
end
#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
include SHORTCUT
alias update_short update
def update
update_short
menu_shortcut
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def menu_shortcut
if Input.trigger?(CHANGE_ITEM) and USE_ITEM_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$item_short = true
call_item
end
end
if Input.trigger?(CHANGE_SKILL) and USE_SKILL_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$skill_short = true
call_skill
end
end
if Input.trigger?(CHANGE_EQUIP) and USE_EQUIP_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$equip_short = true
call_equip
end
end
if Input.trigger?(CHANGE_SAVE) and USE_SAVE_SHORT
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
$save_short = true
call_save
end
end
if Kboard.trigger?(CHANGE_EVENT) and USE_EVENT_SHORT
$game_temp.common_event_id = EVENT_ID
end
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_item
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Item.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_skill
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Skill.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_equip
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Equip.new
end
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def call_save
$game_temp.menu_calling = false
if $game_temp.menu_beep
$game_system.se_play($data_system.decision_se)
$game_temp.menu_beep = false
end
$game_player.straighten
$scene = Scene_Save.new
end
end
#==============================================================================
# Scene_Item
#==============================================================================
class Scene_Item
alias update_item_short update_item
def update_item
if Input.trigger?(Input::B) and $item_short
$item_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_item_short
end
end
#==============================================================================
# Scene_Skill
#==============================================================================
class Scene_Skill
alias update_skill_short update_skill
def update_skill
if Input.trigger?(Input::B) and $skill_short
$skill_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_skill_short
end
end
#==============================================================================
# Scene_Equip
#==============================================================================
class Scene_Equip
alias update_equip_short update_right
def update_right
if Input.trigger?(Input::B) and $equip_short
$equip_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_equip_short
end
end
#==============================================================================
# Scene_Save
#==============================================================================
class Scene_Save
alias update_save_short on_cancel
def on_cancel
if $save_short
$save_short = false
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
update_save_short
end
alias save_decision on_decision
def on_decision(filename)
if $save_short
$game_system.se_play($data_system.save_se)
file = File.open(filename, "wb")
write_save_data(file)
file.close
$save_short
$scene = Scene_Map.new
end
save_decision
end
end
复制代码
需要改键可以PM我~
作者:
肖宋发
时间:
2009-8-6 15:13
按什么键启动啊??你干脆帮我制作成工程好了!!!(按钮下Q时启动1好共事件,按钮下W时启动2好共事件,按钮下E时启动3好共事件,按钮下R时启动3好共事件)
作者:
「旅」
时间:
2009-8-6 15:40
本帖最后由 「旅」 于 2009-8-6 22:23 编辑
Project24.rar
(187.63 KB, 下载次数: 101)
2009-8-6 15:40 上传
点击文件名下载附件
完成。
ps:楼主如果认可答案,请到
http://rpg.blue/viewthread.php?tid=130319
认可
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1