Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualbuumchakalaka

Posted 15 December 2012 - 01:16 PM

Hi, Im stack with one code:
I have an array with 8 maps: ObjectMap map[8].
Each map have a member "bool unlock".
First, 7 maps are locked, when the player reach many objectives the maps become unlock.
I want to make a file like this (for save the state of the maps):

MapsState.txt
0 true
1 true
2 true
3 true
4 false
5 true
6 true
7 true

So, how can I write and read this file using fstreams?
I need map[0] get the bool state 0 from the file, map[1], bool state 1, etc.

Thanks for the help!

#2buumchakalaka

Posted 15 December 2012 - 01:14 PM

Hi, Im stack with one code:
I have an array with 8 maps: ObjectMap map[8].
Each map have a member "bool unlock".
First, 7 maps are locked, when the player reach many objectives the maps become unlock.
I want to make a file like this (for save the state of the maps):

MapsState.txt
0 true
1 true
2 true
3 true
4 false
5 true
6 true
7 true

SO, how can I write and read this file using fstreams?
I need map[0] get the bool state 0 from the file, map[1], bool state 1, etc.

Thanks for the help!

#1buumchakalaka

Posted 15 December 2012 - 01:10 PM

Hi, Im stack with one code:
I have an array with 8 maps: ObjectMap map[8].
Each map have a member "bool unlock".
First, 7 maps are locked, when the player reach many objectives the maps become unlock.
I want to make a file like this (for save the state of the maps):

MapsState.txt
0 true
1 true
2 true
3 true
4 false
5 true
6 true
7 true

So, I know how to save this file, but I dont know how to read.
I need map[0] get the bool state 0 from the file, map[1], bool state 1, etc.

Thanks for the help!

PARTNERS