Hey guys… i was thinking about an easy way to do a save game… i dont know if anyone had this same idea before i dont mean to claim as mine or something… but lets hear it :
does unity has any feature that allows the stand alone product to create a txt file?.. and more importantly… if it does… does unity can read those txt files via scripting interpreting what is writen on then?
if it does… then my save game sistem can work… look… all you gotta do is to make a save point in your game… this save point will have a script that creates that txt file… now… depending on your stats, diferente texts will be writen in the txt file… for example… the player has 5 granades… and he is on map… 3… with… 59 % of health
so you write this on the txt file
grandes : 5
map : 3 (cordinates too )
health 59
ok… your game is saved!. now for the load game phase…
when you are on the main menu of your game, you will create a load game option, when the player select it… a script will look for that txt file in a specified folder where the user as unpacked your game… if it does not find the txt… it will say : NO SAVED GAMES if/when it finds the txt file… it will read… and interpretate whats on it
like…a switch with many many cases
if the txt file has writen map 3, then “aplication loadlevel 3”… if the txt file has writen health 59 %… then you acess the global var health and change to 59%. (off course you will have to do this 100 times)
its a bit of a hard work… but i dont see why wouldnt work =D
what you guys think??
and more importantly… please tell me if unity can create and read txt files!