Game Development Community

Iterating over files saved in the Application Data folder.

by Ian Smith · in Torque Game Builder · 08/03/2009 (6:17 pm) · 1 replies

So, TGB restricts file writing to the windows application data folder and only the application data folder. Yet, there seems to be no way to actually find that location and iterate over it manually. All I want to do is iterate over the save-game files the game creates using FileObject.

I've tried using findFirst/NextFile and it doesn't seem to transparently find the files in the AppData folder in the same way that the exec() function does.

Has anybody found a way to do this ?

Also, it should be noted that I'm using the latest version of the Platformer Starter Kit, if that changes anything.

#1
08/04/2009 (1:25 am)
I save my games in "game/save/<filename>.s", and then am able to use the findFirstFile/findNextFile with the pattern "game/save/*.s". These are all saved in the Application Data directory automatically and are retreived from the same. I didn't do anything special to get that behavior to work.

Make sure that you are running the game with the TGBGame executable and NOT the TorqueGameBuilder executable. TorqueGameBuilder makes assumptions about loading/saving into local directories.