Directory Loading
by Taylor Petrick · in Torque Game Engine · 08/20/2008 (6:37 am) · 2 replies
I'd like to have the engine load files from directories with numbers in them, and I don't want to have to write exec(path#); for every single one. These directories will be for patches, so they won't all be there in the first release. Anyways, can I do something like:
I know those functions may not actually exist, but would something like that work?
for %X{
ifDirectoryExists("scriptsAndAssets\data\patch"%X)
{
exec("scriptsAndAssets\data\patch"%X"\main.cs");
}
else{}
}I know those functions may not actually exist, but would something like that work?
About the author
#2
08/22/2008 (3:41 am)
The loadDirectory function is exactly what I needed. I'm using TGEA, just thought I'd post here as it seemed like a general Torque question. Thanks James.
Associate James Ford
Sickhead Games
Also findFirst/NextFile are mentioned Here. Even though thats a TGB article, those functions should work the same.