Game Development Community

ExpandFileName Issue?

by Christopher Franklin · in Torque Game Builder · 08/01/2007 (2:12 pm) · 0 replies

So we think we've found a problem with the function expandFileName in TGB 1.5.0. In attempting to get fonts to behave in a way we'd like, we discovered that the expandFileName didn't seem to be doing its job properly in the onExit() function in /common/main.cs. Specifically, the output we would get from

_saveGameConfigurationData( expandFileName("./commonConfig.xml") );

was:

XML::beginWrite - Failed to write to filecommon/commonConfig.xml.

We spent a while scratching our heads as to why this would happen, especially since we had one of our projects working and the other not. Eventually we realized the core difference between the two projects was that one of ours was made by selecting "create executable in the game directory" and the other was not - it simply had TorqueGameBuilder.exe copied over and renamed. For some reason the TorqueGameBuilder.exe in C:\Program Files\Garage Games\TorqueGameBuilder\tgb\ lets this function run fine, and the executable that TGB.exe places in your game directory doesn't. Copying the .exe over solves the expandFileName problem, but causes additional problems with getModPath and setModPath (which for the moment we've simply commented out).

We just thought we'd post to give everyone a heads up and see if anyone else can shed some light on what's going on. There also seems to be a typo in /common/gameScripts/projectManagement.cs, as one of the lines reads:

%userDatablockFile = expandFilename("^game/gameScripts/datablocks.cs");

I'm pretty certain that carrot isn't supposed to be there, as once we found the fix to the expandFilename issue this line started coming up in the error reports.