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.
- Posts: 218
- Joined: Mon Sep 19, 2011 6:48 pm
- Completed: When the Seacats Cry
- Projects: Detective Butler
- Organization: Goldbar Games
- Tumblr: kinjo-goldbar
- Deviantart: Kinjo-Goldbar
- Github: GoldbarGames
- Skype: Kinjo Goldbar
- itch: goldbargames
- Location: /seacats/
During the navigation, the player can go back to the previous room by clicking a "back" button, and this works fine on its own. But when the player saves the game and tries to load, there are some big problems.
When the player saves and loads into a new file (without closing the game), this list carries over into the loaded save. So if my list is A, B, C, D and then I load a game that starts at F , instead of going back to E it goes back to D, C, B, and A in that order. So not only does it fail to load the previous room from the newly loaded file, but it retains the list of rooms from the old file. Loading into the new file after closing and re-opening the game simply causes the game to crash since the list has not been filled with any data.
EDIT: Solved it on my own. Apparently the navigation instance needs to be created after the init block. Feel free to close this.
- Eileen-Class Veteran
- Posts: 1311
- 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
Code: Select all
## Pseudo code init python: import renpy.store as ren_store # if instantiating before 0, you'd need to alias the store # best to just do that anyway class MyClass(object): """ Handle stuff """ def __init__(self, **kwargs): self.var = kwargs.get('var', 0) def __getattr__(self, name): if name == 'var': # Use store version only return ren_store.my_class_var or 0 # we *should* use __getattr__ here, alter if you get any recursion # I found getattr messes with @property methods though return super(MyClass, self).__getattribute__( name ) def __setattr__(self, name, value): if name == 'var': # set to the store ren_store.my_class_var = int( value ) else: # Other values (not held in the store) super(MyClass, self).__setattr__( name, value ) my_class = MyClass( var = 1 )
Just play a bit and see which works best for you.
- Finish Improved Event Handler
- Implement DragonBones animation as a Creator Defined Container
- Develop Cartoon Speech Bubble dialogue
- Finish Bitmask collision and rebound vector system
- Develop time based building mechanic
- *Find a superb artist and actually write a game*