Torque Console Objects 13
From TDN
[edit] Console Objects Fields and Methods Quick Reference Part 13
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. [edit] SimSet |
This is a generic container class for SimObjects. It provides a basic set of console methods for storing and accessing SimObjects contained in the set. Any SimObject may be contained in multiple SimSets
Console Methods
| add | bringToFront | clear | getCount |
| getObject | isMember | listObjects | pushToBack |
| remove |
|
add( obj1 , ... ) |
|
Purpose |
|
bringToFront( object ) |
|
Purpose |
|
clear() |
|
Purpose |
|
getCount() |
|
Purpose |
|
getObject( index ) |
|
Purpose |
|
isMember( object ) |
|
Purpose |
|
listObjects() |
|
Purpose |
|
pushToBack( object ) |
|
Purpose |
|
remove( obj1 , ... ) |
|
Purpose |
Sky
Fields
| Field Name | Description | Sample or Range |
| cloudHeightPer0 | Relative height of layer 0 clouds. | [ 0.0 , cloudHeightPer1 ] |
| cloudHeightPer1 | Relative height of layer 1 clouds. | [ cloudHeightPer0 , cloudHeightPer2 ] |
| cloudHeightPer2 | Relative height of layer 2 clouds. | [ cloudHeightPer1 , 1.0 ] |
| cloudSpeed1 | Cloud scrolling vs. windVelocity multiplier for layer 0 clouds. | [ 0.0 , inf.0 ) |
| cloudSpeed2 | Cloud scrolling vs. windVelocity multiplier for layer 1 clouds. | [ 0.0 , inf.0 ) |
| cloudSpeed3 | Cloud scrolling vs. windVelocity multiplier for layer 2 clouds. | [ 0.0 , inf.0 ) |
| cloudText[0,2] | -- | Not used |
| fogColor | Color of general fog. | "1.0 0.5 0.5 1.0" |
| fogDistance | Affects fog density as a ratio of visibleDistance. | [ 0.0 , inf.0 ) |
| fogStorm1 | Enables fog storm fading of layer 0. | [ false , true ] |
| fogStorm2 | Enables fog storm fading of layer 1. | [ false , true ] |
| fogStorm3 | Enables fog storm fading of layer 2. | [ false , true ] |
| fogVolume1 | Layer 0 fog definition. | "dist low-elev high-elev" |
| fogVolume2 | Layer 1 fog definition. | "dist low-elev high-elev" |
| fogVolume3 | Layer 2 fog definition. | "dist low-elev high-elev" |
| fogVolumeColor[1:3] | -- | Not used |
| materialList | Path to sky DML file. | dml file path |
| noRenderBans | If set to true, the sky box is not allowed to be fogged out. | [ false , true ] |
| renderBottomTexture | If set to true, the bottom texture in the DML file will be rendered. | [ false , true ] |
| SkySolidColor | The color for the untextured sky box. | "r g b a" (float) |
| useSkyTextures | Enables sky box texture rendering. | [ false , true ] |
| visibleDistance | Maximum render distance. | [ 0.0 , inf ) |
| windEffectPrecipitation | If set to true, wind will blow precipitation. | [ false , true ] |
| windVelocity | Magnitude and direction of wind. | “1.5 2.0 0.0†|
Globals
| Variable Name | Description | Sample or Range |
| pref::CloudOutline | Enable or disable cloud outlining. | [ false , true ] |
| pref::CloudsOn | Enables clound rendering. | [ false , true ] |
| pref::NumCloudLayers | Limits number of clound layers that are rendered. | [ 0 , 3 ] |
| pref::SkyOn | Enables the sky. | [ false , true ] |
Console Methods
| getWindVelocity() | realFog() | setWindVelocity() | stormClouds() |
| stormCloudsShow() | stormFog() | stormFogShow() |
|
getWindVelocity() |
|
Purpose |
|
setWindVelocity( x , y , z ) |
|
Purpose |
|
stormClouds( show , duration ) |
|
Purpose
|
|
stormCloudsShow( show ) |
|
Purpose |
|
stormFog( percent , duration ) |
|
Purpose
|
|
stormFogShow( show ) |
|
Purpose |
SpawnSphere
Mission marker used to mark drop points. Can be used for many things. The fields in this object are only used by scripts, not the engine.
Fields
| Field Name | Description | Sample or Range |
| indoorWeight | Only used by scripts. | any float |
| outdoorWeight | Only used by scripts. | any float |
| radius | Only used by scripts. | any float |
| sphereWeight | Only used by scripts. | any float |
Splash
No fields or methods to discuss.
SplashData
Fields
| Field Name | Description | Sample or Range |
| acceleration | The acceleration of the splash, as used in the physical simulation. Affects the splash's velocity over time, along with the gravitational force acting in the system. | ( -inf.0 , inf.0 ) |
|
colors[0] |
Array of colors. Specifies what colors are to be used for splash rings at each time value specified in the times array field. First entry in the colors array corresponds to the initial ring color, and is interpolated with colors[1] until times[0] time has elapsed, at which time colors[1] is the draw color and it begins being interpolated with colors[2]. See the times and ringLifetime field documentation for more information. | "1.0 0.5 0.5" |
| delayMS | Note: this field currently has no tangible effect in the engine's simulation. | -- |
| delayVariance | Note: this field currently has no tangible effect in the engine's simulation. | -- |
| ejectionAngle | The angle at which new splash rings should be ejected, specified in degrees. | ( -inf.0 , inf.0 ) |
| ejectionFreq | The frequency with which new splash rings should be created. | ( -inf.0 , inf.0 ) |
|
emitter[0] |
Array of pointers to ParticleEmitterData datablocks which specify the particle emissions to be used for the Splash object. | see type |
| explosion | ExplosionData datablock, which will be used to spawn an explosion for the splash. | see type |
| height | This field currently has no tangible effect in the engine's simulation. | -- |
| lifetimeMS | Used along with lifetimeVariance to determine the maximum time the Splash object persists in the world. Measured in whole milliseconds. | |
| lifetimeVariance | Used along with lifetime to determine the maximum time the Splash object persists in the world. The Splash object's actual life-time is calculated by adding the lifetime field with a random integer from -1*lifetimeVariance to lifetimeVariance. A Splash object will be marked as dead once it's life-time expires, but a Splash object will not delete itself until its ring life-time has expired as well; see the documentation for the ringLifetime field for more information. Using lifetimeVariance, separate Splash objects sharing the same SplashData datablock can be given varied behavior. | ( -inf , inf ) |
| numSegments | The number of segments used to generate each ring of the splash. Each segment has an associated splash ring texture u-coordinate, which is calculated by dividing the segment's position in the splash ring's segment list by the total number of the ring's segments, and then multiplying this result by the scalar value in the texWrap field. | ( -inf , inf ) |
| ringLifetime | The life-time, in seconds, of splash rings generated by the Splash object. Also used during the rendering of splash rings to determine the opacity of the ring; the ring starts out fully transparent, and follows a linear progression to become fully opaque at the mid-point of its life-time, after which time a linear fall-off in opacity occurs until the end of the ring's life-time, at which point it is once again fully transparent. a Splash object will not delete itself until all ring's it has generated have expired. | |
| scale | Note: this field currently has no tangible effect in the engine's simulation. | -- |
| soundProfile | Note: this field currently has no tangible effect in the engine's simulation. | |
| startRadius | The inital radius with which to eject splash rings, affected by velocity over time. | ( -inf.0 , inf.0 ) |
| texFactor | Scalar value used to translate the v-coordinate value of texture reads from the splash rings texture during their rendering. texFactor is not applied directly to scale v-coordinate reads, as the texWrap field is. Rather, texFactor is multiplied with the non-integer portion of the elapsed time (elapsedTime - int(elapsedTime)) to determine the v-coordinate texture position to be read for the splash ring.escription. | ( -inf.0 , inf.0 ) |
| texture | The texture file to be used for the splash rings. | ~/path/filename.png |
| texWrap | Scalar value used along with numSegments to determine the u-coordinate value of texture reads from the splash rings texture during their rendering. See the numSegments field documentation for more information. | ( -inf.0 , inf.0 ) |
|
times[0] |
Array of time values. Each entry is used to help determine the color used in rendering splash rings, as described in the colors field documentation. | ( -inf.0 , inf.0 ) |
| velocity | The velocity of the splash, as used in physical simulation. Affects the radius of the splash over time, and the velocity of splash rings. Velocity changes over time in accordance with the value specified with the acceleration field, and the gravity affecting the physical simulation. | ( -inf.0 , inf.0 ) |
| width | Note: this field currently has no tangible effect in the engine's simulation. | -- |
StaticShape
A concrete class derived from ShapeBase used to reprsent world objects.
Console Methods
| getPoweredState() | setPoweredState() |
|
getPoweredState() |
|
Purpose |
|
setPoweredState( isPowered ) |
|
Purpose |
StaticShapeData
Datablock associated with StaticShape object class.
Fields
| Field Name | Description | Sample or Range |
| dynamicType | An integer value which, if speficied, is added to the value returned by getType(). | See dynamicType below |
| noIndividualDamage | Boolean value used as a hint to scripts, to NOT apply damage to this shape. | -- |
Sun
Mission object representing mission lighting parameters.
Fields
| Field Name | Description | Sample or Range |
| ambient | Color / Intensity of ambient light. | "r g b i" (float) |
| azimuth | Azimuth of sun. | [ 0, 360 ] |
| color | Color / Intensity of direct light. | "r g b i" (float) |
| elevation | Inclination (elevation) of sun. | [ 0, 360 ] |
TCPObject
Console Methods
| connect | disconnect | listen |
|
connect( addr ) |
|
Purpose |
|
disconnect() |
|
Purpose |
|
listen( port ) |
|
Purpose |
|
send( ... ) |
|
Purpose |
Table of Contents || Part 1 || Part 2 || Part 3 || Part 4 || Part 5 || Part 6 || Part 7 || Part 8 || Part 9 || Part 10 || Part 11 || Part 12 || Part 14 || Part 15



