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.

"Erasing" the Battle Command Window.

*sigh* I've tried everything possible to do this. You know, the @actor_command_window? I want to get rid of it. Instead, I want to use buttons in my battle system.

Like, say, space bar to attack, shift to bring up the skill menu, up to defend, and down to bring up the items menu; instead of having to "choose" them from the menu. However, I can't seem to do this. Any pointers, anybody?

EDIT: Also, I have another question which I might as well ask. What's the difference between 'Input.press?' and 'Input.trigger?'?

EDIT: Alright, I figured it out. Just needed to get rid of one line of code. But either way, I'd like to know the difference between 'Input.press?' and 'Input.trigger?'  :tongue2:
 

khmp

Sponsor

Input.press? will be true for the key it is checking all the while the key is being held down. Input.trigger? on the other hand will return true after the key is pressed initially and will not if the key is held down. Unbuffered input versus buffered input respectively.

Good luck with it ChaosMaxima! :thumb:
 
Ah! Got it! That really helped me out. Thanks a lot, KeHeMP! : D

Okay, so now I've nearly finished this heavily modified DBS. I just have one last question now. How will I go about showing a picture through the script? I know it has something to do with "RPG::Cache.picture(picture name)", but I'd like to know exactly what the code would be. : )
 

khmp

Sponsor

Never saw someone try to pronounce the name before so, a thank you for that.

To show an image on screen you need a sprite object. Not just a bitmap object.
Code:
@sprite_image = Sprite.new
@sprite_image.bitmap = RPG::Cache.load_bitmap(dir, filename, hue)
If the picture is going to be in the picture's directory.
Code:
@sprite_image.bitmap = RPG::Cache.picture(filename, hue)
I assume you will be using the bitmap quite a bit yes? So this next part is only for once and a while images. Or once a scene kind of thing anyway.
Code:
@sprite_image.bitmap = Bitmap.new(dir + filename)

dir stands for directory. example: './graphics/pictures/'
filename stands for the image's filename. example: 'thumbs_up.png'
hue stands for the hue applied to the image, ranges from 0...360. example: 32

Good luck with it ChaosMaxima! :thumb:
 
Not... exactly... what I meant. Currently, I'm making four different battle commands which actually are the names of certain skills. So I need to do it by a script, and a script only. I know what battle events are. >_>
 

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