Trying to recreate a "quick draw" system in RPG Maker MV?

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
59
Reaction score
35
First Language
English
Primarily Uses
N/A
Hello,
I apologise if this is posted somewhere it shouldn't be, I haven't used these forums in awhile.

I'll keep this brief: i'm trying to create a simple system in which the player has to press the button at a certain time to win. The player should not be allowed to press the button too early and loses if they press the button to late. For refrence, I want to make something like Samurai Kirby in RPG Maker MV.

Below is what a morning of trial and error has revealed so far: An autorun event initiates the timer to be used to control when the player can press the button. (The timer is obscured during gameplay so the player cannot cheat). If the button is pressed before the timer reaches 0. the player automatically loses as they pressed it too early. Prior to the timer ending, there is also an indicator ("strike 1") use to display a notification to the player when to push the button and failure to do so means they lose by default.
1643034237322.png
My biggest hurdles with this method are timing as the indicator can still show up but the player will still be told it was "too soon" and most annoying of all, the player must press and hold the button to win, otherwise it does not count.

Perhaps what i'm attempting isn't really doable with RPG maker? But i'm this close and was wondering if anyone could advise; maybe a better way to handle it?
 

Celestrium

Worldsmith
Veteran
Joined
Mar 3, 2020
Messages
274
Reaction score
310
First Language
English
Primarily Uses
RMMZ
The section of the event that is less than or equal to 0 seconds can never happen because of the previous argument will always prevail. I think you need to stack the arguments, like if timer is greater than or equal to 0 and then another condition if timer is less than 4, then one for greater than or equal to 4 (Previous argument priortizes on 4), but equal to or less then 6. Understand? You need more arguments and need to make them ranges.
Conditions within conditions
 

SomaelCK

Lv 99 Simple Sheep
Veteran
Joined
Dec 12, 2012
Messages
710
Reaction score
1,222
First Language
Burmese
Primarily Uses
RMMV
Why not try something simpler? Instead of using timer why don't you make a loop with a variable that add a single value every 60 frames. Stop the loop when player pressed the designated button and then check the value stored in the variable to check if that value is within the result you want?

That way, you can even have more precise control over which frame the player need to hit to make a pass.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
5,425
Reaction score
2,136
First Language
Dutch
Primarily Uses
RMMV
beste way instead of timer (personally) is using a variable timer
can be hidden, can be showed.

you can check how much variable you need to make it good or perfect hit.
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
59
Reaction score
35
First Language
English
Primarily Uses
N/A
Hello everyone,

Thanks for the feedback. I can't currently test these ideas as i'm out and about atm, but when I get the oppitunity, i'll look into the suggestions more. I just wanted to acknowledge that i've seen them.
 

WilsonE7

Veteran
Veteran
Joined
Oct 12, 2019
Messages
132
Reaction score
63
First Language
English
Primarily Uses
RMMZ
Similar to what SomaelCK said, you need loops. If I understand what you want correctly, you want a hidden timer, and at a certain point a prompt appears for the player to press a button. If the player presses the button quick enough, they pass. Too early or late and the fail. Here's how you can do it with a randomized timer. You need two loops: One to measure the random time before the prompt appears, and the other to measure the time the player has to press the button.
Here's an outline:
EDIT: The dang post didn't keep my careful indentations... Hope it makes sense anyway.

Control Variables: ButtonTimer = 0
Start Loop 1:
Control Variables: RandomNumber = Random 1..x, where x = the max number of frames you want the player to wait. 60 frames = 1 sec
If: RandomNumber = 1:
Show button prompt.
Start Loop 2:
If: OK is being triggered:
You win!
Break Loop 2
End of OK Button If statement
Wait 1 frame
ButtonTimer += 1
If: Button Timer = 60:
Too late!
Break Loop 2
End of ButtonTimer If statement.
End of Loop 2. This loop repeats until ButtonTimer = 60.
Break Loop 1.
End of RandomNumber If statement.
If: OK is being triggered:
Too early!
Break Loop 1.
End of OK If Statement.
End of Loop 1. This loop repeats until the RandomNumber = 1, OK is pressed too early, or the event is won.
End of Event. Reset all variables.
 

