Results 1 to 3 of 3

Thread: question about the saving command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default question about the saving command

    Anybody can help me,what's the meaning about the "false" in the script below?I saw that it's "true" sometimes,what's the difference between them?

    "cm:register_loading_game_callback(
    function(context)
    BOOL_should_expire = cm:load_value("BOOL_should_expire", false, context);
    end
    );"

  2. #2
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: question about the saving command

    The second argument in the load function is the default value to set the variable to if the load returns no existing value.

    In your example BOOL_should_expire will equal the default of false if that value has not been saved before and hence when trying to load it there is nothing to load.

    It also works with string loading:

    STRING_var = cm:load_value("STRING_var", "default", context);

  3. #3

    Default Re: question about the saving command

    Thanks a lot!Professional answer,that's what I need!I found some bugs in the scripts of "Wrath of Spata",I'm working on it and some of them have been solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •