Product Chat / Help With Save/Load

Author
Message
Nevin
9
Years of Service
User Offline
Joined: 19th May 2015
Location: U.S.A
Posted: 5th Sep 2016 02:34 Edited at: 5th Sep 2016 02:44
I am relatively new to coding and was wondering how to add certain variables I have created to the save/load script.

I have not played around with io.write or io.open yet. So I figured it would be best to ask first before trying.

My reasoning behind this is save/load does not save custom variables, so it will not save a timer.. If the player were to save and then load, the timer would be the same as when the player went to load, not when they saved.. If the player were to leave the game and start with a fresh start, the timer would reset, along with any other custom variables.

So the Save/Load that we have now is okay. But it does not completely work for the project i am working on. If I could add my own to save and then load, I think this would fix my problem.

EDIT: I know it can be done. I'm just not sure how to do it. Where to add it. I understand io.open, opens a file and io.write im assuming writes the info in a file that will be opened once the player loads with io.open.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 5th Sep 2016 03:52
Right now save load will save and load any variable with g_in front of it.
Ex: g_yourvariablename.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Login to post a reply

Server time is: 2024-09-28 23:11:00
Your offset time is: 2024-09-28 23:11:00