Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Is there a cleaner way for storing variables across sessions aside from using the registry? Ideally it'd be a text file. I see ccbWrite/readto/fromFile is something which might be of use, but how would I make it read the file and check if a variable equals something and, if it does, then unlock specific levels / do certain things? |
||||
|
You need to parse the file. Whatever file format you are going to use, write it in and parse it to read it out. |
||||
|
Hmm... Yeah, this is confusing already :) hah. Damn I need to learn JavaScript since I'm as confused as someone trying to use a bow and arrow and hit a moving target with a blindfold covering my eyes... I tried this: ccbWriteFileContent (savegame.lvl, level1) ; and it said savegame.lvl and level1 were not defined. I'm guessing this is saying the things I entered weren't defined (it doesn't know what they are). It's a bit confusing... hmm |
||||
|
put quotation marks around savegame.lvl and level1 and see what happens. without them you are assuming they are declared variables. p.s. you probably dont exactly need to learn javascript to do this. |
||||
|
Great! That worked. hmm, now that I think of it, I don't know how I'd make it read the file, check if it equals a specific value (level1, level2, etc..) and, if so, do certain things. I very well may be best off using the registry since my idea of having actual files is a bit convoluted and far-reaching for me right now. hah |
||||
|
basically something like this... var checklevel = ccbReadFileContent("savegame.lvl"); i think it pretty much speaks for itself. |
||||
|
It works! Thanks! |
|