Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
- Posts: 1
- Joined: Fri Apr 28, 2017 6:37 am
I'm trying to create a lightning effect by flashing the screen. My problem here is the random part. I want my flashes to appear after a random time, so I thought about using a transform I could apply on a white image.
This is the transform code I'm using, but the randomized pause seems to always last 1 sec (the minimum I set in my randint)
Code: Select all
linear 0.2 alpha 0
pause renpy.random.randint(1, 5)
Is it possible to get some random in transforms ? Because I guess the "renpy.random.randint" function doesn't work in a transform. Or am I misunderstanding the whole thing ?
I'd also like to get a screenshake everytime the flash appears. Should I do it with another transform ? How can I get it to sync with the flashes ?
Thanks in advance!
- Lemma-Class Veteran
- Posts: 2850
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
randint is designed to work even with rollbacks, always generating the same number.
I can't currently think of a work around.
This may work if you modify it:
I'll try something later if I get some time.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
- Miko-Class Veteran
- Posts: 556
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Projects: ?
- Organization: Lucky Special Games
- Tumblr: saguarofoo
- itch: saguarofoo
- Location: USA
For the randomization, I think the easiest way is to put possible pause lengths in choice statements.