How do I use & declare variables without the $ symbol?

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.
Message
Author
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How do I use & declare variables without the $ symbol?

#16 Post by henvu50 »

trooper6 wrote: Tue Nov 06, 2018 12:41 am You can do what you want in your coding. However, PyTom himself has said that best practices are to declare your variables with default or define and not with $ because that will cause troubles with saving/loading and rollback....but those troubles are inconsistent. You might think it is fine, but then it isn't.

But you do what you want.
Fair enough, I'll switch to default and define.

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: How do I use & declare variables without the $ symbol?

#17 Post by trooper6 »

Remember only to use define for things that don't change. I imagine you won't be using it much.
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
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: How do I use & declare variables without the $ symbol?

#18 Post by Remix »

retain_after_load is almost certainly NOT what you want... It may *appear* to do what you want while the game is open yet will do nothing useful if you close the game, re-open it and load (unless you have progressed dialogue prior to the save, which negates the need to try that as a workaround)

Ren'Py is not really designed to simply enable state saving outside of the progress of dialogue because there are simply too many possibilities to contend with...

If you did want a system that saved some form of state while just a screen was shown you would likely need to write it yourself
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Google [Bot]