End of line comma error ???

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.
Post Reply
Message
Author
gamajorbatistan
Regular
Posts: 35
Joined: Sun Mar 04, 2018 3:57 am
Contact:

End of line comma error ???

#1 Post 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

User avatar
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:

Re: End of line comma error ???

#2 Post 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 )
Frameworks & Scriptlets:

gamajorbatistan
Regular
Posts: 35
Joined: Sun Mar 04, 2018 3:57 am
Contact:

Re: End of line comma error ???

#3 Post 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.

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: End of line comma error ???

#4 Post 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.

User avatar
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:

Re: End of line comma error ???

#5 Post 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"
Frameworks & Scriptlets:

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: End of line comma error ???

#6 Post 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?

User avatar
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:

Re: End of line comma error ???

#7 Post 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.
Frameworks & Scriptlets:

gamajorbatistan
Regular
Posts: 35
Joined: Sun Mar 04, 2018 3:57 am
Contact:

Re: End of line comma error ???

#8 Post 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!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], dragondatingsim, Google [Bot]