$ Symbol in Ren'py

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
User avatar
RedArTWOrks2
Newbie
Posts: 7
Joined: Thu Feb 19, 2015 8:15 am
Contact:

$ Symbol in Ren'py

#1 Post by RedArTWOrks2 » Sat Apr 04, 2015 11:48 am

Hello everybody.

Today I have a question that doesn't prevent me from programming, but I just want to ask to know it.
My question is related with the function of "$ symbol in ren'py codes", for what is it used for? And what is the difference between a code with that symbol and another without it?

Thanks

RedArTWOrks

User avatar
Dylan_Bain
Regular
Posts: 101
Joined: Mon Mar 09, 2015 2:05 pm
Organization: Dylan Bain Games
Location: Scotland
Contact:

Re: $ Symbol in Ren'py

#2 Post by Dylan_Bain » Sat Apr 04, 2015 12:20 pm

It is used to define variables.
For example=

Code: Select all

$ variable1 = False
or

Code: Select all

$ variable1 == True
You can find out more about $ variables at http://renpy.org/wiki/renpy/doc/tutoria ... er_Choices.
Image
http://lemmasoft.renai.us/forums/viewto ... 52#p365552 Curently NOT Accepting Commisions!

User avatar
RedArTWOrks2
Newbie
Posts: 7
Joined: Thu Feb 19, 2015 8:15 am
Contact:

Re: $ Symbol in Ren'py

#3 Post by RedArTWOrks2 » Sat Apr 04, 2015 12:26 pm

Thank you so much ;)

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: $ Symbol in Ren'py

#4 Post by trooper6 » Sat Apr 04, 2015 12:56 pm

Actually, $ means that the line is a single line of Python code. While this is often used to assign variables, I regularly use it to do other things as well, for example calling methods.

Doing a quick search of the documentation produces two pages (one in QuickStart) that explain this:
http://www.renpy.org/doc/html/python.ht ... -statement
http://www.renpy.org/doc/html/quickstar ... statements
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: $ Symbol in Ren'py

#5 Post by PyTom » Sat Apr 04, 2015 1:38 pm

Basically,

Code: Select all

$ line of python code
is shorthand for:

Code: Select all

python:
    line of python code
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]