-
January 08, 2015, 06:56 AM
#1
Laetus
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
);"
-
January 09, 2015, 02:28 AM
#2
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);
-
January 09, 2015, 04:58 AM
#3
Laetus
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
-
Forum Rules