Spaske

Veteran
Veteran
Joined
Nov 6, 2021
Messages
274
Reaction score
140
First Language
German
Primarily Uses
RMMZ
Hello,
I apologise if this is posted somewhere it shouldn't be, I haven't used these forums in awhile.

I'll keep this brief: i'm trying to create a simple system in which the player has to press the button at a certain time to win. The player should not be allowed to press the button too early and loses if they press the button to late. For refrence, I want to make something like Samurai Kirby in RPG Maker MV.

Below is what a morning of trial and error has revealed so far: An autorun event initiates the timer to be used to control when the player can press the button. (The timer is obscured during gameplay so the player cannot cheat). If the button is pressed before the timer reaches 0. the player automatically loses as they pressed it too early. Prior to the timer ending, there is also an indicator ("strike 1") use to display a notification to the player when to push the button and failure to do so means they lose by default.
View attachment 213984
My biggest hurdles with this method are timing as the indicator can still show up but the player will still be told it was "too soon" and most annoying of all, the player must press and hold the button to win, otherwise it does not count.

Perhaps what i'm attempting isn't really doable with RPG maker? But i'm this close and was wondering if anyone could advise; maybe a better way to handle it?

I made actually something similar in the past, you have to press the button at the right time, too soon or too late will end up with a fail, its for an fishing event but its practically the same:
1643044639314.png
View attachment 213997
1643044732619.png
1643050258393.png
 
Last edited:

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
59
Reaction score
35
First Language
English
Primarily Uses
N/A
I made actually something similar in the past, you have to press the button at the right time, too soon or too late will end up with a fail, its for an fishing event but its practically the same:
View attachment 213996
View attachment 213997
View attachment 213998
View attachment 214009
Hello,

I've tried a couple of the suggestions, but yours is pretty much what i'm looking for. I replicated the basics, but I seem to have one issue: the lose state doesn't seem to work. You can press it too early and win when the condition is met, but you can still win even after you're not suppose to. Here is what I have:
BMCA2.png
 

Spaske

Veteran
Veteran
Joined
Nov 6, 2021
Messages
274
Reaction score
140
First Language
German
Primarily Uses
RMMZ
Hello,

I've tried a couple of the suggestions, but yours is pretty much what i'm looking for. I replicated the basics, but I seem to have one issue: the lose state doesn't seem to work. You can press it too early and win when the condition is met, but you can still win even after you're not suppose to. Here is what I have:
View attachment 214256

Seems to be fine at first glance, how do you activate it? Maybe there is some problem or odd timing with the switch that activates the event "Swingtimer".


Edit: yo also should put an if <= for the exclamation, otherwise it will be visible nonstop, just add another if like here: 1643316790123.png
So the exclamation (or whatever other thing you chose for letting you know when to press) will not be on autorun all the time.

edit 2:
Sry, now i realise in the first picture i cut off the first line by accident, just add it in like shown here:
If: ???? >= 200
If:?????<=250....

edit 3: looked at it in detail and except that "if" in the first line everything should be ok, the first line only will make trouble by showing the bubble... the rest of the event should work fine so i asume its some kind of problem with the switch, pls show me how you activate it.
 
Last edited:

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
316
Reaction score
151
First Language
spanish
Primarily Uses
N/A
I would like to suggest a different way to do it, because I don't like autorun events for these purposes because they freeze the game unless you add a wait which is 1/60 seconds and if the player presses the button fast he can miss the loop, so the player needs to press and hold the button.

So, what about put a parallel process increasing a variable in 1 (just as you did) and an event below/above the player and an action button trigger with the conditions:

Code:
If: SwingCount>250
    If: SwingCount<500
        Text: You win!
    :Else
        Text: Too slow!
    :End
