Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Keyboard Input Module Question

Angst

Member

I'm really new with RGSS so I was wondering how someone would go about scripting where if you press the F key on your keyboard (or any other key), it would open a custom menu, say, the Crafting System, or the Materia System windows.

I already have the Keyboard Input Module v.5 but adding a menu to a key stumps me. x:
 

Anonymous

Guest

Usually this is used to determine if a button is pressed.

Code:
 if Input.trigger?(Input::?)

Replace the ? with the key to be pressed, and underneath goes the code referencing what happens when that key is pressed.
 
Nope...

If you're using Aleworks Input Module... you'll also need Aleworks Keyboard Module to check individual keys (A to Z and etc).

After adding that module, you'll be able to check ANY key with a syntax of this:
Code:
if Input.trigger(Keys::F)
  $scene = Scene_Crafting.new
end
Notice the difference? The Input.trigger? routine in his Input Module rewrite was made to work exactly the same but the Keys::F is part of the Keyboard module.
 

Angst

Member

DerVVulfman;293848":3ft48s5m said:
Nope...

If you're using Aleworks Input Module... you'll also need Aleworks Keyboard Module to check individual keys (A to Z and etc).

After adding that module, you'll be able to check ANY key with a syntax of this:
Code:
if Input.trigger(Keys::F)
  $scene = Scene_Crafting.new
end
Notice the difference? The Input.trigger? routine in his Input Module rewrite was made to work exactly the same but the Keys::F is part of the Keyboard module.

No, I'm using Near Fantastica's Input Module, v.5
._.

I might get Aleworks instead.. Seems easier..
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top