How can I implement a random pause in my game?
I've done plenty of googling and forum browsing but nothing seemed to work, when it should be such a simple straight-forward thing to do ?
Random pause time
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Regular
- Posts: 35
- Joined: Sun Mar 04, 2018 3:57 am
- Contact:
Re: Random pause time
Can you explain what you mean with a bit more details? What do you want to happen?
For example this could be interpreted as "randomly the game pauses" or "the game pauses for a random amount of time".
For example this could be interpreted as "randomly the game pauses" or "the game pauses for a random amount of time".
Re: Random pause time
If you want for a pause that last a random amount of time...
In this case, pause last from 1 to 10 seconds (broadly, it's never so precise). If you want for the player to click and skip the pause, remove the hard=True part.
Code: Select all
$ dice=renpy.random.randint(1,10)
$ renpy.pause(dice,hard=True)
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
10 ? "RENPY"
20 GOTO 10
RUN
-
- Regular
- Posts: 35
- Joined: Sun Mar 04, 2018 3:57 am
- Contact:
Re: Random pause time
Awesome, thank you! There's only one issue I've got now. What if I need random pause times in the decimal range? Integer surely doesn't work, but if I did this (I'm sure it doesn't work but let's just say it did)gas wrote: ↑Tue Jun 19, 2018 3:41 pm If you want for a pause that last a random amount of time...In this case, pause last from 1 to 10 seconds (broadly, it's never so precise). If you want for the player to click and skip the pause, remove the hard=True part.Code: Select all
$ dice=renpy.random.randint(1,10) $ renpy.pause(dice,hard=True)
Code: Select all
$ dice=renpy.random.real(0.1,1.5)
I've thought of using 'choose' instead and have the function randomly pick one time out of a provided list, but I got weird errors trying that too.
Well I just want to know how to implement random pauses in general.
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: Random pause time
Just enter integers 10 time the float value you want to use and then multiply the returned value with 0.1gamajorbatistan wrote: ↑Wed Jun 20, 2018 12:22 pm ---
There's only one issue I've got now. What if I need random pause times in the decimal range?
---
Code: Select all
$ dice=renpy.random.randint(1,15)*0.1
Who is online
Users browsing this forum: Majestic-12 [Bot]