Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
-
gamajorbatistan
- Regular
- Posts: 35
- Joined: Sun Mar 04, 2018 3:57 am
-
Contact:
#1
Post
by gamajorbatistan » Wed Jun 27, 2018 7:47 pm
Why do I get an error for this bit of code?? I'm starting to question my sanity here.
Code: Select all
image happy_anim lip sync:
"char/Elsa/face01.png"
$ RNG = renpy.random.randint(4,6)*1
if RNG <= 20:
pause 0.2
else:
pause renpy.random.randint(3,6)
"char/Elsa/face02.png"
pause 0.2
repeat
This is the error message:
Code: Select all
File "game/script.rpy", line 208: expected 'comma or end of line' not found.
$ RNG = renpy.random.randint(4,6)*1
-
Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
-
Contact:
#2
Post
by Remix » Wed Jun 27, 2018 8:06 pm
ATL cannot assign a value to a variable, so the $ rng = line is invalid
ATL also does not support conditionals like you have written ( if ... else )
-
gamajorbatistan
- Regular
- Posts: 35
- Joined: Sun Mar 04, 2018 3:57 am
-
Contact:
#3
Post
by gamajorbatistan » Wed Jun 27, 2018 8:19 pm
Remix wrote: ↑Wed Jun 27, 2018 8:06 pm
ATL cannot assign a value to a variable, so the $ rng = line is invalid
ATL also does not support conditionals like you have written ( if ... else )
Oh. Wow, I was completely unaware I was in ATL. Well that's a real bummer. The limitations of RenPy are so saddening tbh. Guess I can't randomize things like eye blinking then.
-
Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
-
Contact:
#5
Post
by Remix » Thu Jun 28, 2018 4:04 am
You can use the:
pause renpy.random.random()
part, just not assigned to a variable or inside if..else
Suggest:
Code: Select all
"no_blink.png"
pause renpy.random.random() * 5 + 2
"blink.png"
pause 0.2
# or even
choice:
pause 2.2
choice:
pause 3.1
choice:
pause 3.6
"blink.png"
-
kivik
- Miko-Class Veteran
- Posts: 786
- Joined: Fri Jun 24, 2016 5:58 pm
-
Contact:
#6
Post
by kivik » Thu Jun 28, 2018 4:31 am
Remix wrote: ↑Thu Jun 28, 2018 4:04 am
You can use the:
pause renpy.random.random()
part, just not assigned to a variable or inside if..else
Suggest:
Code: Select all
"no_blink.png"
pause renpy.random.random() * 5 + 2
"blink.png"
pause 0.2
Doesn't that get set at image init, and thus not get randomised as you play the game? I remember that being the issue about a year or 2 ago so I don't know if it's still the case?
-
Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
-
Contact:
#7
Post
by Remix » Thu Jun 28, 2018 6:25 am
kivik wrote: ↑Thu Jun 28, 2018 4:31 am
Doesn't that get set at image init, and thus not get randomised as you play the game? I remember that being the issue about a year or 2 ago so I don't know if it's still the case?
You are probably right... I didn't test it at all.
Personally I tend toward doing mine as DynamicDisplayables to have a bit more control over the progression of image frames.
-
gamajorbatistan
- Regular
- Posts: 35
- Joined: Sun Mar 04, 2018 3:57 am
-
Contact:
#8
Post
by gamajorbatistan » Thu Jun 28, 2018 2:51 pm
Oh sweet, thanks for the lovely feedback input and ideas. I think dynamic displayables is something I'll want to have a closer look at!
Users browsing this forum: Bing [Bot], Google [Bot], span4ev