namastaii wrote: ↑Tue Aug 20, 2019 11:31 am
Does defining these variables before the game starts help?
Code: Select all
define discount1 = renpy.random.randint(1, 10)
define discount2 = renpy.random.randint(1, 20)
define discount3 = renpy.random.randint(1, 25)
define discount4 = renpy.random.randint(1, 30)
define discount5 = renpy.random.randint(1, 50)
or you could put default instead of define
I don't know if these will be changing throughout the game?
Code: Select all
e "1 You've created a new Ren'Py game."
e "Discount amount [discount1]"
$ discount1 = renpy.random.randint(1, 10)
e "New discount amount [discount1]"
Heya, so I tried defining / defaulting them which unfortunately doesn't really do anything.
These changes happen constantly throughout the game and are an important part, so having as little of a delay as possible is vital.
These delays do happen right before showing a movie in one case or a image (2mb) in another. However both of these have already been compressed to be as small as possible, so I can't really do anything about that.
I gave the supermarket setting just as an example. In actuality it's a more complex system where you guide a character through a randomly generated room. When they reach the exit, all the stats are randomized again and a new room is generated.
As soon as the player pressed on the exit, it very quickly assigns a new random number to a few variables before showing you the next room. Right now I do:
Code: Select all
scene black with dissolve # Just a black jpg
$ random1= renpy.random.randint(1, 3)
$ random2= renpy.random.randint(1, 5)
$ random3= renpy.random.randint(1, 3)
$ random4= renpy.random.randint(1, 2)
$ random5= renpy.random.randint(1, 6)
show globalImage with dissolve # A layeredimage with objects appearing depending on the above generated random numbers.
It's a little tricky to do, but I'd say every Random number takes about 0.1 seconds. So the above code would put in a delay of 0.5sec.
That might not seem as a lot, but the player goes through a room quite quickly, so they'll constantly be watching a 0.5sec black screen.