Dice Manual Stop

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
113
Reaction score
23
I know how to make the dice roll random by repeatedly changing the graphics then set a final graphics.. But now I want some player involvement. I want the player to stop the roll. It does not work how i want it.
I tried using the loop and this is my setup:
1590679828228.png
 

Cormorant42

Veteran
Veteran
Joined
Sep 17, 2019
Messages
74
Reaction score
39
First Language
English
Primarily Uses
RMMV
It looks good to me, the only place I could think there would be an error is in your "Random" variable since I don't see it defined anywhere within the loop, meaning a) it's not working because Random doesn't ever equal 1, 2, or 3, or b) i'm just stupid and i can't figure out what the problem is xD
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
435
Reaction score
1,384
First Language
Bahasa
Primarily Uses
RMMV
Lotsa problem...
- You didn't initiate the random value. Just the condition.
- You repeat the same command. That's just inneficient.
- You use wait. it will cause delay because it has to finish the "wait" command first before checking the "press ok" condition.

Here's the fix :
1590681525534.png

- It uses a variable as an alternative of wait. So delay 10 * wait 1 frame wil be equal to 10 frame wait.
- You don't need to set the sprite image again after stopped because the loop already break.
- I put the random variable directly inside the script call so it doesn't need to be checked again.

Unless it wasn't supposed to be random and the visual have to change 1, 2, 3 in sequence...
 
Last edited:

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
113
Reaction score
23
thanks! i think it needed to be in sequence, because it can appear the same image x3 in a row which is like a freeze.. also i removed the sound effects as the swapping of image is not in sync with the sound effect.

How am i able to reset the dice roll? i can only get it to work once. it wont repeat again?

I have a problem.. to trigger the event I use action button which is the same as the "okay" button in the condition. the reroll does not re-trigger properly with the action button. I need mouse click to re-trigger the event..
 
Last edited:

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
435
Reaction score
1,384
First Language
Bahasa
Primarily Uses
RMMV
Oh... you triggered the event with action button? I get what you mean. The image sometimes doesn't change because I use random value there, and by random it mean sometimes it hit the same number again.

Here's a fix :
1590767395385.png

- The delay initialized as -1 beforehand as an indicator that it will only be executed if you release the "ok" button first. Then you can press the "ok" button once again to stop it.
- The graphic visual repeat 1, 2, 3 in sequence now by using modulo (mod) operator.
- The final outcome will be randomized. If it doesn't fit your need, delete the part in red box.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The more I look at the QPlugins... The more I am amazed at what they can do. Which I'm not going to lie is pretty awkward, because I already consider them far and away the best plugins MV has to offer. :kaoback:
spending a week trying to figure out what was wrong with my font has me DED
504 threads to go upon the time of this post until the forum reaches 100k threads. Thread Dead Redemption. Thready Van Halen. Thread Zeppelin. Doesn't have to be a band or a game
Random thought: Looks like putting in effort in learning a language is like a taboo for most people. :kaoswt2:
Not sure about RPG Maker MZ ; We see a lot of things, but they could have enhanced a lot of things in MV first... We're at the era of updates nowadays, not new products over and over and over :/

Forum statistics

Threads
99,500
Messages
966,116
Members
131,130
Latest member
Player-Unknown
Top