How to make a gauge bar with a moving indicator that the player needs to follow?

Bestboy

Regular
Regular
Joined
Jul 20, 2021
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
Sorry, the title may be a little confusing since I'm not entirely sure how to phrase my idea. So I drew a picture, hoping it could explain stuff better.
无标题.png
The black rectangle in the picture does not move, while the blue part slides left and right.
the player controls the red arrow with the 'left' and 'right' keyboard, making the arrow follow the moving blue part.
If the red arrow follows the blue part for a certain time, it's a success.
If the red arrow is unable to follow the blue part for a certain time, it's a failure.

Any ideas or help would be great, Thank you!
 

Mac15001900

JavaScript wild sorcerer
Regular
Joined
Aug 7, 2022
Messages
392
Reaction score
524
First Language
English
Primarily Uses
RMMV
This would be quite tricky - it might be possible with just events, with the player being the arrow, and the bar being 3 tiles wide. Then just have a random, fast move route for the bar, and keep checking if player's X is either equal to the event or different by one with a parallel event.

It would be a bit janky, but should work. To do anything better you'd probably need a custom plugin written.
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
8,227
Reaction score
3,496
First Language
Dutch
Primarily Uses
RMMV
eventing it can work quite nicely for the array part and blue too,
time disstance is a different story.

you need at least 4 variables (blue block) and arrow variable.

start = 0 (most left) and 100 or 200 on the far right.

now when the left key is hold down, variable of the array = -1 and wait 10 frames
same for the right arrow key + 1 and wait 10 frames

you can play around with 5 frames, but I wont recommend lower, but more higher.
for the blue one that is automatically, you can create a new parallel for this part
as a controller, but it can be tricky to set it up, as variable < 0 = 0 and >= 100 = 100
respectively (depending on the max number on the end).
checking variable 1 and 2 for the range of success (a timer plugin might be added as
well if you want a duration when ending it and a 4th every x second + 1 and check
that value on the end if its succeeded or failed.

but it depends where you use it and when to use it, because that isn't clear.

if you use it more often, a plugin might be required if its to complex, but you can
control the difficulty with conditions wait frames (they should be equal).

there is also some events with time bar (not teh same as yours) but more with
pressing the button and with the use of Galv_VariableBar, you can pull it nicely
off or through an event one made (forgot the name) which is also pressing the
button.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,258
Reaction score
4,734
First Language
EN
Primarily Uses
RMMZ
If you want to event it, you may find this tutorial helpful:
It describes how to set up a loop to check player input and update variables/pictures/etc accordingly. The end result (stationary target, auto-moving cursor) is different from what you want, but the basic structure should work for pretty much any system like this.
 

Bestboy

Regular
Regular
Joined
Jul 20, 2021
Messages
42
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thank you for all the help! I know what to do now, thank you!
 

Arrose

Regular
Regular
Joined
Jun 16, 2023
Messages
60
Reaction score
11
First Language
Not English
Primarily Uses
RMMZ
If you want to event it, you may find this tutorial helpful:
It describes how to set up a loop to check player input and update variables/pictures/etc accordingly. The end result (stationary target, auto-moving cursor) is different from what you want, but the basic structure should work for pretty much any system like this.
Great, this works great for fishing or lock picking, or other mini-games!
 

Latest Threads

Latest Posts

Latest Profile Posts

Me working on a deadline, "don't make the baseline and chords too funky, don't over compose it... remember, you have to finish it." Touches MIDI controller...instant funk.
TGA are coming up, and I'm still mad Lies of P didn't get nominated.
Like, they chose a remake of a 20 year old game and a vanilla 2D Mario game over it?

Bah, humbug!
I'll be there for the trailers and whatever weird mistakes are made.
I've bundled all my free plugin releases on itch.io I'll add more later, feel free to check it out! https://starlit.itch.io/rm-free-plugins
If I could draw, my Game Jam title screen would be a Krampus sitting in Santa's chair, his long, blonde hair flowing in the wind, sipping on an Espresso, while snacking on cheddar popcorn, chewing on an orange pencil pensively, while completing a crossword puzzle. I guess it's a good thing I can't draw.
Time for the next chance for y'all to affect my advent calendar! Where should Day 7's sprite come from: land, sea, or demon realm? :rwink:

Forum statistics

Threads
136,782
Messages
1,269,914
Members
180,530
Latest member
Mikimaker
Top