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

3D Game Programming All in One- P28

30 318 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 304,75 KB

Nội dung

Torque Console Script Command Reference 717 SetOpenGLMipReduction(level) Parameters: level Mipmap level (0 = minimum detail, 5 = maximum detail). Return: nothing Description: Sets shape texture detail to level. Usage: SetOpenGLMipReduction(2); SetOpenGLSkyMipReduction(level) Parameters: level Mipmap level (0 = minimum detail, 5 = maximum detail). Return: nothing Description: Sets skybox and cloud texture detail. Usage: SetOpenGLMipReduction(2); SetRandomSeed([seed]) Parameters: seed Starting point. Return: nothing Description: Sets the current starting point for generating a series of pseudo-random numbers. Usage: SetRandomSeed(); SetRecord (text, index, subst) Parameters: text String with new line-delimited records. index Record-based offset into the text string. subst Substitute string. Return: string The resultant string. Description: Substitutes the record-string sub for the record-string found at index in the string text . Usage: %str = SetRecord(%text, 0, "blah"); SetOpenGLTextureCompressionHint(hint) Parameters: hint The compression level hint. Choices: GL_DONT_CARE GL_FASTEST GL_NICEST Return: nothing Description: Suggests texture compression mode. Usage: SetOpenGLTextureCompressionHint(GL_NICEST); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference718 SetResolution(width, height, bpp) Parameters: width Screen width. height Screen height. bpp Bits per pixel. Return: numeric 1 = success, 0 = fail. Description: Sets the screen resolution to specified values. Usage: %result = SetResolution(640,480,32); SetScreenMode(width, height, bpp, fullScreen) Parameters: width Screen width. height Screen height. bpp Bits per pixel. fullScreen 1 enables, 0 disables. Return: numeric 1 = success, 0 = fail. Description: Sets up the screen with specified values. Usage: %result = SetScreenMode( 800, 600, 32, true ); SetServerInfo(index) Parameters: index Row of interest in the server list. Return: numeric 1 = success, 0 = fail. Description: Changes our indexed reference into the ServerList . Usage: %result = SetServerInfo(%index); SetShadowDetailLevel(level) Parameters: level Numeric range 0.0 to 1.0. Return: nothing Description: Sets the level of detail for shadows. Usage: SetShadowDetailLevel( 1.0 ); SetVerticalSync(switch) Parameters: switch 1 enables, 0 disables. Return: numeric 1 = true ,0 = false . Description: Enables or disables the use of VerticalSync . Usage: SetVerticalSync(true); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Torque Console Script Command Reference 719 SetZoomSpeed( speed ) Parameters: speed Transition speed. Ranges from 0 to 2,000 milliseconds. Return: nothing Description: Sets the transition speed when changing field of view. Usage: SetZoomSpeed( speed ); StartHeartbeat() Parameters: none Return: nothing Description: Begins periodic messages to the master server that show that this server is still alive. Usage: schedule(0,0,StartHeartbeat); StartRecording(filename) Parameters: filename String containing file name. Return: nothing Description: Records a demo and saves it as f ilename . Usage: StartRecording(myDemo); StopHeartbeat() Parameters: none Return: nothing Description: Stops the heartbeat messages. Usage: StopHeartbeat(); SetWord(text, index, subst) Parameters: text String with space-delimited words. index Word-based offset into the text string. subst Substitute string. Return: string The resultant string. Description: Substitutes the word-string sub for the word-string found at index in the string text . Usage: %str = SetWord(%text, 0, "blah"); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference720 StopRecording() Parameters: none Return: nothing Description: Stops the currently recording demo. Usage: StopRecording(); StopServerQuery() Parameters: none Return: nothing Description: Cancels the current query and marks outstanding pings as finished. Usage: StopServerQuery(); Strchr(str, char) Parameters: str String to be processed. char String containing the character to be found. Return: string Description: Finds the first substring in the string that begins with char . Usage: %file = Strchr("data/file.dat", "/" ); Strcmp(str1, str2) Parameters: str1 First string. str2 Second string. Return: numeric < 0 str1 is less than (also not equal to) str2 . 0 str1 is equal to str2. > 0 str1 is greater than (also not equal to) str2 . Description: Case- sensitive comparison of two strings: str1 and str2 . Usage: if ( Strcmp( %weaponName, "candlestick" ) == 0 ) return %weaponFound; Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Torque Console Script Command Reference 721 Stricmp(str1, str2) Parameters: str1 First string. str2 Second string. Return: numeric < 0 str1 is less than (not equal to) str2 . 0 str1 is equal to str2 . > 0 str1 is greater than (not equal to) str2 . Description: Case- insensitive comparison of two strings: str1 and str2 . Usage: if ( Stricmp(%weaponName, "CandleStick") == 0 ) return %weaponFound; StripChars(str, chars) Parameters: str String to be processed. chars String containing characters to be stripped. Return: string The processed resultant string. Description: Removes all characters in the string chars from the string str . Usage: %stripped = StripChars(%value, "~" ); StripMLControlChars(string) Parameters: string Return: string Description: Strips ML special control characters from string. Usage: %text = StripMLControlChars(%string); StripTrailingSpaces(string) Parameters: string Input string. Return: string Description: Strips trailing spaces and underscores from string to be used for player name. Usage: %name = StripTrailingSpaces( strToPlayerName( %name ) ); Strlen(str) Parameters: str String. Return: numeric Description: Obtains the number of characters in str. Usage: %len = Strlen(%weaponName); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference722 Strlwr(str) Parameters: str String to be processed. Return: string The processed resultant string. Description: Converts all characters in str to lowercase. Usage: %var = Strlwr(%value); Strpos(str, target[, offset]) Parameters: str String to be searched. target String to find. offset Starts search at offset. (optional) Return: numeric Description: Finds the first occurrence of the target string in the search string, with optional starting offset. Note: This function is identical to strstr when offset isn't used. Usage: %pos = Strpos(%weaponName, "gun") ; Strreplace(str, target, subst) Parameters: str String to be processed. target Target string to be replaced. subst Substitute string. Return: string The processed resultant string. Description: Replaces all instances of target and replaces with subst . Usage: %dospath = Strreplace(%path, "/", "\"); Strstr(str, target) Parameters: str String to be tested. target Target substring to find. Return: numeric Offset within str where target was found. Description: Finds first occurrence of a target within string . Usage: %loc = Strstr( %weaponName, "stick" ); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Torque Console Script Command Reference 723 StrToPlayerName(string); Parameters: string Player name string. Return: string Description: Converts name string to properly formatted player name string. Proper formatting means the player name is limited to 16 characters in length. Leading and trailing spaces are trimmed; reserved characters are removed. Usage: %newname = StrToPlayerName( %name ); Strupr(str) Parameters: str String to be processed. Return: string The processed resultant string. Description: Converts all characters in str to uppercase. Usage: %var = Strupr(%value); SwitchBitDepth() Parameters: none Return: numeric 1 = success, 0 = fail. Description: Switches between 16 and 32 bits per pixel in full-screen mode. Usage: %result = SwitchBitDepth(); TelnetSetParameters( port, consolePW, listenPW ) Parameters: port Connection port. consolePW Console password. listenPW "Listener" password. Return: nothing Description: Initializes telnet connection request parameters. Usage: TelnetSetParameters(4123, "garage", "games"); ToggleFullScreen() Parameters: none Return: numeric 1 = success, 0 = fail. Description: Switches between windowed mode and full-screen mode. Usage: %result = ToggleFullScreen(); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference724 ToggleInputState() Parameters: none Return: nothing Description: Toggles DirectInput state between enabled and disabled . Also prints the new input state (same as echoInputState ) to the console. Usage: ToggleInputState(); ToggleNPatch() Parameters: none Return: nothing Description: Toggles the enable/disable state of Npatch . Usage: ToggleNPatch(); Trace(switch) Parameters: switch 1 (or true ) enables, 0 (or false ) disables. Return: nothing Description: Turns execution trace on or off. Usage: Trace(true); Trim(str) Parameters: str String to be processed. Return: string The processed resultant string. Description: Strips any white space from str from the left or right sides (before and after all other characters) of str . White space is defined as space, carriage returns, or new line characters. Usage: %tidystring = Trim(%yuckystring); ValidateMemory() Parameters: none Return: nothing Description: Ensures sufficient memory available for the program. Usage: ValidateMemory(); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Torque Console Script Command Reference 725 VectorAdd(vector1, vector2) Parameters: vector1 "x y z". vector2 "x y z". Return: string Description: Adds vector2 to vector1 . Usage: %result = VectorAdd("87.21 54.11 10.0", "9.99 12.6 6.00"); VectorCross(vector1, vector2) Parameters: vector1 "x y z". vector2 "x y z". Return: string Description: Computes the cross product between two vectors. Usage: %product = VectorCross("x y z","x y z"); VectorDist(vector1, vector2) Parameters: vector1 "x y z". vector2 "x y z". Return: string Description: Computes the distance between two vectors. Usage: %delta = VectorDist(%vector1, %vector2); VectorDot(vector1, vector2) Parameters: vector1 "x y z". vector2 "x y z". Return: string Description: Computes the dot product between two vectors. Usage: %product = VectorDot("0 0 1",%eye); VectorLen(vector) Parameters: vector "x y z". Return: string Description: Computes the length of the vector. Usage: %len = VectorLen(vector); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Appendix A ■ The Torque Game Engine Reference726 VectorNormalize(vector) Parameters: vector "x y z". Return: string Description: Normalizes a vector. Usage: %nvector = VectorNormalize("5 10 30"); VectorOrthoBasis(vector) Parameters: vector "x y z". Return: string Description: Computes the orthogonal normal for a vector. Usage: %normal = VectorOrthoBasis("x y z angle"); VectorScale(vector, scalar) Parameters: vector "x y z". scalar Can be an integer or a floating point. Return: string Description: Computes the result of the vector sized by the scale. Usage: %svector = VectorScale("5 10 30", 100); VectorSub(vector1, vector2) Parameters: vector1 "x y z". vector2 "x y z". Return: string Description: Subtracts vector2 from vector1 . Usage: %result = VectorSub("34.0989 989.3249 100.00", %position); VideoSetGammaCorrection(gamma) Parameters: gamma Gamma correction setting. Return: nothing Description: Sets the gamma correction. Usage: VideoSetGammaCorrection(0.5); Team LRN Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... LRN Game Development Web Sites Game Development Web Sites 3D Café 3D models and resources http://www.3dcafe.com 3D Today Magazine 3D modeling tutorials, resources, and articles http://3dtoday.com 3Dup.com 2D and 3D models and resources http://www.3dup.com AngelCode Game development and more http://www.angelcode.com CFXweb Game design, tutorials, and resources http://www.cfxweb.net CodeGuru Programming. .. Professional training in the field of video game production and development http://www.gameinstitute.com Gamer's Technical Resources Game development news, articles, and resources http://knockout.ww4.us:7979/index.php iDevGames Game development news, articles, and resources http://www.idevgames.com insert credit Gaming news, articles, reviews, and resources http://www.insertcredit.com International Game Developers... http://www.gamasutra.com Game Developer Magazine Game development news, articles, and resources http://www.gdmag.com Game Developers Conference GDC news and promotional information http://www.gdconf.com Game Developer's Lair Game development news, articles, and resources http://www.gamedeveloper.net GameDev.net Game development news, articles, and resources http://www.gamedev.net Team LRN Game Development Web Sites Game Institute... textList.getRowText(index) textList.removeRow(index) textList.rowCount() textList.scrollVisible(index) textList.sort(colId{,increasing}) textList.sortNumerical(colId{, increasing}) textList.findText(text) Team LRN continued 731 732 Appendix A ■ GuiTreeViewCtrl HTTPObject InteriorInstance Item Lightning MessageVector PhysicalZone Player Precipitation SceneObject ShapeBase The Torque Game Engine Reference... a choice in a switch block Causes execution to continue at top of loop Indicates that the following code block defines a datablock Indicates the choice to make in a switch block when no cases match Indicates start of a do-while type loop block Indicates alternative execution path in an if statement Evaluates to 0, the opposite of true Indicates start of a for loop Indicates that the following code... Association Game development news, articles, and resources for independent developers http://www.igda.com Linux Game Development Center Game development news, articles, and resources http://lgdc.sunsite.dk Linux Game Tome Game development news, articles, and resources http://www.happypenguin.org Team LRN 745 746 Appendix B ■ Game Development Resources on the Internet Machinima.com Real-time 3D animation... SimDataBlock GameBaseData GameBaseData ShapeBaseData GameBaseData GameBaseData GameBaseData GameBaseData none GameBaseData Team LRN continued Torque Reference Tables StaticShapeData TSShapeConstructor TriggerData VehicleData WheeledVehicleData WheeledVehicleSpring WheeledVehicleTire ShapeBaseData SimDataBlock GameBaseData ShapeBaseData VehicleData SimDataBlock SimDataBlock Team LRN 739 This page intentionally... query, post) [InteriorObject].activateLight() [InteriorObject].deactivateLight() [InteriorObject].echoTriggerableLights() [InteriorObject].getNumDetailLevels() [InteriorObject].setDetailLevel(level) obj.isStatic() obj.isRotating() obj.setCollisionTimeout(object) obj.getLastStickyPos() obj.getLastStickyNormal() [LightningObject].warningFlashes() [LightningObject].strikeRandomPoint() [LightningObject].strikeObject(id)... LRN Appendix B Game Development Resources on the Internet J ust about everything you could possibly need to know regarding game development can be found on the Internet But then, you probably already knew this! I've listed in this appendix every link from my own personal bookmark folder of game development resources, as well as a ton more recommended by friends Of course, this is certainly not an exhaustive... succumb to "link rot." I think you will find these resources useful Torque-Related Web Sites ActionRPG RPG-related enhancements for Torque http://www.actionrpg.com BraveTree Productions ThinkTanks home http://www.bravetree.com 741 Team LRN 742 Appendix B ■ Game Development Resources on the Internet GarageGames Home of the Torque Engine http://www.garagegames.com Gnometech Torque modeling and other . processed. char String containing the character to be found. Return: string Description: Finds the first substring in the string that begins with char . Usage:. gfsc.frameBorder(index, enable) gfsc.frameMovable(index, enable) gfsc.frameMinExtent(index, w, h) GuiInspector inspector.inspect(obj) inspector.apply(newName)

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

TỪ KHÓA LIÊN QUAN