TorqueScript Console Functions 7
From TDN
Section Index
1. OpenAL || 2. Debugging || 3. String Manipulation || 4. Networking || 5. Console || 6. Device I/O || 7. File I/O
8. Packages || 9. Objects || 10. Event Scheduling || 11. Datablocks || 12. Video / Texturing || 13. Special || 14. Resource Management
15. Scene || 16. Containers and Raycasts || 17. Editors || 18. Build || 19. Time || 20. GUIs || 21. Math
|
This quick reference guide was taken directly out of The Game Programmer's Guide to Torque by Edward Maurina. It's an outstanding resource - a must for anyone wanting to get serious about programming in Torque.
[edit] File I/OTGE provides a file manager maintains a list of all files in the game directory and all sub-directories. The followings functions are used to access this list. In order manipulate (read/write) the contents of a file, see the console object 'fileObject', listed in the 'ConObjects Quick Reference' or refer to the 'TGE I/O' chapter of EGTGE. When a Torque game starts up a call, or calls are made to setModPaths(). This function is passed a game directories, separated by semi-colons (;). The file manager will examine each of these game paths and their sub-directories, building up a list of known files. This information is used later for relative pathing and file searching. Torque supports both direct pathing and relative pathing. Torque supports a single wildcard, the asterisk (*). This wild card can be interpreted to mean "zero or more instances of any chracter(s)". |
|
[edit] expandFilename( filename ) |
|
Purpose
expandFilename("~/data/sound/testing.wav");
|
|
[edit] fileBase( filename ) |
|
Purpose
fileBase("egt/main.cs"); // will return "main"
|
|
[edit] fileExt( filename ) |
|
Purpose
fileExt("script.cs"); // will return ".cs"
|
|
[edit] fileName( filename ) |
|
Purpose
fileName("egt/main.cs"); // will return "main.cs"
|
|
[edit] filePath( filename ) |
|
Purpose
filePath("common/ui/defaultProfiles.cs"); // Will return "common/ui"
|
|
[edit] findFirstFile ( pattern ) |
|
Purpose
findFirstFile("*.cs");
|
|
[edit] findNextFile ( pattern ) |
|
Purpose findNextFile( "*.cs" ); |
|
[edit] getFileCount ( pattern ) |
|
Purpose
getFileCount("*.cs");
|
|
[edit] getFileCRC( filename ) |
|
Purpose
getFileCRC("/fps/client/scripts/script/cs");
|
|
[edit] isFile( filename ) |
|
Purpose
isFile("/fps/client/scripts/script.cs");
|
|
[edit] isWriteableFileName( filename ) |
|
Purpose
isWriteableFileName("/fps/client/scripts/script.cs");
|
Section Index
1. OpenAL || 2. Debugging || 3. String Manipulation || 4. Networking || 5. Console || 6. Device I/O || 7. File I/O
8. Packages || 9. Objects || 10. Event Scheduling || 11. Datablocks || 12. Video / Texturing || 13. Special || 14. Resource Management
15. Scene || 16. Containers and Raycasts || 17. Editors || 18. Build || 19. Time || 20. GUIs || 21. Math



