Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: Hoshimo on May 04, 2008, 07:53:46 PM
-
I'm trying to put a walking sound effect and have charge attacks in my game, but I can't find anything that stores how long a keyboard button is pressed.
I assumed I could use "Store Amount of Time Taken to Press Key" but it's all falling to pieces, since every code i'm trying isn't working very well. Any advice or codes for this sort of thing?
-
MeIsCool's game (Metal Tears) had a system like that. If you can hunt down a working download you MIGHT be able to look through the game and find the code for it.
As to the walking sound effect, in the database, go to the terrain tab. choose the first one (or whatever terrain you have your chipsets assigned to) and change the 'sound effect' option to the sound effect you want.
-
I didn't realise the default system had that, since I never really looked around at the defaults, also, I did look around for Metal Tears and I gotta say WOW that's alot of code, so thanks a bunch for the help.
-
Charging is pretty easy. Make a parallel process event with a key input. After the key input, have an if statement for if the key is pressed. If the key is pressed, wait 1 second, and then add 1 to a variable (lets call it [charge]. In the else condition of the if statement, set [charge] equal to 0.
It should look something like this.
Key input process
IF key pressed
- wait .1
- [charge] + 1
ELSE
- [charge] = 0
The longer you press the key, the higher the [charge] variable gets. When you let the key go, the variable goes back to 0.