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.

Contents

Objects

An object is in the class instance created by the engine or by scripts and available for access in the console.


isObject( handle )

Purpose
Use the isObject function to check if the name or ID specified in handle is a valid object.

Syntax
handle
– A name or ID of a possible object.

Returns
Returns true if handle refers to a valid object, false otherwise.

isObject(%player);



nameToID( objectName )

Purpose
Use the nameToID function to convert an object name into an object ID.

Syntax
objectName
– A string containing the name of an object.

Returns
Returns a positive non-zero value if the name corresponds to an object, or a -1 if it does not.

Notes
This function is a helper for those odd cases where a string will not covert properly, but generally this can be replaced with a statement like: ("someName")

nameToId(%player);



strToPlayerName( playerName );

Purpose
Use the strToPlayerName function to convert a string into a valid player name. It will remove various characters to include: comma (,), dot (.), back-slash (\), and tick (').

Syntax
playerName
– A string containing a candidate player name.

Returns
Returns a cleaned version of playerName that is suitable for networking and use by the engine in various instances.

%name = stripTrailingSpaces( strToPlayerName( %name ) );


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