Forum rules - please read before posting.

Global Var Link to Options Data - Reset when setting back to "none"?

Hi there!
I set a global var to "Link to - OptionsData", played around a bit and then set it back to "Link to - None" again. But everytime I started the game, the global variable was overwritten by the saved value. When the game was running, "Persistent Engine - Options (Script) - Linked Variables" still showed the value of the Global Var. I had to reset my options data to get this solved.

Wouldn't it make sense to reset the data of global vars when "Link to - None" is set again?

Comments

  • I don't see the harm of it being present in the options data until you reset - it won't affect the linked variable, and automatically resetting options data might annoy some users.
  • In my case, it took a while to figure out why the (formerly linked to options) global var changed everytime i started the game. I simply forgot about it because a few days passed since I linked and unlinked the var. But now I'm aware and it shouldn't be a problem anymore :)

    Another question: Is this, placed in a Custom Action, the right function for resetting the PlayerPrefs ingame?
    public static void DeleteAll();

    thx!
  • No - that doesn't mean anything.  You can't declare a function and run in at the same time.

    This isn't a scripting guide forum, but this would probably do it:

    PlayerPrefs.DeleteKey (ppKey);
    AC.KickStarter.options.SendMessage ("Awake");
               
  • Ok, I see. Thanks!
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.