Parameters: noneReturn: stringDescription: Obtains the compile time and date of the current build.. Return: numericDescription: Gets the number of field-strings within text.. If count is
Trang 1FindFirstFile (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
givenpattern 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 The resultant string
Description: Gets the first word-string within text
Usage: %tgt = FirstWord(%text);
FlushTextureCache()
Parameters: noneReturn: nothingDescription: Deletes cached textures from memory
Usage: FlushTextureCache();
FreeMemoryDump()
Parameters: noneReturn: nothingDescription: Prints free memory statistics
Usage: FreeMemoryDump();
Trang 2Parameters: noneReturn: stringDescription: Obtains the compile time and date of the current build
Usage: %ct = GetCompileTimeString();
GetControlObjectAltitude()
Parameters: noneReturn: numericDescription: Obtains the altitude of the player object
Usage: %altitude = %player.GetControlObjectAltitude();
GetControlObjectSpeed()
Parameters: noneReturn: numericDescription: Obtains the speed of the player object
Usage: %speed = %player.GetControlObjectSpeed();
Trang 3Parameters: noneReturn: stringDescription: Reports the current desktop resolution
Usage: %res = GetDesktopResolution():
GetDisplayDeviceList()
Parameters: noneReturn: stringDescription: Obtains the device name for each display device
Usage: %name = GetDisplayDeviceList();
GetField(text, index)
Parameters: text String with field-delimited words
index Field-based offset into the text string
Return: string Contains the found field-string
Description: Gets the field-string at index within text In the usage example that follows, if
%textequaled "Of Mice and Men", then %wordwould be set to "and" when the function returned
Usage: %field = GetField(%text, 0);
GetFieldCount (text)
Parameters: text String with field-delimited words
Return: numericDescription: Gets the number of field-strings within text
Usage: %count = GetFieldCount( %text );
Trang 4GetFields(text, first [, last])
Parameters: text String with space-delimited fields
first Field-based offset into the text string specifying the first field
to extract
last Field-based offset into the text string specifying the last field
to extract
Return: string Contains the found fields
Description: Gets one or more field-strings at index within text If count is specified, gets count
GetFileCRC(filename)
Parameters: filename String containing full file name
Return: numeric TheCyclic 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: stringDescription: Obtains the current axes of the joystick pointed to by instance
Usage: %joyAxes = GetJoystickAxes( 3 );
GetMaxFrameAllocation()
Parameters: noneReturn: numericDescription: Gets the Max Frame Allocation unit
Trang 5Parameters: noneReturn: stringDescription: Gets the current Mod path
Usage: $mp = GetModPaths();
GetRandom([[max]|[min,max]])
Parameters: max High limit (optional)
min Low limit (optional)Return: numeric Ranged from 0 to 1, exclusive, if no parameters given,
otherwise, see description
Description: Computes a pseudo-random number If min is not included, then 0 is the
minimum If max is not included, then 4,294,967,296 (highest 32-bit number minus 1) is the maximum
Usage: %random = GetRandom(1,99);
GetRandomSeed()
Parameters: noneReturn: numericDescription: Obtains the current random seed
Usage: %seed = GetRandomSeed();
GetRealTime()
Parameters: noneReturn: numericDescription: 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
%textequaled "Of Mice and Men\nGrapes of Wrath\nCannery Row", then
%recordwould be set to "Grapes of Wrath" when the function returned
Trang 6GetRecordCount (text)
Parameters: text String with new line-delimited records
Return: numericDescription: Get the number of record-strings within text
Usage: %count = GetRecordCount( %text );
GetRecords (text, first [, last])
Parameters: text String with new line-delimited records
first Record-based offset into the text string specifying the first
record to extract
last Record-based offset into the text string specifying the last
record to extract
Return: string Contains the found records
Description: Gets one or more record-strings at index within text If count is specified, gets
count number of record-strings
Usage: %books = GetRecords(%obj.getTransform(), 0, 2);
GetResolution()
Parameters: noneReturn: stringDescription: Obtains the current screen resolution
Usage: %res = GetResolution():
GetResolutionList(devicename)
Parameters: devicename Name of the device to query
Return: stringDescription: Obtains all available resolutions for the specified device
Usage: %rl = GetResolutionList(%device);
GetServerCount()
Parameters: noneReturn: numericDescription: Gets the number of available servers from the master server
Trang 7Parameters: noneReturn: numericDescription: Gets the current game time
Usage: %st = GetSimTime();
GetSubStr(str, loc, count)
Parameters: str String to be processed
loc Offset into str to get start of substring from
count Number of characters to get
Return: string The processed resultant string
Description: Gets the substring of string that begins at loc, continuing for count characters or
to the end of the string, whichever comes first
Usage: %sub = GetSubStr(%text, 5, 99);
GetTag(tstring)
Parameters: tstring Tagged string
Return: stringDescription: Gets the tag for the tagged string tstring
Usage: %tag = GetTag(%variable);
GetTaggedString(tag)
Parameters: tag Numeric tag of string to be removed
Return: stringDescription: Gets the string associated with tag
Usage: %name = GetTaggedString( %tagname );
GetTerrainHeight(pos)
Parameters: pos 2D coordinate
Return: numericDescription: Gets the terrain height at the specified position
Usage: %height = GetTerrainHeight(%pos);
Trang 8Parameters: noneReturn: numericDescription: Obtains the hard-coded engine version number of the current build
Usage: %vn = GetVersionNumber();
GetVersionString()
Parameters: noneReturn: stringDescription: Obtains the hard-coded engine version string of the current build
Usage: %vs = GetVersionString ();
GetVideoDriverInfo()
Parameters: noneReturn: stringDescription: Gets device driver information
Usage: %info = GetVideoDriverInfo();
GetWordCount(text)
Parameters: text String with space-delimited words
Return: numericDescription: Gets the number of word-strings within text
Usage: %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
%textequaled "Of Mice and Men", then %wordwould be set to "and" when the function returned
Usage: %word = GetWord(%text, 2);
Trang 9GetWords(text, first [, last])
Parameters: text String with space-delimited words
first Word-based offset into the text string specifying the first word
to extract
last Word-based offset into the text string specifying the last word
to extract
Return: string Contains the found words
Description: Gets one or more word-strings at index within text If count is specified, gets count
Usage: GLEnableLogging(true);
GLEnableMetrics(switch)
Parameters: switch 1 enables, 0 disables
Return: nothingDescription: Tracks metrics data for OpenGL features
Usage: GLEnableMetrics(1);
GLEnableOutline(switch)
Parameters: switch 1 enables, 0 disables
Return: nothingDescription: Enables OpenGL wire-frame mode
Usage: GLEnableOutline(true);
GotoWebPage( address )
Parameters: address URL of Web page
Return: nothingDescription: Opens default browser with specified address
Usage: GotoWebPage("http://www.tubettiworld.com/");
Trang 10Parameters: noneReturn: nothingDescription: Invokes IncreaseNPatch.Usage: IncreaseFSAA ()
IncreaseNPatch()
Parameters: noneReturn: nothingDescription: IncrementsNpatchlevel by 1
Usage: IncreaseNPatch();
InitContainerRadiusSearch (loc, radius, mask)
Parameters: loc 3D coordinate
radius To be searched
mask Mask of object type to look for
Return: nothingDescription: Searches for objects of type mask within a radius around the location
Usage: InitContainerRadiusSearch("0 450 76", %somerad, DebrisObjectType);
InputLog(filename)
Parameters: filename String containing file name
Return: nothingDescription: Windows Only: Enables or disables logging of DirectInput events to log file
specified by string
Usage: InputLog(DI.log);
IsDemoRecording()
Parameters: noneReturn: numeric 1 (or true) = enable, 0 (or false) = disable
Description: Queries if a demo is currently being recorded
Usage: %state = IsDemoRecording();
Trang 11Usage: %status = IsEventPending($eventid);
IsFile(filename)
Parameters: filename String containing full file name
Return: numeric 1 = true, 0 = false.Description: Queries if the file exists in the Torque Script file name buffer
Usage: %result = IsFile("/common/server/script.cs");
IsFullScreen()
Parameters: noneReturn: numeric 1 = yes, 0 = no
Description: Queries whether screen mode is set to full screen
Usage: %result = IsFullScreen();
IsJoystickDetected()
Parameters: noneReturn numeric 1 = true, 0 = false.Description: Determines if a joystick is present
Usage: %jd = IsJoystickDetected();
Trang 12Parameters: noneReturn: stringDescription: Korean registry key checker
Usage: %kb = IsKoreanBuild();
IsObject(handle)
Parameters: handle Handle of supposed object
Return: numeric 1 = true, 0 = false.Description: Queries if handle is an object
Usage: %status = IsObject(%chopper);
IsPackage(name)
Parameters: name String containing the name of the package.Return: numeric 1 = true, 0 = false
Description: Queries if name is a registered package
Usage: %status = IsPackage(Show);
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");
Trang 13LaunchDedicatedServer(missionType, map, botCount )
Parameters: missionType Game- or Mod-specific string
map Mission or map name string
botCount Number of AI bots allowed
Return: nothingDescription: Starts dedicated game server with specified arguments
Usage: LaunchDedicatedServer(mymission,damap,0);
LightScene(completion)
Parameters: completion Completion callback
Return: numeric Function handleDescription: Lights the current mission using the callback function pointed to by completion
when mission lighting is finished
Usage: %result = LightScene("CompletionCallback")
lockMouse(switch)
Parameters: switch 1 (or true) = lock, 0 ( or false) = unlock
Return: nothingDescription: Toggles the mouse state
Usage: lockMouse(true);
ltrim(str)
Parameters: str String to be processed
Return: string The processed resultant string
Description: Strips any white space from str from the left side (before any other characters) of
str White space is defined as space, carriage returns, or new line characters
Usage: %tidystring = ltrim(%yuckystring);
mAbs(x)
Parameters: x Operand Can be an integer or a floating point
Return: numericDescription: Computes the absolute value of x
Usage: %val = mAbs(76.3);
Trang 14Parameters: x Radian Can be an integer or a floating point.Return: numeric
Description: Computes the arc cosine
Usage: %val = mAcos(2.0);
makeTestTerrain(filename)
Parameters: filename String containing file name
Return: nothingDescription: Makes a test terrain file
Usage: makeTestTerrain("testfile");
mAsin(x)
Parameters: x Radian Can be an integer or a floating point.Return: numeric
Description: Computes the arc sine
Usage: %val = mAsin(1.5);
mAtan(x,y)
Parameters: x Radian Can be an integer or a floating point
y Radian Can be an integer or a floating point.Return: numeric
Description: Computes the arc tangent
Usage: %val = mAtan(-1.667,2);
Trang 15Usage: %mtx = MatrixCreate("10 10 30", "30 40 50 10");
MatrixCreateFromEuler (valstring)
Parameters: valstring "x y z"
Return: stringDescription: Generates a matrix from given arguments
Usage: %val = MatrixCreateFromEuler("5.5 90 200");
MatrixMulPoint(matrix, point)
Parameters: matrix
pointReturn: stringDescription: Multiplies a matrix by a point
Usage: %mtx = MatrixMulPoint(%matrix,%point);
Trang 16MatrixMultiply(matrixA, matrixB)
Parameters: matrixA
matrixBReturn: stringDescription: Multiplies two matrices
Usage: %mtx = MatrixMultiply(matrix1,matrix2);
MatrixMulVector(matrix, vector)
Parameters: matrix
vectorReturn: stringDescription: Multiplies a matrix by a vector
Usage: %mtx = MatrixMulVector(matrix,vector);
mCeil(x)
Parameters: x Operand Can be an integer or a floating point
Return: numericDescription: Finds the smallest integral value greater than or equal to the operand
Usage: %val = mCeil(%dialogHeight / %textHeight);
mCos(x)
Parameters: x Radian Can be an integer or a floating point
Return: numericDescription: Computes the cosine
Usage: %val = mCos(69);
mDegToRad(degrees)
Parameters: degrees Degrees to be converted Can be an integer or a floating point.Return: numeric
Description: Converts degrees to radians
Usage: %rads = mDegToRad(90);
Trang 17mFloatLength(x, len)
Parameters: x Operand Can be an integer or a floating point
len Number of decimal places
Return: numericDescription: Returns x as a floating point value with len decimal places
Usage: %mypi = mFloatLength((21/7),8);
mFloor(x)
Parameters: x Operand Can be an integer or a floating point
Return: numericDescription: Finds the largest integral value less than or equal to the operand
Usage: %val = mFloor(%dialogHeight / %textHeight);
mLog(x)
Parameters: x Radian Can be an integer or a floating point
Return: numericDescription: Computes the natural logarithm
Usage: %val = mLog(7654.98);
mPow(x,y)
Parameters: x Base Can be an integer or a floating point
y Exponent Can be an integer or a floating point
Return: numericDescription: Computesx raised to the power of y
Usage: %val = mPow(2,4);
mRadToDeg(radians)
Parameters: radians Radians to be converted Can be integers or floating points
Return: numericDescription: Converts radians to degrees
Usage: %degs = mRadToDeg(1);