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
432
Reaction score
1,379
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
432
Reaction score
1,379
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

Everytime I need to write dialogues I find myself writing new music pieces... what kind of trick is this?!
Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"
Alexa, play Buck-Tick - Dress
Worst part about doing a plugin based on an existing system: figuring out the best way for developers to set up the data.

Forum statistics

Threads
99,217
Messages
963,138
Members
130,804
Latest member
oleran
Top