My renpy project is throwing an error: An exception has occurred. There are two variables presented that might be the problem, but I have no way of seeing what the value of those variables are.
1) How can I output the value of these variables from the console, to the console, or to a text file, or anywhere it can be seen?
2) Is it possible to use Renpy.say within a screen? Then I can output the value of the variable before it throws an error?
3) Is there a tutorial on how to debug like a pro in Ren'py? For example, how to debug from the console? Something that every Ren'py developer cannot live without?
How can I output the value of a variable used in a screen for loop, during an exception?
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.
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.
- HEXdidnt
- Regular
- Posts: 63
- Joined: Tue Aug 11, 2020 1:25 pm
- Projects: A Night at the Office, Embracing Christmas, The Masquerade Benefit
- Deviantart: HEXdidnt
- Location: Harrow, London, UK
- Contact:
Re: How can I output the value of a variable used in a screen for loop, during an exception?
Not sure how helpful this would be in the long run, but you could certainly output a variable into a portion of the dialogue that happens just before the exception hits. Just enclose the variable name in square brackets within the flow of the text, eg.
Code: Select all
"The exception is about to hit! Variable 1 is currently [variable1name], variable 2 is currently [variable2name]. Click to see the error..."
- 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 can I output the value of a variable used in a screen for loop, during an exception?
3) Is there a tutorial on how to debug like a pro in Ren'py? For example, how to debug from the console? Something that every Ren'py developer cannot live without?
Well, there are sort of two consoles, the Ren'Py one (Shift + 0) and a Python one that you can launch alongside your game (by doing Launcher > Preferences (Launcher Options) and tick the Console Output checkbox.
If that is ticked all Python print output ($ print("debug message") etc) will be shown in that console.
Note: This console is not for typing stuff in, it is just for outputting messages.
Well, there are sort of two consoles, the Ren'Py one (Shift + 0) and a Python one that you can launch alongside your game (by doing Launcher > Preferences (Launcher Options) and tick the Console Output checkbox.
If that is ticked all Python print output ($ print("debug message") etc) will be shown in that console.
Note: This console is not for typing stuff in, it is just for outputting messages.
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Semrush [Bot]