Page 1 of 1
End of line comma error ???
Posted: Wed Jun 27, 2018 7:47 pm
by gamajorbatistan
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
Re: End of line comma error ???
Posted: Wed Jun 27, 2018 8:06 pm
by Remix
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 )
Re: End of line comma error ???
Posted: Wed Jun 27, 2018 8:19 pm
by gamajorbatistan
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.
Re: End of line comma error ???
Posted: Thu Jun 28, 2018 4:02 am
by kivik
You can use the choice property:
https://www.renpy.org/doc/html/atl.html ... -statement
Have different pause values in each choice, then it'll be randomised.
Re: End of line comma error ???
Posted: Thu Jun 28, 2018 4:04 am
by Remix
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"
Re: End of line comma error ???
Posted: Thu Jun 28, 2018 4:31 am
by kivik
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?
Re: End of line comma error ???
Posted: Thu Jun 28, 2018 6:25 am
by Remix
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.
Re: End of line comma error ???
Posted: Thu Jun 28, 2018 2:51 pm
by gamajorbatistan
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!