foleyjo wrote:Cheers gogo.
1 question about that - What exactly does the r+b bit mean?
Also I just realised the array I wish to save I have set up in the global code and not used the variable option in game-editor. I'll explain why with the section of code
- Code: Select all
const int maxlevels = 3;
int BLevelComplete[maxlevels]; //This array needs to be saved
int LevelX[maxlevels] = {960,-320,320};
int LevelY[maxlevels] = {-720,-240,-240};
How would I go about saving this? Would I need to recreate it using the Variable option.
(on a different note I keep pressing the + to give you a point but all it is doing is refreshing the page)
r+b means Read (binary mode), w+b means Write (binary mode), you can omit the +b so it's in "normal" mode... I don't really know the difference but I always use binary mode.
Hmmm... if you're not used with scripting, it might be hard for you to understand... but if you need to use those kinds of variable saving, you're better off creating the variable in the variable box and use the GE functions, just make sure your array is big enough as I don't think you can use constants for the size.
if you wanted to do it the hard way you'd need to understand how the << and >> bit wise operations work and about variable size in bits and byte.