Hey everyone.
I've currently got a game on Early Access on Steam, and I'm having a bit of trouble in regards to rolling out new releases of the game. People are able to use their old save games no problem at first, but as soon as they come across a new variable that hasn't been defined for them as it's been added in a new update, the game crashes.
Is there any way to set a default value for all of these variables, so that if they aren't defined the game either assumes their value is 0 or 'true' so that the game can continue? I've already got some workarounds in mind but it would be good if there was an easy fix for this.
Cheers
Lach
Setting default variables on loading an old save?
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.
- Zet
- Regular
- Posts: 26
- Joined: Wed Feb 13, 2013 12:48 am
- Completed: Max's Big Bust
- Organization: Lached Up Games
- Contact:
Setting default variables on loading an old save?
Check out Max's Big Bust on Steam - http://store.steampowered.com/app/416360
Re: Setting default variables on loading an old save?
Someone can correct me if I'm wrong, but I believe if you use the code:
default varaiblename = intialvalue
Then if that variable does not already have a value then it will take on that initial value and should work for your purposes. It's a fairly recent addition to the system, so it isn't as well documented as some of the other methods. You can apparently even put these lines wherever you like in the code, so like right next to a relevant section, and they still go into effect at launch.
default varaiblename = intialvalue
Then if that variable does not already have a value then it will take on that initial value and should work for your purposes. It's a fairly recent addition to the system, so it isn't as well documented as some of the other methods. You can apparently even put these lines wherever you like in the code, so like right next to a relevant section, and they still go into effect at launch.
- Zet
- Regular
- Posts: 26
- Joined: Wed Feb 13, 2013 12:48 am
- Completed: Max's Big Bust
- Organization: Lached Up Games
- Contact:
Re: Setting default variables on loading an old save?
Thanks for the info Onishion, that's super helpful!
Cheers
Lachlan
Cheers
Lachlan
Check out Max's Big Bust on Steam - http://store.steampowered.com/app/416360
Who is online
Users browsing this forum: No registered users