hi, I created this type of variable:
but defining it like this:
changing the value with:
saving by closing the game and loading the save, the variable returns to the pre-set value 50.
moreover, if I go backwards at the point where the value increases, the value continues to increase.
Could you help me?
Python:
## Friendship
class Friendship():
def __init__(self, friendship):
self.friendship = friendship
def changeFriendship(self, amt):
self.friendship += amt
if amt > 0:
notify(increase_friendship_notify)
else:
notify(decrease_friendship_notify)
if self.friendship < -100:
self.friendship = -100
elif self.friendship > 100:
self.friendship = 100
Python:
define john_friendship = Friendship(50)
Python:
$ john_friendship .changeFriendship(4)
moreover, if I go backwards at the point where the value increases, the value continues to increase.
Could you help me?