[Solved]Attributes messed up by Mouse Wheel
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.
[Solved]Attributes messed up by Mouse Wheel
I don't want to disable it, but the scroll wheel doesn't roll back the in-game time, and if you roll back to a screen where attributes were being adjusted, it doubles down on the changes instead of reversing them, same with the time. I always thought the scroll wheel was a full-auto undo button, but that's not the case here at least. How should I approach this issue?
Last edited by Killverin on Fri Jun 03, 2022 9:23 am, edited 1 time in total.
- 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: Attributes messed up by Mouse Wheel
The most likely problem is that the object with the attribute is created in an init block. Only objects reachable from variables that are changed after the end of the init phase are saved, and only those variables are changed.
Chances are, what you need to do is to create your object in a default statement. For example:
Chances are, what you need to do is to create your object in a default statement. For example:
Code: Select all
init python:
class GameState:
def __init__(self):
self.time = 0
def bump_time(self):
self.time = self.time + 1
default state = GameState()
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Attributes messed up by Mouse Wheel
Thank you! I was doing that, yeah. I'm glad the solution is so straight forward. 
Who is online
Users browsing this forum: No registered users