Need help with Button Hold Minigame Event

Hi,
So I need some pointers on how to go about eventing a crafting minigame.
Basically this is what I want:
You push and hold a button and a bar (ideally a vertical bar) fills slowly. When you let go off the button the bar doesn‘t drop and holds at the same value. When the bar is filled, the minigame is complete.
Now the trick is that I want a second meter that fills at the same time and that is not supposed to get full, otherwise the quality of the crafted item drops every time this happens. When you let go off the button, the bar of this second meter drops.

I saw some tutorials about quick time events, but not exactly about something where you keep holding a button down.
Any ideas on how I would go about that?
I would think you could do this with a parallel event that checks if a button is held, increment two different variables once every x frames, one for each meter. The second variable resets to 0 when the button is not held. Then have SRD HUDMaker visually display the value of those two variables in two different HUD elements.
Basically you'll have to use the one thing that is usually denied to use: a parallel process without any waits.

Basically conditional branch for butto pressed, a switch to remember if button was pressed before, and then reacting when the button is no longer pressed.

If the button was pressed (switch) and is pressed (conditional branch) then it was continuously hold.
if the button was pressed but is no longer pressed then the player released it just in that frame.
😅 I'm not sure why people are suggesting a Parallel event for a minigame like this, since I'd assume you don't want to allow the player to walk around, open the menu, etc during the minigame? You can use Autorun, or Loop & Break Loop commands in an Action Button map event or a common event.

It sounds like you'd want 3 variables: Q (quality), A (good, game complete at max), B (bad, quality down at max). I'd personally consider a common event like this, called from applicable map events:
  • Set Q = 3, A = 0, B = 0.
  • Loop:
    • If [OK] is pressed:
      • +1 to A and B.
    • Else:
      • -1 from B.
    • If B is at max:
      • -1 from Q.
      • Set B = 0.
    • If Q is at 0:
      • Break Loop.
    • If A is at max:
      • Break Loop.
    • Update display (if not automated by a plugin).
    • Wait 1 frame.
(Generally there should be a Wait 1 frame command, e.g. as the last command inside the loop, but you can get away with omitting that if the "loop" is a complete Autorun/Parallel event because they can only trigger once per frame anyway.)

The display is the tricky bit. Using pictures to show a pointer on a gauge is easily doable with event commands, because it lets you specify coordinates with variables. A discrete scale (e.g. hold for 10 frames to advance by one "bubble") would be doable, too. However, the command doesn't offer variable scale or cropping, so for that kind of thing you'd need a script call or, like Aqua suggests, a plugin.
Thank you all so much!
I followed @caethyril advice and made it an autorun common event.
It seems to work, but I haven't been able to insert the pictures for it. I'm still trying to work out how best to go about it.
Because the only thing I'm coming up with is having like hundred pictures to show a bar slowly filling up.
There are script calls for Move Picture, e.g.
JavaScript:
const pictureId  = 1;
const variableId = 2;
const maxValue   = 100;  // Variable = maxValue when full.
const fullScale  = 100;  // 100 means 100% scale
const duration   = 1;    // In frames: 1 = instant.
// Change the above values as needed //
var pic = $gameScreen.picture(pictureId);
var scale = $gameVariables.value(variableId) / maxValue;
pic._targetScaleY = fullScale * scale;
pic._duration = pic._wholeDuration = duration;
Another option is a plugin like Aqua suggested, to show a gauge bound to a variable's value. I think VisuStella has a paid plugin specifically for variable gauges. There may be others available.
Just use SRD HUDMaker for gauges.
Because the only thing I'm coming up with is having like hundred pictures to show a bar slowly filling up.
no, two pictures can be enough if you use one picture to hide the other.

make one picture of the gauge with a big frameand only the gauge itself transparent. This picture needs a high ID.
then calculate the position of the fill picture with a low ID so that only part of the gauge displays as filled.
Since the frame with the high id will be displayed above the fill picture, this shows every possible gauge status with two pictures only.
Thank you all for your continued help!
Since this is for the christmas jam and I needed something simple, I chose Andar's suggestion, combined with one of @hiddenone tutorials.

This is how far I've come:

Spoiler: Event:
minigame1.png

And this is a screenshot with very rudimentary placeholder graphics:

Spoiler: Screenshot:
Screenshot_2023-12-14_23012946.png

Picture 1 is the background of the bottle and the eyeballs, picture 2 is the purple liquid in the bottle, picture 3 are pink eyeballs and picture 4 is the rest of the bottle, skull and cutting board.
Now the one thing I have trouble with is stopping the third picture (the eyeballs filling up) from dropping below they starting Y point of 48. I thought, if I could just jump to a label at the start, that would stop it, but no such luck.

I think I'm missing something super obvious.
Regardless, my thanks go out to each one of you who was so kind to reply. Without your advice I wouldn't have even gotten so far. Also, any advice on how to optimize the event is also appreciated.

If anyone needs in return a rtp-style tile for MV or MZ, shoot me a PM 😍
I think you could just add a check so FoulY only increases if it's less than 48, i.e.
  • If FoulY < 48
    • FoulY += 1
    • Move Picture 3
Yes, something like this. But where exactly would I put it? In the "else" part?
Yes, so that first part would be like:
  • If OK is being pressed
    • PotionY -= 1
    • FoulY -= 1
    • Move Pictures 2 & 3
  • Else:
    • If FoulY < 48
      • FoulY += 1
      • Move Picture 3
(I might've missed something. 😅)
Yes, this works, thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-button-hold-minigame-event.163714/