Changing variables on a screen
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.
-
- Newbie
- Posts: 10
- Joined: Mon Dec 31, 2018 4:35 pm
- Contact:
Changing variables on a screen
Hello. How can I use an image button to edit a variable that I've got? For example, I want to add 10 to the variable. I only know how to use setvariable to set a value to the variable, but not add or substract.
- 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: Changing variables on a screen
Inside SetVariable, use the variable as a base to evaluate the new value...
SetVariable( "variable_name", variable_name + 1 )
SetVariable( "variable_name", variable_name + 1 )
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]