:Else
    Text: Too soon!
:End

This way the condition is triggered once just when the button is pressed and you don't need the "button pressed down" condition.



...And I have another idea, If you need a visual indicator to show when to press the button, you could do it in a different way, edit the event and put a single text:

Code:
Text: Too soon!
1643329938479.png

Add a second page and set the Variable SwingCount>250 as condition for this page
1643329647108.png
and the text:

Code:
Text: You win!

In this page (2) select any image you want as indicator to let the player know when to press the button
1643329741838.png

Finally add a third page and set the Variable SwingCount>500 as condition for this page and the text:

Code:
Text: Too slow!

Do not put any image in the first and third page
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
59
Reaction score
35
First Language
English
Primarily Uses
N/A
Seems to be fine at first glance, how do you activate it? Maybe there is some problem or odd timing with the switch that activates the event "Swingtimer".


Edit: yo also should put an if <= for the exclamation, otherwise it will be visible nonstop, just add another if like here: View attachment 214257
So the exclamation (or whatever other thing you chose for letting you know when to press) will not be on autorun all the time.

edit 2:
Sry, now i realise in the first picture i cut off the first line by accident, just add it in like shown here:
If: ???? >= 200
If:?????<=250....

edit 3: looked at it in detail and except that "if" in the first line everything should be ok, the first line only will make trouble by showing the bubble... the rest of the event should work fine so i asume its some kind of problem with the switch, pls show me how you activate it.
Really sorry for the late reply; computer issues.

Here's how I have it set up:
I want the game to all be operated using a single button. So an autorun event is used to initiate the game. Here it is:
1644092807157.png
The 2nd tab/page is just to stop the event from auto running after it has served its purpose.

This turns on the event which uses the code you suggested. I've added the changes you've suggested and the player is punished for pressing the button too soon and can win when pressed at the right time, but can't seem to lose from missing the prompt. Here is the event which handles it:


BMCA2.png
And that's all the working events I have. if you need anymore info, I can help. ideally, the player character is never actually involved and is stored off camera.

Also, I did try @stramin 's idea, but couldn't seem to get it to work. You'll have to forgive me if i'm missing something obvious; haven't used RPG maker in years.
 

Spaske

Veteran
Veteran
Joined
Nov 6, 2021
Messages
274
Reaction score
140
First Language
German
Primarily Uses
RMMZ
Really sorry for the late reply; computer issues.

Here's how I have it set up:
I want the game to all be operated using a single button. So an autorun event is used to initiate the game. Here it is:
View attachment 215329
The 2nd tab/page is just to stop the event from auto running after it has served its purpose.

This turns on the event which uses the code you suggested. I've added the changes you've suggested and the player is punished for pressing the button too soon and can win when pressed at the right time, but can't seem to lose from missing the prompt. Here is the event which handles it:


View attachment 215332
And that's all the working events I have. if you need anymore info, I can help. ideally, the player character is never actually involved and is stored off camera.

Also, I did try @stramin 's idea, but couldn't seem to get it to work. You'll have to forgive me if i'm missing something obvious; haven't used RPG maker in years.
tbh i have no idea why its not working properly, it should...
What message do you get when you should lose? Like if youre wining?
 

jjbones123

Veteran
Veteran
Joined
Aug 2, 2016
Messages
59
Reaction score
35
First Language
English
Primarily Uses
N/A
I'm a little embarrassed to admit this:

I tested what happens and at first, I thought it was nothing: No text box was displayed.

As I typed this, I went back to the game tab and saw the text "too slow". It seems that a lose state does happen, just later than expected; I only discovered this one because I unintentionally let it run.

I'll tweak the times, but the system works and am satisfied, thanks.
 

Latest Threads

Latest Posts

Latest Profile Posts

Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)
It's always disturbing to me to see my cat eating something off the bathroom floor.

Forum statistics

Threads
121,992
Messages
1,145,744
Members
160,259
Latest member
Leonson
Top