Does anyone know how NWN determines the .SAV file name when you save a game you are playing?
I am trying to tie it back to the .MOD file name and the relationship is not obvious to me.
For example, NWN saves Dark Energy as Dark Energy v1.00.sav, while mod name is Dark Energy.mod.
Many thanks for any help.
Presumably using the module name as defined in the module properties, not the file name.
That seems to match my example.
Only trouble is I can’t see how to retrieve the Module Name from the Mod File. I have managed to read the Mod Description, but I can’t figure out how to get the offset for the Module Name.
If you have any ideas, I would be most appreciative.
It’s in the module.ifo file in the mod so you’d need to extract that and pull it from there. It’s a gff file. I use Niv’s ruby tools to convert things like that to yaml to read/modify them. The new nim based tools will do it too but since they don’t speak yaml I have not bothered to play with that much.
Probably won’t be able to use that - I need to read it from an application, but will take a look in case it helps me figure out how to find the IFO file offset from the beginning of the file.
Applications can use other tools
I mean I need an API.
What I would really like to do is retrieve the MOD file name by reading the SAV file.
Need to do some more research now that I have asked the correct question. However, looking at the SAV file with Leto, did not highlight the mods filename - so it may not be possible.
The nim tools also expose a C API. Liareth has some that have a modern C++ API: https://github.com/Liareth/NWNFileFormats
You can also just call the nim tools directly and parse the text output.
SAV file should just be the MOD with all the changes applied.
Many thanks for the info and link.
Still need to establish whether the MOD file name is stored in the SAV or MOD file as apposed to the name used for the SAV file. So far as I can tell, it is not held in the either file, but I could be wrong.
Any insights will be appreciated.
The module file name is not stored anywhere. The filename can be changed arbitrarily and will still work. Once saved the original file is not needed anymore.
Many thanks for that information.
I guess I will leave NIT’s current mechanism of linking a SAV name to the MOD file name as it is. The only other alternative would be read all the MOD files to find the save name and that is probably too much overhead.