Torque Console Script Command Reference 687
FindFirstFile (pattern)
Parameters: pattern
String pattern.
Return: string
The file's name.
Description:
Finds the name of the first file in the Torque Script file name buffer matching the
given
pattern
. Supports "*" to match any number of any characters and "?" to
match any single character.
Usage:
%result = FindFirstFile("/common/*.cs");
FindNextFile (pattern)
Parameters: pattern
String pattern.
Return: string
The file's name.
Description:
Finds the name of the next file in the Torque Script filename buffer matching the
search by immediately previous call to
FindFirstFile
. Supports '*' to match any
number of any characters and '?' to match any single character.
Usage:
%result = FindNextFile("/common/*.cs");
FirstWord(text)
Parameters: text
String with space-delimited words.
Return: string
Description:
Computes the center of a box.
Usage:
%c = GetBoxCenter("10,10,10,50,50,50");
GetBuildString()
Parameters: none
Return: string
Description:
Obtains the BUILD type (Release or Debug) of the current build.
Usage:
%bs = GetBuildString();
GetCompileTimeString()
Parameters: none
Return: string
Description:
Obtains the compile time and date of the current build.
Usage:
%ct = GetCompileTimeString();
GetControlObjectAltitude()
Parameters: none
Return: numeric
Description:
Obtains the altitude of the player object.
Usage:
%altitude = %player.GetControlObjectAltitude();
GetControlObjectSpeed()
Parameters: none
Return: numeric
Description:
Obtains the speed of the player object.
within
text
. In the usage example that follows, if
%text
equaled "Of Mice and Men", then
%word
would be set to "and" when the
function returned.
Usage:
%field = GetField(%text, 0);
GetFieldCount (text)
Parameters: text
String with field-delimited words.
Return: numeric
Description:
Gets the number of field-strings within
text
.
Usage:
%count = GetFieldCount( %text );
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A
■
The Torque Game Engine Reference690
GetFields(text, first [, last])
Parameters: text
String with space-delimited fields.
first
Field-based offset into the text string specifying the first field
String containing full file name.
Return: numeric
The
Cyclic Redundancy Check
(CRC) value.
Description:
Gets the CRC value of the file specified by
filename
.
Usage:
%crc = GetFileCRC("/common/server/script.cs");
GetJoystickAxes( instance )
Parameters: instance
The joystick object.
Return: string
Description:
Obtains the current axes of the joystick pointed to by
instance
.
Usage:
%joyAxes = GetJoystickAxes( 3 );
GetMaxFrameAllocation()
Parameters: none
Return: numeric
Description:
Gets the Max Frame Allocation unit.
Usage:
%maxFrameAlloc = GetMaxFrameAllocation();
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Obtains the current random seed.
Usage:
%seed = GetRandomSeed();
GetRealTime()
Parameters: none
Return: numeric
Description:
Gets the real time (in milliseconds) since this computer started.
Usage:
%rt = GetRealTime();
GetRecord (text, index)
Parameters: text
String with new line-delimited records.
index
Record-based offset into the text string.
Return: string
Contains the found record-string.
Description:
Gets the record-string at index within text. In the usage example that follows, if
%text
equaled "Of Mice and Men\nGrapes of Wrath\nCannery Row", then
%record
would be set to "Grapes of Wrath" when the function returned.
Usage:
%record = GetRecord(%text, 1);
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A
■
The Torque Game Engine Reference692
number of record-strings.
Usage:
%books = GetRecords(%obj.getTransform(), 0, 2);
GetResolution()
Parameters: none
Return: string
Description:
Obtains the current screen resolution.
Usage:
%res = GetResolution():
GetResolutionList(devicename)
Parameters:
devicename Name of the device to query.
Return: string
Description:
Obtains all available resolutions for the specified device.
Usage:
%rl = GetResolutionList(%device);
GetServerCount()
Parameters: none
Return: numeric
Description:
Gets the number of available servers from the master server.
Usage:
%sc = GetServerCount();
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Torque Console Script Command Reference 693
GetSimTime()
Parameters: none
Return: string
Description:
Gets the tag for the tagged string
tstring
.
Usage:
%tag = GetTag(%variable);
GetTaggedString(tag)
Parameters: tag
Numeric tag of string to be removed.
Return: string
Description:
Gets the string associated with
tag
.
Usage:
%name = GetTaggedString( %tagname );
GetTerrainHeight(pos)
Parameters: pos
2D coordinate.
Return: numeric
Description:
Gets the terrain height at the specified position.
Usage:
%height = GetTerrainHeight(%pos);
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A
■
The Torque Game Engine Reference694
%count = GetWordCount( %text );
GetWord(text, index)
Parameters: text
String with space-delimited words.
index
Word-based offset into the text string.
Return: string
Contains the found word-string.
Description:
Gets the word-string at
index
within
text
. In the usage example that follows, if
%text
equaled "Of Mice and Men", then
%word
would be set to "and" when the
function returned.
Usage:
%word = GetWord(%text, 2);
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Torque Console Script Command Reference 695
GetWords(text, first [, last])
Parameters: text
String with space-delimited words.
first
Word-based offset into the text string specifying the first word
to extract.
Tracks metrics data for OpenGL features.
Usage:
GLEnableMetrics(1);
GLEnableOutline(switch)
Parameters: switch
1 enables, 0 disables.
Return: nothing
Description:
Enables OpenGL wire-frame mode.
Usage:
GLEnableOutline(true);
GotoWebPage( address )
Parameters: address
URL of Web page.
Return: nothing
Description:
Opens default browser with specified address.
Usage:
GotoWebPage(" />Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A
■
The Torque Game Engine Reference696
IncreaseFSAA()
Parameters: none
Return: nothing
Description:
Invokes
IncreaseNPatch
.
Enables or disables logging of
DirectInput
events to log file
specified by string.
Usage:
InputLog(DI.log);
IsDemoRecording()
Parameters: none
Return: numeric
1 (or
true
) = enable, 0 (or
false
) = disable.
Description:
Queries if a demo is currently being recorded.
Usage:
%state = IsDemoRecording();
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Torque Console Script Command Reference 697
IsDeviceFullScreenOnly(devicename)
Parameters: devicename
Name of device to query
Return: numeric
1 = yes, 0 = no.
Description:
Queries if device is capable of full screen only.
Usage:
IsDeviceFullScreenOnly(%devicename);
Return: numeric
1 = yes, 0 = no.
Description:
Queries whether screen mode is set to full screen.
Usage:
%result = IsFullScreen();
IsJoystickDetected()
Parameters: none
Return numeric
1 =
true
,0 =
false
.
Description:
Determines if a joystick is present.
Usage:
%jd = IsJoystickDetected();
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Appendix A
■
The Torque Game Engine Reference698
IsKoreanBuild()
Parameters: none
Return: string
Description:
Korean registry key checker.
Usage:
%kb = IsKoreanBuild();
IsPointInside(point)
Parameters: point
"x y".
Return: numeric
1 =
true
,0 =
false
.
Description:
Queries if
point
is coincident with the interior of any object.
Usage:
%status = IsPointInside("123 345 25");
IsWriteableFileName(filename)
Parameters: filename
String containing full file name.
Return: numeric
1 =
true
,0 =
false
.
Description:
Queries if file specified by
filename
is writeable.
Usage:
%result = IsWriteableFileName("/common/server/script.cs");