[XP] Blizz-ABS

Started by Blizzard, January 09, 2008, 08:21:56 am

Previous topic - Next topic

Blizzard

Yes, this is also done with the weapon and enemy attack animations.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

whitespirits

May 21, 2014, 05:42:08 am #5201 Last Edit: May 21, 2014, 06:04:54 am by whitespirits
Thanks Blizz, I have a small request, in terms of a graphics change in game, i need to assign a graphics change to another key for example if i press 'V' similar to skills, attack, def etc i would like abs to look for 'spritename_trans' for transform? how easy could some 1 piece this together? also would it be possible to add a 5 minute timer and a 20% stat increase for the period?

Blizzard

Just make the appropriate spritesets as if it was another actor. When you change the spriteset of a character, he will use all other sprites as well.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Xero1227

hey guys im somewhat new to rpg maker xp  but not a total noob. i wanted to make a dragonball z type game with the blizz abs system. im having trouble figuruing out how to make my character in my game tranform into super saiyan? should i make a skill for it to happen? i saw someone on yourtube do it and when he used the skill he made called supersaiyan it recovered half of his hp and mana and changed his character graphic and also changed him back to a regular saiyan after a certain period of time? any help on how i can make this happen would be awesome thanks

KK20

Have a Common Event running on a parallel process that checks if the actor is applied with a "Super Saiyan" state. If yes, change the actor's graphic to SS graphic. Otherwise, change to normal graphic. The skill should apply the state to the User.

Maybe you should get in touch with whitespirits since he's making a DB game too.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

whitespirits

Would love some help :)

Zexion

Okay, I found a smallish bug with playing animations on death. Which is wierd because I've used it in past versions.
it's with the:
self.destruct(id)

Mine is set up to play an animation for certain enemies, but when I kill them it ends up showing me this error:
Spoiler: ShowHide

Edit:
Forgot to mention. The animation definately exists, and it doesn't matter what number i put, it always shows the same error unless it is 0.

whitespirits

ok so Zexion and myself reverted back to version 2.03 and tested when all stuff was working just laggy

and this error returns during zexion attacking while iwatch

Spoiler: ShowHide

Moshan

June 11, 2014, 12:58:44 pm #5208 Last Edit: June 11, 2014, 01:06:03 pm by adytza001
 Hello!

I'm not sure if this is a bug...but for me it's something very annoying that I can't get rid of it.

Firstly it happens only with the 2.85+ versions of Blizz-ABS but I can't switch my project to 2.84 because it's not compatible with Custom Resolution.

So...I noticed that when using DIRECT HOTKEYS and I have two or more hotkeys assigned next to each other (consecutively) if I press one of the Arrow Keys it plays an annoying sound like skill not usable or something like that. I've seen that it happens only with the Down Arrow Key when you have two hotkeys assigned consecutively, but when I assign more than 4-5 it happens with every single arrow key. A strange thing is that this issue happens only if you have hotkeys assigned consecutively (if I have skills assigned on hotkeys:2-4-7-9 it won't play the sound).

Is there a way to fix this (or get rid of it), or it's just a part of the battle system?

Here's a link with the project "configured" : https://www.mediafire.com/?9d41izv5htg7ttg

Thanks in advance!

Soulshaker3

June 11, 2014, 01:39:28 pm #5209 Last Edit: June 11, 2014, 01:42:42 pm by soulshaker3
Quote from: adytza001 on June 11, 2014, 12:58:44 pm
Hello!

I'm not sure if this is a bug...but for me it's something very annoying that I can't get rid of it.

Firstly it happens only with the 2.85+ versions of Blizz-ABS but I can't switch my project to 2.84 because it's not compatible with Custom Resolution.

So...I noticed that when using DIRECT HOTKEYS and I have two or more hotkeys assigned next to each other (consecutively) if I press one of the Arrow Keys it plays an annoying sound like skill not usable or something like that. I've seen that it happens only with the Down Arrow Key when you have two hotkeys assigned consecutively, but when I assign more than 4-5 it happens with every single arrow key. A strange thing is that this issue happens only if you have hotkeys assigned consecutively (if I have skills assigned on hotkeys:2-4-7-9 it won't play the sound).

Is there a way to fix this (or get rid of it), or it's just a part of the battle system?

Here's a link with the project "configured" : https://www.mediafire.com/?9d41izv5htg7ttg

Thanks in advance!


