Game Development Community

File IO Error, I'm saving to game folder and I dont want to

by Adam Griffiths · in Torque Game Builder · 06/24/2008 (9:57 am) · 4 replies

Hello All,

I'm just compiling a High Scores system for my game using the advanced highscores method. I've previously used this before in a prototype game and it didn't cause me any errors at all.
However, on this game, I did a new recompile so we could use our own icon within the demo we've since distributed.
My problem is that I've literally copied the highscores functionality over to the new project but whenever it seems to look for and save the file, it goes to the root directory eg game/gameScripts/hscores.sav to look and save.
I don't want it to do that, I want it to work as it did previously saving the data in the app directory! Is it possible that by recompiling i've screwed up the saving and loading of text files?

#1
06/25/2008 (3:30 am)
Just to bump this, this is wha my console method says:
Missing file: C:/Torque/Cosmic Sunder/game/hscores.sav!

I dont know how its done this as its exactly the same as the other game (which i can still run and still runs perfectly so i cant see it being the engine corrupt). I've also tried to copy over the common directory from the old game to the new one, that doesnt work, ive checked all my commonConfig files, they're no different apart from name of product.
How and where could i have changed this to write to the wrong folder? I'm completely lost and without writing to the right folder my game is virtually unshippable :(
#2
06/25/2008 (8:18 am)
Are these projects using different version of TGB? Before umm, 1.5.1 or 1.6 TGB did not save/load from appdata.
#3
06/25/2008 (8:46 am)
No they're both on 1.7.2, i thought it could be that because we upgraded to 1.7.3 for a while but the trigger issue meant i had to change it back again. I'm thinking that I must have messed up the build somehow although i have no idea where so I might build it again from fresh. Its absolutely bizarre because some people want theirs to save in the program files but i dont lol! Don't want the general public to be able to change their stats and things!
#4
06/25/2008 (10:34 am)
Also could it be that the file doesn't exist in either location? Although the error says C:/.., it may have look in appdata first and not found it there either. Now if saving is clearly creating a file in your game folder, then somethings really screwy.