Torque Console Objects 6
From TDN
[edit] Console Objects Fields and Methods Quick Reference Part 6
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] GameConnection Cntd. |
Console Methods Cntd.
|
setControlCameraFov( newFOV ) |
|
Purpose |
|
setControlObject( object ) |
|
Purpose |
|
setFirstPerson( isFirstPerson ) |
|
Purpose |
|
setJoinPassword( password ) |
|
Purpose |
|
setMissionCRC( CRC ) |
|
Purpose |
|
startRecording( fileName ) |
|
Purpose |
|
stopRecording() |
|
Purpose |
|
transmitDataBlocks( sequence ) |
|
Purpose |
HoverVehicle
This class is used represent the hover variety of vehicles. Space A hover vehicle is any vehicle that must maintain a specific distance between the vehicle and the ground at all times, which is not the same as a flying vehicle which may change this distance.
HoverVehicleData
The datablock associated with hover vehicle class. This class describes all of the behaviors of the hover vehicle.
Fields
| Field Name | Description | Sample or Range |
| brakingActivationSpeed | Minimum rate at which braking force will be activated. | [ 0.0 , inf.0 ) |
| brakingForce | A force used to bring a drifting hover vehicle to a halt. | [ 0.0 , inf.0 ) |
| dragForce | A percentage of the current velocity applied in the opposite direction of the hover vehicles current motion. | [ 0.01 , 1 ] |
| dustTrailEmitter | ParticleEmitterData datablock for dust trails. | ParticleEmitterData datablock |
| dustTrailFreqMod | Dust trail modulator. Lower values equal more dense trail, higher values equal more sparse trail. | ( 0.0 , inf.0 ) |
| dustTrailOffset | A vector by which to offset the dust trail emitter from it's mount node. By default the emitter plays directly beneath the center of the vehicle. | “0.0 5.0 0.0†|
| engineSound | Engine sound special effect. | AudioProfile datablock |
| floatingGravMag | Gravity modifier that is enabled while vehicle is in contact with other objects. | [ 0.0 , 1.0 ] |
| floatingThrustFactor | When vehicle is NOT floatingFloating thrust is equal to: ( floatingThrustFactor * mainThrustForce ), otherwise it is 100% of mainThrustForce. | [ 0.0 , 1.0 ] |
| floatSound | Floating sound effect. | AudioProfile datablock |
| forwardJetEmitter | ParticleEmitterData datablock used for forward thrust jets, attached at JetNozzle0 and JetNozzle1. | ParticleEmitterData datablock |
| gyroDrag | Gyroscopic force that resists tilting. | [ 0.0 , inf.0 ) |
| jetSound | Jetting sound special effect. | AudioProfile datablock |
| mainThrustForce | Forward thrust factor. | [ 0.0 , inf.0 ) |
| normalForce | A force that attempts to right a tilted vehicle. | [ 0.0 , inf.0 ) |
| pitchForce | A force applied forward or backward, depending on the amount of vehicle pitch. | [ 0.0 , inf.0 ) |
| restorativeForce | Another minor force used to level a tiltled vehicle. | [ 0.0 , inf.0 ) |
| reverseThrustForce | Reverse thrust factor. | [ 0.0 , inf.0 ) |
| rollForce | A force applied left or right, depending on the amount of vehicle roll. | [ 0.0 , inf.0 ) |
| stabDampingConstant | A value used to keep the vehicle from bouncing up-and down with minor elevation changes. | [ 0.0 , 1.0 ] |
| stabLenMax | A limiting factor applied to the automatically generated stabilizing 'box'. This box grows and shrinks as the velocity of the hover vehicle increase and decreases. This phantom box will collide with objects so limitting it's maximum size is a good idea. | [ 0.0 , inf.0 ) |
| stabLenMin | A limiting factor applied to the automatically generated stabilizing 'box'. This box grows and shrinks as the velocity of the hover vehicle increase and decreases. If the box becomes too small, the vehicle will become unstable and prone to tilting. | [ 0.0 , inf.0 ) |
| stabSpringConstant | This value should be at least twice the mass of the hoverVehicle and is used to keep the vehicle from sinking to the ground. | [ 0.0 , inf.0 ) |
| steeringForce | Controls strength of steering controls. | [ 0.0 , inf.0 ) |
| strafeThrustForce | Side to side thrust strength. | [ 0.0 , inf.0 ) |
| triggerTrailHeight | Height at which dust trail emitter is enabled. | [ 0.0 , inf.0 ) |
| turboFactor | A multiplier applied to thrustforce while jetting ($mvTriggerCount3 > 0 ). | [ 0.0 , inf.0 ) |
| vertFactor | A multiplier to use to increase or decrese drag in the vertical direction. | [ 0.0 , inf.0 ) |
InteriorInstance
This class is used represent interiors. That is, objects/meshes use to represent buildings bridges and other large objects in the world which can be entered. As the name would imply, interiors have an inside, and interior. Interior instance utilizes a BSP collision algorithm, as well as portals and other features.
Fields
| Field Name | Description | Sample or Range |
| interiorFile | The DIF filename or for this interior. | ~/path/filename.dif |
| showTerrainInside | If false, and interior uses portals, terrain will not render inside the interior. | [ false , true ] |
| useGLLighting | If this is set to true, interiors wil have basic GL lighting as soon as they are placed, otherwise a relight will be required to make textures show up. | [ false , true ] |
Globals
| Variable Name | Description | Sample or Range |
| pref::Interior::LightUpdatePeriod | Millisecond between dynamic light updates for interiors. Default is 66 millseconds. | [ 1 , inf ] |
| pref::Interior::ShowEnvironmentMaps | Enables environmental mapping for all interiors. | [ false , true ] |
| pref::Interior::DynamicLights | Enable dymamic lights for all interiors. | [ false , true ] |
| pref::Interior::VertexLighting | Enable vertex lighting for all interiors. | [ false , true ] |
| pref::Interior::TexturedFog | Enables advanced fog rendering for all interiors. | [ false , true ] |
| pref::Interior::lockArrays | Advanced rendering feature. | [ false , true ] |
| pref::Interior::detailAdjust | LOD transition tolerance. | [ 0.3 , 1.0 ] |
| pref::Interior::DontRestrictOutside | Debug mode. | [ false , true ] |
Console Method Summaries
| activateLight | deactivateLight | echoTriggerableLights |
| getNumDetailLevels | magicButton | setAlarmMode |
Console Methods
|
activateLight( lightName ) |
|
Purpose |
|
deactivateLight( lightName ) |
|
Purpose |
|
echoTriggerableLights() |
|
Purpose |
|
getNumDetailLevels() |
|
Purpose |
|
setAlarmMode( mode ) |
|
Purpose |
|
setDetailLevel( level ) |
|
Purpose |
|
setSkinBase( basename ) |
|
Purpose |
Item
This class, derived from ShapeBase, is used to represent small object in the world which are intended to be interacted with and/or picked up. That is coinscoins, grenades, rifles, gems, etc. This class of object does not require a collision mass although having one is useful in certain circumstances, specifically for line of sight collisions. By default the engine will supply a simple collision mesh for object to object collisions. This object supplies a several physical as well as visible behaviors, including object specific gravity, elasticity, lighting, etc.
Fields
| Field Name | Description | Sample or Range |
| collidable | -- | deprecated |
| rotate | If set to a true, this item will auto-rotate. | [ false , true ] |
| static | if this value is set to true, the item will not move when placed. Conversely, a non-static shape is allowed to move. | [ false , true ] |
Console Method Summaries
| getLastStickyNormal | getLastStickyPos | isRotating |
Console Methods
|
getLastStickyNormal() |
|
Purpose |
|
getLastStickyPos() |
|
Purpose |
|
isRotating() |
|
Purpose |
|
isStatic() |
|
Purpose |
|
setCollisionTimeout( obj ) |
|
Purpose |
ItemData
This is the datablock associated with the item object. This class specifies most of the behavior of an item.
Fields
| Field Name | Description | Sample or Range |
| Pickups | ||
| pickupName | Message to be printed when this object is picked up. It is the responsibility of scripts to print this message. | -- |
| Physics | ||
| elasticity | A floating-point value specifying how 'bouncy' this object is. i.e. How much of the shape's velocity is lost onCollision().
|
Allowed: [ 0.0 , inf )
|
| friction | A floating-point value specifying how much velocity is lost to impact and sliding friction. | Allowed:( -inf , inf ) Suggested: [ 0.0 , 1.0 ] |
| gravityMod | A floating-point value specifying an individual variance of local gravity for this item. In other words, an item can be told to ignore gravity, or to be affected by 2x gravity, or even to float upward. | Allowed:( -inf , inf ) Suggested:( -20.0 , 20.0 ) |
| maxVelocity | A floating-point value specifying a limit on this item's maximum velocity. This can be used to keep the item from falling for flying too fast. It is also helpful to limit the effects of other settings like velocity, etc. | |
| sticky | A boolean value specifying whether this object will arrest (stop) on impact. Furthermore, if an object is sticky, it retains information about the last location is hit which can be accessed via console methods (see below). | [ true, false ] |
| Type | ||
| dynamicType | An integer value which, if speficied, is added to the value retured by getType(). | See dynamicType below |
| Light | ||
| lightColor | A three-value floating-point vector contaiining the RGB components of this item's light. | Individually: [ 0.0 , 1.0 ] |
| lightOnlyStatic | A boolean value instructing the item to produce light, only in the case that the object field 'isStatic' is true. | [ false , true ] |
| lightRadius | A floating point value specifying the radius for this item's light. | [ 0.0 , 20.0 ] |
| lightTime | A floating point value specifying the time (in milliseconds) it takes for a pulsing light to transition on-off-on. | ( 100 , inf ) |
| lightType | A string specifying the type of light, if any, this shape emits. |
“NoLight†|
Lightning
This class is used to represent the special effect lightning. Lightning can be generated or rendered from a bitmap. Lightning bolts start at the top of the specified lightning block and terminate somewhere at the bottom or below the specified lightning block.
Fields
| Field Name | Description | Sample or Range |
| boltStartRadius | This field specifies the radius within which lightning bolts will start. | ( 0.0 , inf ) |
| chanceToHitTarget | Defunct. | [ 0.0 , 1.0 ] |
| color | This field is used to specify the color of lightning when it is created. Note, this is the exact color for generated lightning but should be considered a filter color for lightning that he uses bitmaps. | "r g b a" (float) |
| fadeColor | This field is used to specify the color of lightning as it fades out. Note, this is the exact color for generated lightning but should be considered a filter color for lightning that he uses bitmaps. | "r g b a" (float) |
| strikeRadius | This value is used to specify the radius in which lightning will strike. | ( 0.0 , inf ) |
| strikesPerMinute | This value is used to specify the number of strikes permitted. Note, strikes occur at random but engine guarantees that at least strikes per minute strikes will occur space every minute. | [ 0 , inf ] |
| strikeWidth | This value specifies the width of the bitmap or generated lightning, at the point of its strike. | ( 0.0 , inf ) |
| useFog | If such true this lightning will be affected by fog. Note, this only applies to lightning generated using bitmaps. | [ false , true ] |
Console Method Summaries
| strikeObject | strikeRandomPoint | warningFlashes |
Console Methods
|
strikeObject( obj ) |
|
Purpose |
|
strikeRandomPoint() |
|
Purpose |
Table of Contents || Part 1 || Part 2 || Part 3 || Part 4 || Part 5 || Part 7 || Part 8 || Part 9 || Part 10 || Part 11 || Part 12 || Part 13 || Part 14 || Part 15