That has already been said in this exact thread with the blizz abs 2.85+ the arrow keys have the same exact ASCII value as the 2,4,6,8 on the numpad in blizz abs, the fixes for that is either you downgrade to 2.83, and take out custom resolution or use the WASD keys for movement instead.

Edit : Exactly here: http://forum.chaos-project.com/index.php/topic,106.msg179382/topicseen.html#msg179382
Hellow?

Moshan

 Thanks for reply!

Oh...this is very frustrating but at least I expected the WSAD movement.
Sorry for asking this again I used quick search but looks like I didnt do it right.

I appreciate your help!

Sylphe

Hello ! It's me again !
I try to make a VERY 'complexificated' combo in the Blizz-ABS Config last version
and I need to do a condition with a script : if $char = 'hello' then GOTO ACTION 5 else GOTO ACTION 6
But in the combo condition window, there are two text areas.
I wonder if I have to do like this :
Value 1
   Type = script
    Value = $bool
Value2
   Type = script
   Value ='hello'

OR

Value 1
   Type = script
    Value = $bool == 'hello'
Value2
   Type = Idunno
   Value = ... blank space

OR anything else ?

blindly follow his heart can lead to the loss

Sylphe, descendant of Zoldik Family.
Quote from: TedBearTRY KEEP UP

winkio

the first way should work.  You can also do it the second way, but you have to put (true) with no parenthesis in the second value box

Sylphe

blindly follow his heart can lead to the loss

Sylphe, descendant of Zoldik Family.
Quote from: TedBearTRY KEEP UP

Epherex

Hey there!
I wonder if I can, instead of using separate sprites for a character attacking, I could just set so the icon of the weapon appears moving above the character sprite when I attack.
There are other systems that do this, but I want this for Blizz-ABS. I suck at pixel art, so this would help me a lot.

legacyblade

Hello! Wow, Blizz-ABS has changed a decent amount since I last used it. The combo system is now in the config o.o

So I have a few questions about how to achieve some things with the combo system.


  • A "counter" skill. How would I go about creating a skill that has the actor hold a pose for a certain amount of time, and if hit with any attack during this time they will not receive damage. Instead, they will launch an attack in the direction the damage came from.

  • A "dash attack" skill. I wish to have a character dash forward (at top speed about 6 squares). If they collide with an enemy during this dash, they will stop and attack three times in quick succession

  • I want an enemy to spawn a projectile where the player is standing. After about a second, said projectile goes through an exploding animation (during which point it can damage the player)[\li]


I'd also like to know what the convention for having the actor do different attacks when attacking in quick succession. For example, if the main character taps the attack button three times, he will do two quick slashes, then a stab. The slashes should have the sword damage type. The stab should have the spear damage type. If they just tap two times, however, they will do two quick slashes before receiving the cooldown frames. Tapping once should results in just one slash.

Sorry if that last one is an obvious question. The combo system is still a bit of a mystery to me :/

winkio

Those three bullet points are going to require some script calls because everything you want to do is beyond the scope of the basic functions, but they are all possible.  As for the last one, I have some examples in this config from CoSLaL that I used to play around with: https://drive.google.com/file/d/0B-gvBNVSPC2xUHNNd3NpVFdtTnc/edit?usp=sharing

legacyblade

June 23, 2014, 08:39:23 pm #5217 Last Edit: June 24, 2014, 01:50:04 am by legacyblade
Alright, thanks for the config! I'll take a look at it.

As for the script calls, is there a script call that can check when an actor would be damaged? I'm planning on applying an immortality state to the actor while the counter is in progress. So that would take care of making the attack not damage the character. I just need a way to see if any "offensive collisions" (to borrow a term from a super smash brawl move editor) have interacted with the actor.

-edit, I found a bug btw. If you have enemy health bars enabled, the health bar will jump to the top left corner of the screen when the enemy dies. (at least when you don't have enemy action, idle, or charge sprites enabled. I haven't made such sprites for my enemies yet) Nothing huge, it's just kinda annoying :P

legacyblade

