Torque Console Objects 7
From TDN
[edit] Console Objects Fields and Methods Quick Reference Part 7
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] LightningData |
This is the datablock associated with the lightning object, it is used to specify the bitmap textures and the sounds use with the lightning object.
Fields
| Field Name | Description | Sample or Range |
| strikeSound | Audio profile to play on strike. | AudioProfile datablock |
|
strikeTexture[0] |
Texture data to use when using textured lightning. | ~/path/filename.png |
|
thunderSounds[0] |
Audio profiles for thunder sounds. | AudioProfile datablock |
Marker
This marker is used for building paths used by the PathCamera and other path following objects.
Fields
| Field Name | Description | Sample or Range |
| msToNext | Milliseconds to next marker in sequence. | ( 0 , inf ) |
| seqNum | Marker position in sequence of markers on this path. | [ 0 , 40 ) |
| smoothingType | Path smoothing at this marker/knot. “Linear†means no smoothing, while “Spline†means to smooth. |
“Linear†|
| type | Type of this marker/knot. A “normal†knot will have a smooth camera translation/rotation effect. “Position Only†will do the same for translations, leaving rotation un-touched. Lastly, a “Kink†means the rotation will take effect immediately for an abrupt rotation change. |
“Normal†|
MissionArea
This object is used represent the outer bounds of the mission area. This is a reactive region in that, a callback will be entered each time an object enters or leaves the mission area. Please see the callbacks quick reference for information on these callbacks.
Fields
| Field Name | Description | Sample or Range |
| Area |
Four floating point values <Xl Yl Xw Yw> representing: |
“ 0.0 0.0 1024.0 512.0†|
| flightCeiling | This value is used to specify the elevation at which a flying vehicles power. That is, when a flying vehicle reaches this elevation it will not be able to thrust vertically any longer. | [ 0.0 , inf.0 ) |
| flightCeilingRange | This value is used to specify a range below the flight ceiling at which a flying vehicle's to thrust begins to taper off. | [ 0.0 , flightCeiling ] |
MissionMarker
This class is used to represent generic marker in the game world.
NetConnection
This is the parent object to GameConnection. We do not create instances of net connection, but it is important to note that this class exists and provides several features which are available through the GameConnection class.
Globals
| Variable Name | Description | Sample or Range |
| pref::Net::PacketRateToClient | Limits the packet rate from server to client. | [ 1 , 32 ] |
| pref::Net::PacketRateToServer | Limits the packet rate from client to server. | [ 8 , 32 ] |
| pref::Net::PacketSize | Limits the size of any one packet. | [ 100 , 450 ] |
Console Method Summaries
| checkMaxRate | clearPaths | connect |
| connectLocal | getAddress | getGhostID |
| getGhostsActive | getPacketLoss | getPing |
| resolveGhostID | resolveObjectFromGhostIndex | setSimulatedNetParams |
Console Methods
|
checkMaxRate() |
|
Purpose |
|
clearPaths() |
|
Purpose |
|
connect( remoteAddress ) |
|
Purpose |
|
connectLocal() |
|
Purpose |
|
getAddress() |
|
Purpose |
|
getGhostsActive() |
|
Purpose |
|
getPacketLoss() |
|
Purpose |
|
getPing() |
|
Purpose |
|
setSimulatedNetParams( packetLoss , delay ) |
|
Purpose |
|
transmitPaths() |
|
Purpose |
NetObject
Console Method Summaries
| clearScopeToClient | getGhostID | scopeToClient |
Console Methods
|
clearScopeToClient( client ) |
|
Purpose |
|
scopeToClient( client ) |
|
Purpose |
|
setScopeAlways() |
|
Purpose |
ParticleData (PD)
This is the datablock used to represent individual particles. This datablock is subsequently used by particle emitter data to produce particle effects. Torque provides a variety of particle effects. Particles may be animated sequences of textures, a single fixed texture, a colorized or non-colorized texture.
Fields
| Field Name | Description | Sample or Range |
| animateTexture | Use textures beyond | [ false , true ] |
|
animTexName[0] |
Textures used when animating textures. Note: animTexName[0] == textureName |
~/path/filename.png |
|
colors[0] |
Key-framing color controls for particles. | "1.0 0.5 0.5 1.0" |
| constantAcceleration | Acceleration applied to particle per second over particle lifetime. | ( -inf.0 , inf.0 ) |
| dragCoefficient | Drag multiplier (total drag == particle velocity * dragCoefficient). | ( -inf.0 , inf.0 ) |
| framesPerSec | Texture animation frames per second. | ( -inf , inf ) |
| gravityCoefficient | Gravity multiplier. | ( -inf.0 , inf.0 ) |
| inheritedVelFactor | Velocity multiplier (inherited velocity == emitter velocity * inheritedVelFactor). | ( -inf.0 , inf.0 ) |
| lifetimeMS | Time this particle lives in milliseconds. ( Total lifetime == lifetimeMS +/- rand( lifetimeVarianceMS ) ). | ( -inf , inf ) |
| lifetimeVarianceMS | Random amount by which lifetime varies. | ( -inf , inf ) |
|
sizes[0] |
Key-framing size controls for particles. | ( -inf.0 , inf.0 ) |
| spinRandomMax | Maximum degrees for randomized angular spin about billboard's normal. | ( -inf.0 , inf.0 ) |
| spinRandomMin | Minimum degrees for randomized angular spin about billboard's normal. | ( -inf.0 , inf.0 ) |
| spinSpeed | Degrees-per-second spin rate about billboard's normal. | ( -inf.0 , inf.0 ) |
| textureName | Texture to use for non-animated particles. | ~/path/filename.png |
|
times[0] |
Key-framing time controls for particles. |
[ 0.0, times[1] ] |
| useInvAlpha | Invert alpha components in texture(s). | [ false , true ] |
| windCoefficient | Amount by which wind effects particle velocity. | ( -inf.0 , inf.0 ) |
ParticleEmitterData
Fields
| Field Name | Description | Sample or Range |
| ejectionOffset | Each particle is given an ejection direction at which to be emitted, and ejectionOffset specifies the distance in this direction from the particle emitter a particle will be emitted at. This field's value must be non-negative, otherwise a console warning is generated and the value is forced to 0.0. The actual ejectionOffset value used is only guaranteed to be within 0.01 of the value used, and values greater than 655 are not possible. | ( -inf.0 , inf.0 ) |
| ejectionPeriodMS | Used along with periodVarianceMS to determine the frequency with which to emit particles. See the periodVarianceMS field for more details. Stored with only 10 bits of precision, so values above 1023 are not possible. If value is less than 1, a console warning is generated and the value is forced to 1. | ( -inf , inf ) |
| ejectionVelocity | Used along with velocityVariance to determine the initial velocity at which a particle is emitted. See the velocityVariance field documentation for more details. This field's value must be non-negative, otherwise a console warning is generated and the value is forced to 0.0. The actual value used is only guaranteed to be within 0.01 of the value specified, and values larger than 655 are not valid. | ( -inf.0 , inf.0 ) |
| lifetimeMS | Used with lifetimeVarianceMS to determine the total life-time of each emitted particle. Measured in milliseconds. This field's value must be greater than zero, otherwise a console warning is generated and the value is forced to one. To save network transmission bandwidth, the value of lifetimeMS is shifted-right 5 bits, implying a loss of precision. Thus, the lifetime value used may be up to 31 milliseconds less than the value specified. After being shifted, the value is clamped to 10-bits of precision as well; thus, values of more than about 32000 milliseconds will not behave as expected. | ( -inf , inf ) |
| lifetimeVarianceMS | Used with lifetimeMS to determine the total life-time of each emitted particle. Measured in milliseconds. Each time a particle is created, a random number between -1*lifetimeVarianceMS and lifetimeVarianceMS is generated and added to lifetimeMS to determine the particle's total lifetime. This field's value must be no greater than that of lifetimeMS, otherwise a console warning is generated and the value is clamped. The lifetimeVarianceMS value is shifted and stored with 10-bit precision in the exact manner that lifetimeMS's value is. | ( -inf , inf ) |
| orientOnVelocity | Only applicable when orientParticles is True. Specifies whether emitted particles will be checked for velocity. If True, and the particle has no velocity, it will not be rendered. If True, and the particle has a velocity, the velocity magnitude will affect the particle's rendered size. False means that the particle's velocity will not affect the rendered size. | [ false , true ] |
| orientParticles | Specifies whether emitted particles should be oriented as billboards (always face directly towards the camera), or if they should face the emission direction (see the field documentation for thetaMin, thetaMax, phiReferenceVel, and phiVariance for more information on emission direction). True means the particles should be oriented toward the emission direction, False means particles should be oriented as billboards. | [ false , true ] |
| overrideAdvance | Specifies whether a newly created particle's acceleration, color, and other settings should begin being updated immediately after it is created. If false, the new particle is updated immediately. If true, the particle's time advancement system is initially deferred. | [ false , true ] |
| particles | String containing a tab-delimited list of ParticleData datablock names. When a particle is emitted from the emitter, its datablock is randomly selected from the list of valid datablocks supplied in the particles field string. The string must be non-empty and at least one token must evaluate to a valid ParticleData datablock name. String must also be less than 256 characters long. If either of these conditions is not met, a console warning will be produced and the datablock's onAdd() method will fail. | see type |
| periodVarianceMS | Used along with ejectionPeriodMS to determine the frequency with which to emit particles. Each time a particle is emitted, a random value between -1*periodVarianceMS and periodVarianceMS is generated and added to ejectionPeriodMS to determine the time at which to emit the next particle. So, with the default values ejectionPeriodMS = 100 and periodVarianceMS = 0, particles would be emitted exactly 10 times per second. This field's value is stored with only 10 bits of precision, so values above 1023 are not possible. Value must be less than the value of ejectionPeriodMS, otherwise a console warning is generated and the value is set to ejectionPeriodMS - 1. | ( -inf , inf ) |
| phiReferenceVel | Each time a particle is emitted, it is given an ejection direction, see the thetaMin field documentation for more information. phiReferenceVel and phiVariance determine the particle's ejection angle about the z-axis. Particles are emitted starting at 0 degrees, and the emission angle is rotated over time, according to the velocity specified in phiReferenceVel, as well as random numbers generated from phiVariance. See the phiVariance field documentation. This field's value is measured in degrees per second and may range from 0.0 to 360.0; if it lies outside this range, a console warning is generated and the value is clamped. | ( -inf.0 , inf.0 ) |
| phiVariance | Used along with phiReferenceVel to determine the angle relative to the z-axis at which to eject a particle. Each time a particle is generated, a new ejection direction is determined for it. The ejection angle about the z-axis is defined by adding a random variable between 0.0 and phiVariance to the angle determined by phiRefVelocity. See the phiRefVelocity field documentation for more information. This field's value is measured in degrees and must lie in the range of 0.0 to 360.0; if it does not, a console warning is generated and the value is clamped. | ( -inf.0 , inf.0 ) |
| thetaMax | Each time a particle is emitted, it is given an ejection direction. See the thetaMin field documentation for more information. thetaMax defines the maximum ejection direction angle relative to the x-axis. This field's value is measured in degrees. The value may range from 0.0 to 180.0; if it lies outside this range, a console warning is generated and the value is clamped. | ( -inf.0 , inf.0 ) |
| thetaMin | Each time a particle is emitted, it is given an ejection direction. This direction is defined by the thetaMin, thetaMax, phiReferenceVel, and phiVariance fields. A random angle between thetaMin and thetaMax is generated and provides the ejection direction angle relative to the x-axis. This field's value is measured in degrees. The value may range from 0.0 to 180.0, and must be less than thetaMax. If one of these conditions is not met, a console warning is generated and the value is clamped accordingly. | ( -inf.0 , inf.0 ) |
| useEmitterColors | Specifies whether the particle's datablock colors array field should be over-ridden by the colors array provided by the ParticleEmitter object. True implies that the particle's datablock should be over-ridden. | [ false , true ] |
| useEmitterSizes | Specifies whether the particle's datablock sizes array field should be over-ridden by the sizes array provided by the ParticleEmitter object. True implies that the particle's datablock should be over-ridden. | [ false , true ] |
| velocityVariance | Used along with ejectionVelocity to determine the speed at which a particle will be emitted. Each particle gets a new velocity, which is calculated by adding a random number between -1*velocityVariance and velocityVariance to ejectionVelocity. This field's value must be non-negative and must not be greater than ejectionVelocity, otherwise a console warning is generated and the value is clamped appropriately. The actual value used is only guaranteed to be within 0.01 of the value specified, and values larger than 163 are not valid. | ( -inf.0 , inf.0 ) |
ParticleEmitterNode
Fields
| Field Name | Description | Sample or Range |
| emitter | ParticleEmitterData datablock used by this emitter node | ParticleEmitterData datablock |
| velocity | Velocity at which to emit particles. | [ 0.0 , inf.0 ) |
ParticleEmitterNodeData
Fields
| Field Name | Description | Sample or Range |
| timeMultiple | A multiplier that will affect the behavior or the emitter node and the particles it emits. | [ 0.0 , inf.0 ) |
Path
Fields
| Field Name | Description | Sample or Range |
| isLooping | If this is true, the loop is closed, otherwise it is open. | [ false , true ] |
Console Method Summaries
| getPathID |
Console Method
|
getPathID() |
|
Purpose |
Table of Contents || Part 1 || Part 2 || Part 3 || Part 4 || Part 5 || Part 6 || Part 8 || Part 9 || Part 10 || Part 11 || Part 12 || Part 13 || Part 14 || Part 15



