- Joined
- Feb 28, 2012
- Messages
- 8,121
- Reaction score
- 10,974
- First Language
- English
- Primarily Uses
- RMMZ
With direct designation I can place it where I want it to. The variables are there too ensure the goal is placed randomly in the background bar. What doesn't make sense to me is that I copied the equation for Variable #17 directly from the tutorial and the images I used are the same size so there shouldn't be an issue. Ideally I don't even need the goal bar to be placed randomly but just in the center. I'm not sure how I'd be able to check to see if enter is pressed when the pointer is in that designation. there has to be something wrong with the $gameVariables value I suppose which checks to see if the pointer is in the goal area.@cokes1999 The 'button is being triggered' option is new to MZ, but it shouldn't be causing any issues.
It's hard to tell since it's cut off in that screenshot, but two possibilities for why it's not working is that your variable 17 has the wrong equation so it's being set to 1 instead of the right number or you have a plugin/other event that is interfering with that variable. Try setting it with a direct designation instead of with variables and see if it appears where you want it then.
@cokes1999 Oh, that's it! You copied the equation exactly, but forgot to change it to match the variables you're using for this event. Change the 24 and 25 in the equations to match the variables you're using (15 and 16) and you should be good to go.I copied the equation for Variable #17 directly from the tutorial
Ah that was the issue. I also changed the (21) to (12) as I was using the wrong variable for that equation as well.@cokes1999 Oh, that's it! You copied the equation exactly, but forgot to change it to match the variables you're using for this event. Change the 24 and 25 in the equations to match the variables you're using (15 and 16) and you should be good to go.![]()
I tried this plus the Wait Frame that caethyril suggested and now the pointer doesn't move at all@cokes1999 I think what's happening is that you succeed at first, but because MV only has the 'is pressing' option for button clicks when the goal spot moves and you're still hitting the ok button the event thinks you've failed. So what you need is to put something in that will pause the event until you let go of the ok button.
Off the top of my head, slapping a loop that only stops once the button isn't being pressed into the event after the success SE should work. But I didn't test it so I'm not 100% positive it'll fix your issue.
View attachment 180986
Ah, I must have read followed your instructions wrong. It works perfect now. Thank you so much for your help!!!!!@cokes1999 Hmm, it should've worked, I tested it out in my mz event and it seemed fine. The pointer should stay still until the 'ok' button is let go of, so it won't accidentally trigger again before the player is ready. Just to make sure, you put the loop with the added wait right after the success sound and it didn't work?
That depends on what you mean by "circular".is there a QTE reference when it's circular?
$gameScreen.picture(1)._angle = $gameVariables.value(1);
◆Text:None, Window, Bottom
: :Get ready!
◆Comment:Show gauge, rotated randomly
◆Control Variables:#0001 Gauge Angle = Random 45..270
◆Show Picture:#1, gauge, Center (408,312), (80%,80%), 255, Normal
◆Script:$gameScreen.picture(1)._angle = $gameVariables.value(1);
◆Comment:Show pointer
◆Show Picture:#2, pointer, Center (408,312), (100%,85%), 255, Normal
◆Comment:Random start delay (60 ~ 120 frames)
◆Control Variables:#0002 Input Angle = Random 0..60
◆Wait:60 frames
◆Loop
◆If:Input Angle = 0
◆Break Loop
◆
:Else
◆Control Variables:#0002 Input Angle -= 1
◆Wait:1 frame
◆
:End
◆
:Repeat Above
◆Comment:Start pointer spinning (rotation speed 8 = 4 degrees per frame)
◆Rotate Picture:#2, 8
◆Comment:Start input check loop
◆Control Variables:#0002 Input Angle = 0
◆Loop
◆If:Button [OK] is pressed down
◆Comment:Input received!
◆Break Loop
◆
:Else
◆Comment:Check whether pointer has come full circle
◆If:Input Angle ≥ 360
◆Comment:Time's up!
◆Break Loop
◆
:Else
◆Comment:Increase counter, check again next frame
◆Control Variables:#0002 Input Angle += 4
◆Wait:1 frame
◆
:End
◆
:End
◆
:Repeat Above
◆Comment:Debug message (press F8 during playtest to view)
◆Script:console.info('input angle:', $gameVariables.value(2), '\ntarget angle:', $gameVariables.value(1));
◆Comment:Stop rotation o_o
◆Rotate Picture:#2, 0
◆Comment:Calculate difference between input time and gauge angle
◆Control Variables:#0002 Input Angle -= Gauge Angle
◆Text:None, Window, Bottom
: :Your score: \v[2]
◆Comment:Check for success!
◆If:Input Angle ≥ 0
◆If:Input Angle ≤ 10
◆Text:None, Window, Bottom
: :Perfect!
◆
:Else
◆If:Input Angle ≤ 30
◆Text:None, Window, Bottom
: :Good job!
◆
:Else
◆Text:None, Window, Bottom
: :Better luck next time!
◆
:End
◆
:End
◆
:Else
◆Text:None, Window, Bottom
: :Better luck next time!
◆
:End
◆Comment:Tidy up pictures
◆Erase Picture:#1
◆Erase Picture:#2
Ah, OK! Note that the variable doesn't have to be X or Y: it can be scale%, time, etc. I think the basic structure would still be the same, with a couple of changes:large circle that shrinks and player needs to react when the ring is the same size as the target.
// Get picture ID 1.
const pic = $gameScreen.picture(1);
// Get target scale = value of variable 2.
const scale = $gameVariables.value(2); // e.g. 50
// Set picture's target scale (X and Y).
pic._targetScaleX = pic._targetScaleY = scale;
// This transition should happen in 1 frame (i.e. instant).
pic._duration = pic._wholeDuration = 1;