June 24, 2014, 07:54:23 pm #5218 Last Edit: June 24, 2014, 08:39:31 pm by legacyblade
(I think it's been twenty four hours o.o)

Hey, I'm working with the combo system I've got a question, as well as what I think is a bug.

First off is the question.

Most of the skills in my game are just a fancy way for the characters to use their weapon. When setting a combo, I can set the Sprite and Extension. However, how can I add a weapon to said combo? (for example, I want the player to use the skl_10 graphic when using a skill. I'd also like to use skl_10_wpn_1 overlaid on top of it)

Also, the thing I assume was a bug was the issue getting a random value into the script. I have a attacks a random number of times in quick succession. The only way to get the script to treat the random number generated by the rand function is to use a script call to assign a random value to a game variable ($game_variables[27] = rand(18)), then checking the game variable in a condition. I feel that I should be able to do the following instead

Condition: Script Variable rand(18) == Constant Variable 17

or at least assign a combo variable a random value in this manner

Variable: Combo Variable 1 = Script Variable rand(18)

(before you ask, yes I'm using the config program to make my combos, lol)

-edit

also, when a skill uses a combo, it doesn't seem to actually cost the required SP

Moshan

 Hello!

I think I've managed to get rid of this:

Quote from: adytza001 on June 11, 2014, 12:58:44 pm
Hello!

I'm not sure if this is a bug...but for me it's something very annoying that I can't get rid of it.

Firstly it happens only with the 2.85+ versions of Blizz-ABS but I can't switch my project to 2.84 because it's not compatible with Custom Resolution.

So...I noticed that when using DIRECT HOTKEYS and I have two or more hotkeys assigned next to each other (consecutively) if I press one of the Arrow Keys it plays an annoying sound like skill not usable or something like that. I've seen that it happens only with the Down Arrow Key when you have two hotkeys assigned consecutively, but when I assign more than 4-5 it happens with every single arrow key. A strange thing is that this issue happens only if you have hotkeys assigned consecutively (if I have skills assigned on hotkeys:2-4-7-9 it won't play the sound).


  Now I can use the Arrow keys to move without having that hotkey sound. I've just replaced this (from 2.84):
Spoiler: ShowHide
#==============================================================================
# module Input
#==============================================================================

module Input
 
  #----------------------------------------------------------------------------
  # Simple ASCII table
  #----------------------------------------------------------------------------
  Key = {'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,
         '0' => 48, '1' => 49, '2' => 50, '3' => 51, '4' => 52, '5' => 53,
         '6' => 54, '7' => 55, '8' => 56, '9' => 57,
         'NumberPad 0' => 45, 'NumberPad 1' => 35, 'NumberPad 2' => 40,
         'NumberPad 3' => 34, 'NumberPad 4' => 37, 'NumberPad 5' => 12,
         'NumberPad 6' => 39, 'NumberPad 7' => 36, 'NumberPad 8' => 38,
         'NumberPad 9' => 33,
         'F1' => 112, 'F2' => 113, 'F3' => 114, 'F4' => 115, 'F5' => 116,
         'F6' => 117, 'F7' => 118, 'F8' => 119, 'F9' => 120, 'F10' => 121,
         'F11' => 122, 'F12' => 123,
         ';' => 186, '=' => 187, ',' => 188, '-' => 189, '.' => 190, '/' => 220,
         '\\' => 191, '\'' => 222, '[' => 219, ']' => 221, '`' => 192,
         'Backspace' => 8, 'Tab' => 9, 'Enter' => 13, 'Shift' => 16,
         'Left Shift' => 160, 'Right Shift' => 161, 'Left Ctrl' => 162,
         'Right Ctrl' => 163, 'Left Alt' => 164, 'Right Alt' => 165,
         'Ctrl' => 17, 'Alt' => 18, 'Esc' => 27, 'Space' => 32, 'Page Up' => 33,
         'Page Down' => 34, 'End' => 35, 'Home' => 36, 'Insert' => 45,
         'Delete' => 46, 'Arrow Left' => 37, 'Arrow Up' => 38,
         'Arrow Right' => 39, 'Arrow Down' => 40,
         'Mouse Left' => 1, 'Mouse Right' => 2, 'Mouse Middle' => 4,
         'Mouse 4' => 5, 'Mouse 5' => 6}
  # default button configuration
  UP = [Key['Arrow Up']]
  LEFT = [Key['Arrow Left']]
  DOWN = [Key['Arrow Down']]
  RIGHT = [Key['Arrow Right']]
  A = [Key['Shift']]
  B = [Key['Esc'], Key['NumberPad 0'], Key['X']]
  C = [Key['Space'], Key['Enter'], Key['C']]
  X = [Key['A']]
  Y = [Key['S']]
  Z = [Key['D']]
  L = [Key['Q'], Key['Page Down']]
  R = [Key['W'], Key['Page Up']]
  F5 = [Key['F5']]
  F6 = [Key['F6']]
  F7 = [Key['F7']]
  F8 = [Key['F8']]
  F9 = [Key['F9']]
  SHIFT = [Key['Shift']]
  CTRL = [Key['Ctrl']]
  ALT = [Key['Alt']]
  # All keys
  ALL_KEYS = (0...256).to_a
  # Win32 API calls
  GetKeyboardState = Win32API.new('user32','GetKeyboardState', 'P', 'I')
  GetKeyboardLayout = Win32API.new('user32', 'GetKeyboardLayout','L', 'L')
  MapVirtualKeyEx = Win32API.new('user32', 'MapVirtualKeyEx', 'IIL', 'I')
  ToUnicodeEx = Win32API.new('user32', 'ToUnicodeEx', 'LLPPILL', 'L')
  # some other constants
  DOWN_STATE_MASK = 0x80
  DEAD_KEY_MASK = 0x80000000
  # data
  @state = "\0" * 256
  @triggered = Array.new(256, false)
  @pressed = Array.new(256, false)
  @released = Array.new(256, false)
  @repeated = Array.new(256, 0)
  #----------------------------------------------------------------------------
  # update
  #  Updates input.
  #----------------------------------------------------------------------------
  def self.update
    # get current language layout
    @language_layout = GetKeyboardLayout.call(0)
    # get new keyboard state
    GetKeyboardState.call(@state)
    # for each key
    ALL_KEYS.each {|key|
        # if pressed state
        if @state[key] & DOWN_STATE_MASK == DOWN_STATE_MASK
          # not released anymore
          @released[key] = false
          # if not pressed yet
          if !@pressed[key]
            # pressed and triggered
            @pressed[key] = true
            @triggered[key] = true
          else
            # not triggered anymore
            @triggered[key] = false
          end
          # update of repeat counter
          @repeated[key] < 17 ? @repeated[key] += 1 : @repeated[key] = 15
        # not released yet
        elsif !@released[key]
          # if still pressed
          if @pressed[key]
            # not triggered, pressed or repeated, but released
            @triggered[key] = false
            @pressed[key] = false
            @repeated[key] = 0
            @released[key] = true
          end
        else
          # not released anymore
          @released[key] = false
        end}
  end
  #----------------------------------------------------------------------------
  # dir4
  #  4 direction check.
  #----------------------------------------------------------------------------
  def Input.dir4
    return 2 if Input.press?(DOWN)
    return 4 if Input.press?(LEFT)
    return 6 if Input.press?(RIGHT)
    return 8 if Input.press?(UP)
    return 0
  end
  #----------------------------------------------------------------------------
  # dir8
  #  8 direction check.
  #----------------------------------------------------------------------------
  def Input.dir8
    down = Input.press?(DOWN)
    left = Input.press?(LEFT)
    return 1 if down && left
    right = Input.press?(RIGHT)
    return 3 if down && right
    up = Input.press?(UP)
    return 7 if up && left
    return 9 if up && right
    return 2 if down
    return 4 if left
    return 6 if right
    return 8 if up
    return 0
  end
  #----------------------------------------------------------------------------
  # trigger?
  #  Test if key was triggered once.
  #----------------------------------------------------------------------------
  def Input.trigger?(keys)
    keys = [keys] unless keys.is_a?(Array)
    return keys.any? {|key| @triggered[key]}
  end
  #----------------------------------------------------------------------------
  # press?
  #  Test if key is being pressed.
  #----------------------------------------------------------------------------
  def Input.press?(keys)
    keys = [keys] unless keys.is_a?(Array)
    return keys.any? {|key| @pressed[key]}
  end
  #----------------------------------------------------------------------------
  # repeat?
  #  Test if key is being pressed for repeating.
  #----------------------------------------------------------------------------
  def Input.repeat?(keys)
    keys = [keys] unless keys.is_a?(Array)
    return keys.any? {|key| @repeated[key] == 1 || @repeated[key] == 16}
  end
  #----------------------------------------------------------------------------
  # release?
  #  Test if key was released.
  #----------------------------------------------------------------------------
  def Input.release?(keys)
    keys = [keys] unless keys.is_a?(Array)
    return keys.any? {|key| @released[key]}
  end
  #----------------------------------------------------------------------------
  # get_character
  #  vk - virtual key
  #  Gets the character from keyboard input using the input locale identifier
  #  (formerly called keyboard layout handles).
  #----------------------------------------------------------------------------
  def self.get_character(vk)
    # get corresponding character from virtual key
    c = MapVirtualKeyEx.call(vk, 2, @language_layout)
    # stop if character is non-printable and not a dead key
    return '' if c < 32 && (c & DEAD_KEY_MASK != DEAD_KEY_MASK)
    # get scan code
    vsc = MapVirtualKeyEx.call(vk, 0, @language_layout)
    # result string is never longer than 2 bytes (Unicode)
    result = "\0" * 2
    # get input string from Win32 API
    length = ToUnicodeEx.call(vk, vsc, @state, result, 2, 0, @language_layout)
    return (length == 0 ? '' : result)
  end
  #----------------------------------------------------------------------------
  # get_input_string
  #  Gets the string that was entered using the keyboard over the input locale
  #  identifier (formerly called keyboard layout handles).
  #----------------------------------------------------------------------------
  def self.get_input_string
    result = ''
    # check every key
    ALL_KEYS.each {|key|
        # if repeated
        if self.repeat?(key)
          # get character from keyboard state
          c = self.get_character(key)
          # add character if there is a character
          result += c if c != ''
        end}
    # empty if result is empty
    return '' if result == ''
    # convert string from Unicode to UTF-8
    return self.unicode_to_utf8(result)
  end
  #----------------------------------------------------------------------------
  # get_input_string
  #  string - string in Unicode format
  #  Converts a string from Unicode format to UTF-8 format as RGSS does not
  #  support Unicode.
  #----------------------------------------------------------------------------
  def self.unicode_to_utf8(string)
    result = ''
    string.unpack('S*').each {|c|
        # characters under 0x80 are 1 byte characters
        if c < 0x0080
          result += c.chr
        # other characters under 0x800 are 2 byte characters
        elsif c < 0x0800
          result += (0xC0 | (c >> 6)).chr
          result += (0x80 | (c & 0x3F)).chr
        # the rest are 3 byte characters
        else
          result += (0xE0 | (c >> 12)).chr
          result += (0x80 | ((c >> 12) & 0x3F)).chr
          result += (0x80 | (c & 0x3F)).chr
        end}
    return result
  end
 
end


with this piece of code from 2.85 (or 2.86)

Spoiler: ShowHide
#==============================================================================
# module Input
#==============================================================================

module Input
 
  #----------------------------------------------------------------------------
  # Simple ASCII table
  #----------------------------------------------------------------------------
  Key = {'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,
         '0' => 48, '1' => 49, '2' => 50, '3' => 51, '4' => 52, '5' => 53,
         '6' => 54, '7' => 55, '8' => 56, '9' => 57,
         'NumberPad 0' => 45, 'NumberPad 1' => 35, 'NumberPad 2' => 40,
         'NumberPad 3' => 34, 'NumberPad 4' => 37, 'NumberPad 5' => 12,
         'NumberPad 6' => 39, 'NumberPad 7' => 36, 'NumberPad 8' => 38,
         'NumberPad 9' => 33,
         'F1' => 112, 'F2' => 113, 'F3' => 114, 'F4' => 115, 'F5' => 116,
         'F6' => 117, 'F7' => 118, 'F8' => 119, 'F9' => 120, 'F10' => 121,
         'F11' => 122, 'F12' => 123,
         ';' => 186, '=' => 187, ',' => 188, '-' => 189, '.' => 190, '/' => 220,
         '\\' => 191, '\'' => 222, '[' => 219, ']' => 221, '`' => 192,
         'Backspace' => 8, 'Tab' => 9, 'Enter' => 13, 'Shift' => 16,
         'Left Shift' => 160, 'Right Shift' => 161, 'Left Ctrl' => 162,
         'Right Ctrl' => 163, 'Left Alt' => 164, 'Right Alt' => 165,
         'Ctrl' => 17, 'Alt' => 18, 'Esc' => 27, 'Space' => 32, 'Page Up' => 33,
         'Page Down' => 34, 'End' => 35, 'Home' => 36, 'Insert' => 45,
         'Delete' => 46, 'Arrow Left' => 37, 'Arrow Up' => 38,
         'Arrow Right' => 39, 'Arrow Down' => 40,
         'Mouse Left' => 1, 'Mouse Right' => 2, 'Mouse Middle' => 4,
         'Mouse 4' => 5, 'Mouse 5' => 6}
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  UP = [Key['Arrow Up']]
  LEFT = [Key['Arrow Left']]
  DOWN = [Key['Arrow Down']]
  RIGHT = [Key['Arrow Right']]
  A = [Key['Shift']]
  B = [Key['Esc']]
  C = [Key['Enter']]
  X = []
  Y = []
  Z = []
  L = [Key['Page Down']]
  R = [Key['Page Up']]
  F5 = [Key['F5']]
  F6 = [Key['F6']]
  F7 = [Key['F7']]
  F8 = [Key['F8']]
  F9 = [Key['F9']]
  SHIFT = [Key['Shift']]
  CTRL = [Key['Ctrl']]
  ALT = [Key['Alt']]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  # All keys
  KEY_COUNT = 256
  ALL_KEYS = (0...KEY_COUNT).to_a
  # Win32 API calls
  GetKeyboardState = Win32API.new('user32', 'GetKeyboardState', 'P', 'I')
  GetKeyboardLayout = Win32API.new('user32', 'GetKeyboardLayout', 'L', 'L')
  MapVirtualKeyEx = Win32API.new('user32', 'MapVirtualKeyEx', 'IIL', 'I')
  ToUnicodeEx = Win32API.new('user32', 'ToUnicodeEx', 'LLPPILL', 'L')
  # some other constants
  DOWN_STATE_MASK = 0x80
  DEAD_KEY_MASK = 0x80000000
  # data
  @state = "\0" * KEY_COUNT
  @triggered = Array.new(KEY_COUNT, false)
  @pressed = Array.new(KEY_COUNT, false)
  @released = Array.new(KEY_COUNT, false)
  @repeatedKey = -1
  @repeatedCount = 0
  #----------------------------------------------------------------------------
  # update
  #  Updates input.
  #----------------------------------------------------------------------------
  def self.update
    # get current language layout
    @language_layout = GetKeyboardLayout.call(0)
    # get new keyboard state
    GetKeyboardState.call(@state)
    # this special code is used because Ruby 1.9.x does not return a char
    # when using String#[] but another String
    key = 0
    @state.each_byte {|byte|
        # if pressed state
        if (byte & DOWN_STATE_MASK) == DOWN_STATE_MASK
          # not released anymore
          @released[key] = false
          # if not pressed yet
          if !@pressed[key]
            # pressed and triggered
            @pressed[key] = true
            @triggered[key] = true
            @repeatedKey = key
            @repeatedCount = 0
          else
            # not triggered anymore
            @triggered[key] = false
          end
          # update of repeat counter
          if key == @repeatedKey
            @repeatedCount < 17 ? @repeatedCount += 1 : @repeatedCount = 15
          end
        # not released yet
        elsif !@released[key]
          # if still pressed
          if @pressed[key]
            # not triggered, pressed or repeated, but released
            @triggered[key] = false
            @pressed[key] = false
            @released[key] = true
            if key == @repeatedKey
              @repeatedKey = -1
              @repeatedCount = 0
            end
          end
        else
          # not released anymore
          @released[key] = false
        end
        key += 1}
  end
  #----------------------------------------------------------------------------
  # dir4
  #  4 direction check.
  #----------------------------------------------------------------------------
  def self.dir4
    return 2 if self.press?(DOWN)
    return 4 if self.press?(LEFT)
    return 6 if self.press?(RIGHT)
    return 8 if self.press?(UP)
    return 0
  end
  #----------------------------------------------------------------------------
  # dir8
  #  8 direction check.
  #----------------------------------------------------------------------------
  def self.dir8
    down = self.press?(DOWN)
    left = self.press?(LEFT)
    return 1 if down && left
    right = self.press?(RIGHT)
    return 3 if down && right
    up = self.press?(UP)
    return 7 if up && left
    return 9 if up && right
    return 2 if down
    return 4 if left
    return 6 if right
    return 8 if up
    return 0
  end
  #----------------------------------------------------------------------------
  # trigger?
  #  Test if key was triggered once.
  #----------------------------------------------------------------------------
  def self.trigger?(keys)
    keys = [keys] if !keys.is_a?(Array)
    return keys.any? {|key| @triggered[key]}
  end
  #----------------------------------------------------------------------------
  # press?
  #  Test if key is being pressed.
  #----------------------------------------------------------------------------
  def self.press?(keys)
    keys = [keys] if !keys.is_a?(Array)
    return keys.any? {|key| @pressed[key]}
  end
  #----------------------------------------------------------------------------
  # repeat?
  #  Test if key is being pressed for repeating.
  #----------------------------------------------------------------------------
  def self.repeat?(keys)
    keys = [keys] if !keys.is_a?(Array)
    return (@repeatedKey >= 0 && keys.include?(@repeatedKey) &&
        (@repeatedCount == 1 || @repeatedCount == 16))
  end
  #----------------------------------------------------------------------------
  # release?
  #  Test if key was released.
  #----------------------------------------------------------------------------
  def self.release?(keys)
    keys = [keys] if !keys.is_a?(Array)
    return keys.any? {|key| @released[key]}
  end
  #----------------------------------------------------------------------------
  # get_character
  #  vk - virtual key
  #  Gets the character from keyboard input using the input locale identifier
  #  (formerly called keyboard layout handles).
  #----------------------------------------------------------------------------
  def self.get_character(vk)
    # get corresponding character from virtual key
    c = MapVirtualKeyEx.call(vk, 2, @language_layout)
    # stop if character is non-printable and not a dead key
    return '' if c < 32 && (c & DEAD_KEY_MASK) != DEAD_KEY_MASK
    # get scan code
    vsc = MapVirtualKeyEx.call(vk, 0, @language_layout)
    # result string is never longer than 4 bytes (Unicode)
    result = "\0" * 4
    # get input string from Win32 API
    length = ToUnicodeEx.call(vk, vsc, @state, result, 4, 0, @language_layout)
    return (length == 0 ? '' : result)
  end
  #----------------------------------------------------------------------------
  # get_input_string
  #  Gets the string that was entered using the keyboard over the input locale
  #  identifier (formerly called keyboard layout handles).
  #----------------------------------------------------------------------------
  def self.get_input_string
    result = ''
    # check every key
    ALL_KEYS.each {|key|
        # if repeated
        if self.repeat?(key)
          # get character from keyboard state
          c = self.get_character(key)
          # add character if there is a character
          result += c if c != ''
        end}
    # empty if result is empty
    return '' if result == ''
    # convert string from Unicode to UTF-8
    return self.unicode_to_utf8(result)
  end
  #----------------------------------------------------------------------------
  # unicode_to_utf8
  #  string - string in Unicode format
  #  Converts a string from Unicode format to UTF-8 format as RGSS does not
  #  support Unicode.
  #----------------------------------------------------------------------------
  def self.unicode_to_utf8(string)
    result = ''
    # L* format means a bunch of 4-byte wide-chars
    string.unpack('L*').each {|c|
        # characters under 0x80 are 1 byte characters
        if c < 0x0080
          result += c.chr
        # other characters under 0x800 are 2 byte characters
        elsif c < 0x0800
          result += (0xC0 | (c >> 6)).chr
          result += (0x80 | (c & 0x3F)).chr
        # other characters under 0x10000 are 3 byte characters
        elsif c < 0x10000
          result += (0xE0 | (c >> 12)).chr
          result += (0x80 | ((c >> 6) & 0x3F)).chr
          result += (0x80 | (c & 0x3F)).chr
        # other characters under 0x200000 are 4 byte characters
        elsif c < 0x200000
          result += (0xF0 | (c >> 18)).chr
          result += (0x80 | ((c >> 12) & 0x3F)).chr
          result += (0x80 | ((c >> 6) & 0x3F)).chr
          result += (0x80 | (c & 0x3F)).chr
        # other characters under 0x4000000 are 5 byte characters
        elsif c < 0x4000000
          result += (0xF8 | (c >> 24)).chr
          result += (0x80 | ((c >> 18) & 0x3F)).chr
          result += (0x80 | ((c >> 12) & 0x3F)).chr
          result += (0x80 | ((c >> 6) & 0x3F)).chr
          result += (0x80 | (c & 0x3F)).chr
        # other characters under 0x80000000 are 6 byte characters
        elsif c < 0x80000000
          result += (0xFC | (c >> 30)).chr
          result += (0x80 | ((c >> 24) & 0x3F)).chr
          result += (0x80 | ((c >> 18) & 0x3F)).chr
          result += (0x80 | ((c >> 12) & 0x3F)).chr
          result += (0x80 | ((c >> 6) & 0x3F)).chr
          result += (0x80 | (c & 0x3F)).chr
        end}
    return result
  end

end


   For now it works without any problems. I hope someone else will find this useful.