Game Development Community

TGB 1.7.4 findFirstFile buggy in Debug build

by James Ford · in Torque Game Builder · 10/01/2008 (12:14 am) · 2 replies

I noticed that my behaviors were not getting executed and took a look at _initializeProject.

To load behaviors it first uses findFirstFile to compile the behavior files. This was finding my behavior, compiling it, and putting that dso in appdata.

Next it tries a findFirstFile with the the *.cs.dso wildcard. This was NOT finding the behavior file it just compiled!

Out of curiosity I build a release exe and ran it, found the dso! So something somewhere is causing findFirstFile to NOT check the appdata folder in debug builds, at least that's my guess.

#1
10/01/2008 (4:52 am)
My understanding of the file system in Torque is that the engine needs to know about a path and its contents (through addResPath) before it understands that there is a file there. For example: You create a folder "myFolder" put a file "myFile1" in the folder and call addResPath("myFolder") then create "myFile2" in that path. The engine recognises that there is a file there called "myFile1", but not "myFile2".

What I imagine *should* happen is that when you compile a script file, the engine should recognise the new file, but it may not be the case. I suspect you encountered that, in the first run of your exe, the .dso files were created but not recognised by the engine. The next time you run the exe, the files are already there.

I could, of course, misunderstand the whole resource path idea all together, but that is how I have always seen it.
#2
10/01/2008 (11:59 am)
Repeated runs of the debug build continue to find the .cs file in the project folder and compile it, but never the dso in appdata.

What you described matches my understanding of the resource system, and its quite possible that's where the bug lies.