*slaps head*
http://z3.invisionfree.com/ChaosProject/index.php?showtopic=378
Update the script
alright ill try
What is the line at 517 in the ABS?
Like, go into the Script Editor, find the line, and print it out. You *might* be using an outdated version of the ABS, but I'm not sure.
maybe your right, this is the line #517 i have:
return ([1, 16, -2].include?(@repeat_flags[key]))
it's in the middle of the def:
def Input.repeated?(key)
return ([1, 16, -2].include?(@repeat_flags[key]))
end
which is in the class:
class Static
# version of Blizz-ABS
VERSION = 1.001
# edition of Blizz-ABS
EDITION = "Normal"
#--------------------------------------------------------------------------
# event_comment
# Checks the events for comments.
#--------------------------------------------------------------------------
def self.event_comment(event, comment)
# return if list is not a data array
return false unless event.list.is_a?(Array)
# iterate through all commands
for command in event.list
# return true if command is comment and comment is equal the given one
return true if command.code == 108 and command.parameters[0] == comment
end
# else not found
return false
end
#--------------------------------------------------------------------------
# animations_size_down
# Sizes down all the animations to 50%.
#--------------------------------------------------------------------------
def self.animations_size_down
# iterate through all animations
for i in 1...$data_animations.size
# iterate through all frames
for frame in $data_animations[i].frames
# iterate through all cells
for j in 0...16
# if cell contains image
if frame.cell_data[j, 0] != nil and frame.cell_data[j, 0] != -1
# size down x position by half
frame.cell_data[j, 1] /= 2
# size down y position by half
frame.cell_data[j, 2] /= 2
# size down zoom by half
frame.cell_data[j, 3] /= 2
end
end
end
end
end
#--------------------------------------------------------------------------
# pixel
# Save method to retreive the pixel movement rate.
#--------------------------------------------------------------------------
def self.pixel
# return 1 if $game_system wasn't initialized yet
return 1 if $game_system == nil
# else return 2 power $game_system.pixel_rate
return 2 ** $game_system.pixel_rate
end
end
end
# ensures compatibility with plugins (aka test if Blizz-ABS is there)
$BlizzABS = true
#==============================================================================
# Enhanced module Input
#==============================================================================
module Input
#----------------------------------------------------------------------------
# Setup of Controls (ASCII)
#----------------------------------------------------------------------------
LMB = 1
RMB = 2
MMB = 4
Backspace = 8
Tab = 9
Enter = 13
Shift = 16
Ctrl = 17
Alt = 18
Esc = 27
D_Down = 40
D_Left = 37
D_Right = 39
D_Up = 38
Space = 32
NumKeys = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57]
NumPad = [45, 35, 40, 34, 37, 12, 39, 36, 38, 33]
Let = {'A' => 65, 'B' => 66, 'C' => 67, 'D' => 68, 'E' => 69, 'F' => 70,
'G' => 71, 'H' => 72, 'I' => 73, 'J' => 74, 'K' => 75, 'L' => 76,
'M' => 77, 'N' => 78, 'O' => 79, 'P' => 80, 'Q' => 81, 'R' => 82,
'S' => 83, 'T' => 84, 'U' => 85, 'V' => 86, 'W' => 87, 'X' => 88,
'Y' => 89, 'Z' => 90}
Fkeys = [-1, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123]
Collon = 186
Equal = 187
Comma = 188
Underscore = 189
Dot = 190
Backslash = 191
Lb = 219
Rb = 221
Quote = 222
# dll call
State = Win32API.new('user32','GetKeyState',['i'],'i')
Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
# All ASCII keys
All_keys = 0..255
@repeat_flags = []
256.times{@repeat_flags.push(-1)}
# Blizz-ABS control setup
if BlizzABS::Control::CUSTOM_CONTROL
@down = Let[BlizzABS::Control::DOWN]
@left = Let[BlizzABS::Control::LEFT]
@right = Let[BlizzABS::Control::RIGHT]
@up = Let[BlizzABS::Control::UP]
@attack = Let[BlizzABS::Control::ATTACK]
@defend = Let[BlizzABS::Control::DEFEND]
@skill = Let[BlizzABS::Control::SKILL]
@item = Let[BlizzABS::Control::ITEM]
@select = Let[BlizzABS::Control::SELECT]
@hud = Let[BlizzABS::Control::HUD_BUTTON]
@minimap = Let[BlizzABS::Control::MINIMAP_BUTTON]
@hotkey = Let[BlizzABS::Control::HOTKEY_BUTTON]
@run = Let[BlizzABS::Control::RUN]
@sneak = Let[BlizzABS::Control::SNEAK]
@jump = Let[BlizzABS::Control::JUMP]
@turn = Let[BlizzABS::Control::TURN]
# default controls
else
@down = D_Down
@left = D_Left
@right = D_Right
@up = D_Up
@attack = Let['F']
@defend = Let['G']
@skill = Let['D']
@item = Let['R']
@select = Let['L']
@hud = Let['H']
@minimap = Let['M']
@hotkey = Let['N']
@run = Let['Y']
@sneak = Let['X']
@jump = Let['C']
@turn = Let['Q']
end
#--------------------------------------------------------------------------
# attack
# Returns the assigned key for attack.
#--------------------------------------------------------------------------
def Input.attack
return @attack
end
#--------------------------------------------------------------------------
# defend
# Returns the assigned key for defend.
#--------------------------------------------------------------------------
def Input.defend
return @defend
end
#--------------------------------------------------------------------------
# skill
# Returns the assigned key for skill.
#--------------------------------------------------------------------------
def Input.skill
return @skill
end
#--------------------------------------------------------------------------
# item
# Returns the assigned key for item.
#--------------------------------------------------------------------------
def Input.item
return @item
end
#--------------------------------------------------------------------------
# select
# Returns the assigned key for select.
#--------------------------------------------------------------------------
def Input.select
return @select
end
#--------------------------------------------------------------------------
# hud
# Returns the assigned key for hud display.
#--------------------------------------------------------------------------
def Input.hud
return @hud
end
#--------------------------------------------------------------------------
# minimap
# Returns the assigned key for minimap display.
#--------------------------------------------------------------------------
def Input.minimap
return @minimap
end
#--------------------------------------------------------------------------
# hotkey
# Returns the assigned key for hotkey display.
#--------------------------------------------------------------------------
def Input.hotkey
return @hotkey
end
#--------------------------------------------------------------------------
# run
# Returns the assigned key for running.
#--------------------------------------------------------------------------
def Input.run
return @run
end
#--------------------------------------------------------------------------
# sneak
# Returns the assigned key for sneaking.
#--------------------------------------------------------------------------
def Input.sneak
return @sneak
end
#--------------------------------------------------------------------------
# jump
# Returns the assigned key for jumping.
#--------------------------------------------------------------------------
def Input.jump
return @jump
end
#--------------------------------------------------------------------------
# turn
# Returns the assigned key for turning around without moving.
#--------------------------------------------------------------------------
def Input.turn
return @turn
end
#--------------------------------------------------------------------------
# get_current_state
# key - the ASCII number of the key
# This method checks if the key is being pressed.
#--------------------------------------------------------------------------
def Input.get_current_state(key)
return State.call(key).between?(0, 1)
end
#--------------------------------------------------------------------------
# test_key
# key - the ASCII number of the key
# This method checks if the key was pressed.
#--------------------------------------------------------------------------
def Input.test_key(key)
Key.call(key) & 0x01 == 1
end
#--------------------------------------------------------------------------
# get_symbol
# sym - the given symbol
# Transforms given number into ASCII character.
#--------------------------------------------------------------------------
def Input.get_symbol(sym)
return "" if sym == 0
return (sym.chr) unless sym == nil
return ""
end
#--------------------------------------------------------------------------
# update
# Updates input.
#--------------------------------------------------------------------------
def Input.update
# storing old keys
@_keys = (@_keys == nil ? [] : @_keys) | (@keys == nil ? [] : @keys.clone)
# empty current keys
@keys = []
@pressed = []
# checking through all possible keys
for key in All_keys
# key is triggered if not triggered before
@keys.push(key) if Input.test_key(key) and not @_keys.include?(key)
if Input.get_current_state(key) # if key is not being hold
# remove from helping array
@_keys.delete(key)
# remove repeat? flag
@repeat_flags[key] = 0
else
# push into pressed array
@pressed.push(key)
# needed for repeat?
if @repeat_flags[key] > 0
if @repeat_flags[key] < 17
@repeat_flags[key] += 1
else
@repeat_flags[key] = -2
end
elsif @repeat_flags[key] < 0
if @repeat_flags[key] > -5
@repeat_flags[key] -= 1
else
@repeat_flags[key] = -2
end
else
@repeat_flags[key] = 1
end
end
end
end
#--------------------------------------------------------------------------
# triggered?
# Checks if a key was triggered once.
#--------------------------------------------------------------------------
def Input.triggered?(key)
return (@keys.include?(key) and not @_keys.include?(key))
end
#--------------------------------------------------------------------------
# pressed?
# Checks if a key is being pressed.
#--------------------------------------------------------------------------
def Input.pressed?(key)
return (@pressed.include?(key))
end
#--------------------------------------------------------------------------
# repeated?
# Check the special pressed state repeat?.
#--------------------------------------------------------------------------
def Input.repeated?(key)
return ([1, 16, -2].include?(@repeat_flags[key]))
end
#--------------------------------------------------------------------------
# dir4
# 4 direction check.
#--------------------------------------------------------------------------
def Input.dir4
return 2 if Input.pressed?(@down)
return 4 if Input.pressed?(@left)
return 6 if Input.pressed?(@right)
return 8 if Input.pressed?(@up)
return 0
end
#--------------------------------------------------------------------------
# dir8
# 8 direction check.
#--------------------------------------------------------------------------
def Input.dir8
return 1 if Input.pressed?(@down) and Input.pressed?(@left)
return 3 if Input.pressed?(@down) and Input.pressed?(@right)
return 7 if Input.pressed?(@up) and Input.pressed?(@left)
return 9 if Input.pressed?(@up) and Input.pressed?(@right)
return 2 if Input.pressed?(@down)
return 4 if Input.pressed?(@left)
return 6 if Input.pressed?(@right)
return 8 if Input.pressed?(@up)
return 0
end
#--------------------------------------------------------------------------
# trigger?
# Original method to test if key was triggered once.
#--------------------------------------------------------------------------
def Input.trigger?(key)
for k in Input.check_old_keys(key)
return true if Input.triggered?(k)
end
return false
end
#--------------------------------------------------------------------------
# press?
# Original method to test if key is being pressed.
#--------------------------------------------------------------------------
def Input.press?(key)
for k in Input.check_old_keys(key)
return true if Input.pressed?(k)
end
return false
end
#--------------------------------------------------------------------------
# repeat?
# Original method to test if key is being pressed a special way.
#--------------------------------------------------------------------------
def Input.repeat?(key)
for k in Input.check_old_keys(key)
return true if Input.repeated?(k)
end
return false
end
#--------------------------------------------------------------------------
# check_old_keys
# Converts all the old keys into the new format
#--------------------------------------------------------------------------
def Input.check_old_keys(key)
case key
when DOWN then return [@down]
when UP then return [@up]
when LEFT then return [@left]
when RIGHT then return [@right]
when A then return [Shift]
when B then return [Esc, NumPad[0]]
when C then return [Space, Enter]
when X then return [Let['A']]
when Y then return [Let['S']]
when Z then return [Let['D']]
when L then return [Let['Q']]
when R then return [Let['W']]
when F5 then return [Fkeys[5]]
when F6 then return [Fkeys[6]]
when F7 then return [Fkeys[7]]
when F8 then return [Fkeys[8]]
when F9 then return [Fkeys[9]]
when SHIFT then return [Shift]
when CTRL then return [Ctrl]
when ALT then return [Alt]
end
return [key]
end
#--------------------------------------------------------------------------
# Anykey
# Checks if ANY key was pressed.
#--------------------------------------------------------------------------
def Input.Anykey
return (@keys != [])
end
end