Help with file save functions.

BlitzMax Forums/BlitzMax Beginners Area/Help with file save functions.

DCI(Posted 2007) [#1]
Im making a Eventually, multiplayer game, where you will mine minerals, do research into weapons design, then build vehicles and outfit them with various weapons. i need to know several things ive not been able to find..

1. is there a tutorial on file save functions?

2. Each person playing will have a unique Player ID, when a person creates an account, is there a way to have blitz assign them a sequential player id? Also, once blitz determines their player id #, i want it to create "0000001.dat" file, their user id named text file.

3. once their text file is created, how can i have blitz write their game variables to the text file?

4. how can i have blitz read their text file, retrieve the data from the text file, and have it organized? retrieving the fact that they have, say, 8 units of iron ore, 12 units of diamonds, etc.

also each unit in their army will have various values that will change during combat, and stay that way untill repaired. How much ammunition is left in left machine gun, how much is left in right machine gun.. armor remaining on front.. movement rate, etc.. How can i have blitz locate the correct unit id, and change the correct 'database' value entry to reflect it's new status?

sorry, im a significant newb when it comes to these type of functions. please help!


Perturbatio(Posted 2007) [#2]
1. Code Archives->File Utilities

2. a thread discussing generating unique IDs

2b. [a http://www.google.co.uk/search?q=site%3Ablitzbasic.com+generate+a+unique+id&ie=utf-8&oe=utf-8&rls=org.mozilla:en-GB:official&client=firefox-a]how I found it[/a]

3. see 1

4. see 3

5. http://www.blitzbasic.com/Community/posts.php?topic=59937