Determining t3 filename at runtime

At runtime, is it possible for a TADS 3 program to figure out the filename of its own .t3 file?

Asking this for the sake of a code module I am planning to release. It could be put into this game or that, and it needs to store information to a save file, and it would be nice if the save filename could be similar to the .t3 filename without having to prompt the player or anything like that.



1 Like

I’m not aware of any functionality that will tell you the name of the game file.

You could enumerate all files in the current directory and search for one with .t3 as extension, but this will only work if there’s only one .t3 file. If the player downloads and puts multiple .t3 files in the same directory, then you can’t tell which one is yours just by the name. You’d need to identify it through other means (like computing a hash.)

Thanks, much appreciated… that seemed to be true from the best I could figure out.