- Sep 30, 2017
- 2,348
- 4,920
Hi, Still complete noob in Renpy/Python trying to help out someone:
So I have an Object
I instantiated an instance
So everything works perfectly
Then I decided to add a portrait to the object.
I updated the code where I instantiated an instance
So if I start a new game everything works fine.
But if I load a saved game. The TClaire object does not have a Portrait property
Is there a way after a load to force the object to be recreated?
(I don't really care about the saved values. The object consist of a mix of static values that will never change and other values that are updated ingame from other existing variables. I actually do not even want to save the object instances, but Renpy seems to do it automatically.)
Any hep will be appreciated.
So I have an Object
Code:
class Person:
def __init__ (self, fname, lname, age):
self.fname = fname # First Name for Characters
self.lname = lname # Last Name for Characters
self.age = age
Code:
default TClaire = Person("Claire","White,27)
Then I decided to add a portrait to the object.
Code:
class Person:
def __init__ (self, fname, lname, age,img):
self.fname = fname # First Name for Characters
self.lname = lname # Last Name for Characters
self.age = age # age of character
self.img = img #Portrait of character
Code:
default TClaire = Person("Claire","White,27,"Clare01.png")
But if I load a saved game. The TClaire object does not have a Portrait property
Is there a way after a load to force the object to be recreated?
(I don't really care about the saved values. The object consist of a mix of static values that will never change and other values that are updated ingame from other existing variables. I actually do not even want to save the object instances, but Renpy seems to do it automatically.)
Any hep will be appreciated.
Last edited: