I'm using a variable to determine what will show in a phone chat. The way it works is that there's a Vbox and things show up based on the variable value, which is incremented by 1 everytime you click on the screen outside of the chat.
I'm declaring my variable in the script file, before anything else, at the top of the file as:
Then this is the way it's incremented:
Code: Select all
key "dismiss" action [(SetVariable ("var_chat", var_chat+1))]
It does increment and stuff show up on the Vbox, but everytime I load the save file or close the game, the variable is set back to 0.
What am I doing wrong?
EDIT: I'm using this variable inside a screen and not through labels.