1. Trang chủ
  2. » Công Nghệ Thông Tin

3D Game Programming All in One- P27

30 394 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 30
Dung lượng 323,8 KB

Nội dung

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 The resultant string. Description: Gets the first word-string within text . Usage: %tgt = FirstWord(%text); FlushTextureCache() Parameters: none Return: nothing Description: Deletes cached textures from memory. Usage: FlushTextureCache(); FreeMemoryDump() Parameters: none Return: nothing Description: Prints free memory statistics. Usage: FreeMemoryDump(); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference688 GetBoxCenter(box) Parameters: box String containing two 3D tuples defining the box. 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. Usage: %speed = %player.GetControlObjectSpeed(); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Torque Console Script Command Reference 689 GetDesktopResolution() Parameters: none Return: string Description: Reports the current desktop resolution. Usage: %res = GetDesktopResolution(): GetDisplayDeviceList() Parameters: none Return: string Description: 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 %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 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 number of field-strings. Usage: %position = GetFields(%obj.getTransform(), 0, 2); GetFileCount (pattern) Parameters: pattern String pattern. Return: numeric Description: Gets the number of files in the Torque Script file name buffer that match pattern . Usage: %count = GetFileCount("/common/server/*.cs"); GetFileCRC(filename) Parameters: filename 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. Torque Console Script Command Reference 691 GetModPaths() Parameters: none Return: string Description: 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: none Return: numeric Description: 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 GetRecordCount (text) Parameters: text String with new line-delimited records. Return: numeric Description: 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: 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: numeric Description: 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: 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 GetVersionNumber() Parameters: none Return: numeric Description: Obtains the hard-coded engine version number of the current build. Usage: %vn = GetVersionNumber(); GetVersionString() Parameters: none Return: string Description: Obtains the hard-coded engine version string of the current build. Usage: %vs = GetVersionString (); GetVideoDriverInfo() Parameters: none Return: string Description: Gets device driver information. Usage: %info = GetVideoDriverInfo(); GetWordCount(text) Parameters: text String with space-delimited words. Return: numeric Description: 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 %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. 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 number of word-strings. Usage: %position = GetWords(%obj.getTransform(), 0, 2); GLEnableLogging(switch) Parameters: switch 1 enables, 0 disables. Return: nothing Description: Enables OpenGL logging to gl_log.txt. Usage: GLEnableLogging(true); GLEnableMetrics(switch) Parameters: switch 1 enables, 0 disables. Return: nothing Description: 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("http://www.tubettiworld.com/"); 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 . Usage: IncreaseFSAA () IncreaseNPatch() Parameters: none Return: nothing Description: Increments Npatch level 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: nothing Description: 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: nothing Description: Windows Only: 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. [...]... String containing file name nothing Makes a test terrain file makeTestTerrain("testfile"); mAsin(x) Parameters: Return: Description: Usage: x Radian Can be an integer or a floating point numeric Computes the arc sine %val = mAsin(1.5); mAtan(x,y) Parameters: Return: Description: Usage: x Radian Can be an integer or a floating point y Radian Can be an integer or a floating point numeric Computes the arc... (port,flags,gametype,missiontype,minplayers,maxplayers, maxbots,regionmask,maxping,filterflags,mincpu,buddycount,buddylist) Parameters: port flags gametype missiontype minplayers maxplayers maxbots regionmask maxping filterflags Return: Description: Usage: Master server port The query flags Choices: 0x00 = online query 0x01 = offline query 0x02 = no string compression Game type string Mission type string Minimum... RemoveRecord (text, index) Parameters: Return: Description: Usage: text String with new line-delimited records index Record-based offset into the text string string The resultant string Removes the record-string at index from text %str = RemoveRecord(%text, 0); RemoveTaggedString(tag) Parameters: Return: Description: Usage: tag Numeric tag of string to be removed nothing Removes a tagged string from the list... RemoveTaggedString(%tagname); RemoveWord(text, index) Parameters: Return: Description: Usage: text String with space-delimited words index Word-based offset into the text string string The resultant string Removes the word-string at index from text %str = RemoveWord(%text, 0); ResetLighting() Parameters: Return: Description: Usage: none nothing Resets the current lighting ResetLighting(); Team LRN... (or false) disables nothing Enables or disables File Load echo to console SetEchoFileLoads(1); SetField(text, index, subst) Parameters: Return: Description: Usage: text String with field-delimited words index Field-based offset into the text string subst Substitute string string The resultant string Substitutes the field-string sub for the word-string found at index in the string text %rec = SetField(%text,... Can be an integer or a floating point numeric Computes the absolute value of x %val = mAbs(76.3); Team LRN 699 700 Appendix A ■ The Torque Game Engine Reference mAcos(x) Parameters: Return: Description: Usage: x Radian Can be an integer or a floating point numeric Computes the arc cosine %val = mAcos(2.0); makeTestTerrain(filename) Parameters: Return: Description: Usage: filename String containing file... be an integer or a floating point numeric Computes the sine %val = mSin(65); mSolveCubic(a,b,c,d) Parameters: Return: Description: Usage: a,b,c,d Operands Can be integers or floating points string Computes a cubic solution for x ax^3 + bx^2 + cx + d = 0 %val = mSolveCubic(a,b,c,d); mSolveQuadratic(a,b,c) Parameters: Return: Description: Usage: a,b,c Operands Can be integers or floating points string... Parameters: Return: Description: Usage: name String containing the name of the package numeric 1 = true, 0 = false Queries if name is a registered package %status = IsPackage(Show); IsPointInside(point) Parameters: Return: Description: Usage: point "x y" numeric 1 = true, 0 = false Queries if point is coincident with the interior of any object %status = IsPointInside("123 345 25"); IsWriteableFileName(filename)... MatrixCreateFromEuler (valstring) Parameters: Return: Description: Usage: valstring "x y z" string Generates a matrix from given arguments %val = MatrixCreateFromEuler("5.5 90 200"); MatrixMulPoint(matrix, point) Parameters: Return: Description: Usage: matrix point string Multiplies a matrix by a point %mtx = MatrixMulPoint(%matrix,%point); Team LRN 701 702 Appendix A ■ The Torque Game Engine Reference MatrixMultiply(matrixA,... String with space-delimited words string The resultant string Returns the words remaining after the first word in text %data = RestWords(%text); Rtrim(str) Parameters: Return: Description: str String to be processed string The processed resultant string Strips any white space from str from the right side (after all other characters) of str White space is defined as space, carriage returns, or new line . A ■ The Torque Game Engine Reference688 GetBoxCenter(box) Parameters: box String containing two 3D tuples defining the box. Return: string Description:. 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

Ngày đăng: 29/10/2013, 01:15