Forum rules - please read before posting.

Simple Save System

I'm working now on a mini game, a very simple one and I don't want to complicate things too much with saves, so I was wondering if I can do something like this:

I have a variable called : unlocked_levels:Int = 0
When I finish level 1 I change my unlocked_levels to 1 and so on. However when I exit the game and come back I want my game to know about this unlocked_level variable, or when I go to the Main Menu I can choose from whatever levels I would like to. I was looking to the save action, but I wasn't sure what should I do there

Comments

  • If you store the value as a Global Integer variable, it'll be saved automatically.

    You can either remove your own script variable and replace calls to it with:

    AC.GlobalVariables.GetIntegerValue (id);
    AC.GlobalVariables.SetIntegerValue (id, value);

    Or you can set the AC variable's Link to field to Custom Script, and have it synchronise with your script variable.  See the "Variable scripting" and "Global variable linking" chapters of the Manual for more information about both of these approaches.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.