Game Development Community

openFileDialog not returning file path

by Max vE · in Torque 3D Professional · 09/06/2014 (5:03 pm) · 1 replies

I'm trying to implement a basic save/load system into my game, and I figured I'd use openFileDialog because the user could just select the save file they wish to load. I've set it up just as it shows, with the addition of calling another function with the file path to do the actual loading. However, when I run %openFileDlg.execute(), and then set %filePath = %openFileDlg.file/filename, I just get a blank string.

It says it needs a tools build of Torque, which I'm assuming I'm using. Any ideas?
Thanks.

#1
09/07/2014 (5:30 am)
If you can open a file in the world editor, chances are you are setting up the dialog wrong. Examining the code you use to create %openFileDlg might provide some insight.

On a related note, I should point out that the native file dialog might not be the best option for creating a save/load game system since it causes the game to hang while you are using it.