Torque Console Objects 12
From TDN
[edit] Console Objects Fields and Methods Quick Reference Part 12
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] ShapeBaseData |
Fields
| Field Name | Description | Sample or Range |
| Rendering | ||
| cloakTexture | Path to texture to be used when shape is cloaked. | See lesson samples. |
| emap | A boolean value specifying whether to render environmental map or not. | false |
| shapeFile | Path to DTS file containing the model for this shape. | See lesson samples. |
| Physics | ||
| density | The density of this shape. Affects whether this shape will sink or float in water (relative to water density). | See lesson samples. |
| drag | Drag presented by this shape as it moves through the air. | 0 |
| mass | Mass for this shape. | 100 |
| Damage | ||
| debris | DebrisData datablock to use for post-destruction debris. | See lesson samples. |
| debrisShapeName | Path to DTS file containing the model for this shape which is to be rendered post destruction. | See lesson samples. |
| explosion | ExplosionData datablock to use for an explsion when this shape is destroyed | See lesson samples. |
| isInvincible | If this boolean value is true, this shape does not take damage. | false |
| maxDamage | Maximum damage this shape can accrue. | 100 |
| renderWhenDestroyed | Boolean value specifying whether to render this shape or not once it's damageState is 'Destroyed'. | false |
| underwaterExplosion | ExplosionData datablock to use for an explsion when this shape is destroyed and submerged in water. | See lesson samples. |
| Damage Reference Values These values do not change engine functions and are meant to be used by scripts. |
||
| destroyedLevel | Damage level at which this shape will be considered destroyed. | 100 |
| disabledlevel | Damage level at which this shape will be considered disabled. | 50 |
| repairRate | Rate (in points per tick) at which this shape is repaired when current damage > 0. |
0.03125 |
| Energy | ||
| inheritEnergyFromMount | When mounted, use mount's energy. | false |
| maxEnergy | Maximum energy this object can have. | 50 |
| Energy Reference Values These values do not change engine functions and are meant to be used by scripts. |
||
| rechargeRate | Rate (in points per tick) at which this shape is recharged when current energy < maxEnergy. |
0.03125 |
| Camera Settings | ||
| cameraDefaultFOV | Initial field of view for the camera. | [ 0.0 , 180 ] |
| cameraMaxDist | Maximum distance from camera to observing object. | [ cameraMinDist , inf ) |
| cameraMaxFOV | Maximum field of view for the camera. | [ 0.0 , 180 ] |
| cameraMinDist | Minimum distance from camera to observing object. | [ 0.0 , cameraMaxDist ] |
| cameraMinFOV | Minimum field of view for the camera. | [ 0.0 , 180 ] |
| firstPersonOnly | Render shape when in first person (only applies to shapes that are observed through.) | [ false , true ] |
| observeThroughObject | If true, camera will use this shape's camera parameters, when this is the controlled object. | [ false , true ] |
| useEyePoint | Use the eye node specified by this shape instead. | [ false , true ] |
| Miscellaneous | ||
| aiAvoidThis | A boolean hit to be used by AI scripts to determine if an AI agent should 'avoid' this object. Scripts are responsible for dealing with this. | [ false , true ] |
| computeCRC | Calculate a cyclic-redundancy-code for this shape. | [ false , true ] |
Console Method Summaries
| popFront | pushBack |
Console Methods
|
getDeployTransform( position , normal ) |
|
Purpose |
|
checkDeployPos( transform ) |
|
Purpose |
ShapeBaseImageData
ShapeBaseImageData has no associated class as other xyzData classes do. This special class is used to represent geometry that can only be mounted to an existing ShapeBase object. ShapeBaseImageData objects cannot otherwise be instantiated like other Shape objects.
Fields
| Field Name | Description | Sample or Range |
| Rendering | ||
| emap | A boolean value specifying whether to render environmental map or not. | - |
| firstPerson | If true, render this image in 1st POV. | - |
| shapeFile | Path to DTS file containing the model for this shape. | - |
| Projectile | ||
| projectile | ProjectileData datablock | - |
| Cloaking | ||
| cloakable | A boolean value specifying whether this image cloaks when the shape it is mounted to is cloaked. | - |
| Mounting | ||
| eyeOffset | Rendering position offset (only affects 1st POV). | - |
| eyeRotation | Rendering rotation offset (only affects 1st POV). | - |
| mountPoint | Named mount node to mount to on the receving shape. | [ 0 , 31 ] |
| offset | Position offset from mount point. | - |
| rotation | Rotation offset from mount point. | - |
| Lighting | ||
| lightColor | Three-element floating-point vector specifing RGB components of light. | “r g b a†In range [ 0.0 , 1.0 ] |
| lightRadius | Floating-point value specifying radius for light emision. | [0.0 , 20.0] |
| lightTime | Integer value specifyng time (in milliseconds) for light to pulse on-off-on. | [ 0 , inf ) |
| lightType | String specifying type of light does this image emits. |
“NoLight†|
| Physics | ||
| mass | Floating-point value specifying mass for this image. | - |
| Weapons | ||
| accuFire | Has no effect. | - |
| casing | DebrisData datablock to use for ejected casings. | - |
| correctMuzzleVector | Boolean value specifyng that the muzzle vector should be calculated from the players eyeVector, not from the muzzleVector of the image. | [ false , true ] |
| minEnergy | Floating-point value specifying minimum energy required to 'fire' this weapon. | - |
| shellExitDir | Ejection vector for ejected casings. | - |
| shellExitVariance | Floating-point value specifying variance in ejection vector direction. | [ 0.0 , 180.0 ] |
| shellVelocity | Floating-point value specifying shell ejection velocity. | [ 0.0 , inf ] |
| usesEnergy | Boolean value specifying that this weapon uses energy. | [ false , true ] |
| State Machine | ||
| stateAllowImageChange[] | If false, will temporarily block other images from mounting while the statemachine is executing the tasks in this state. | [ false , true ] |
| stateDirection[] | Direction of animation. true is foward. | [ false , true ] |
| stateEjectShell[] | Eject shell in this state. | [ false , true ] |
| stateEmitter[] | Play this particle emitter (at muzzle point or specified node). | |
| stateEmitterNode[] | Integer value specifying node to attach emitter to. Default is to mount to named node 'muzzlepoint'. | |
| stateEmitterTime[] | Floating-point value specifying time to run emitter. | |
| stateEnergyDrain[] | Floating-point value specifying | |
| stateFire[] | First state with this a true is the state entered by the client when it receives the 'fire' event. | |
| stateIgnoreLoadedForReady[] | If set to true, and both ready and loaded transitions are true, the ready transition will be taken instead of the loaded transition. | [ false , true ] |
| stateLoadedFlag[] | Set loaded state of shape to specified value. |
“Ignore†|
| stateName | Name of this state. | |
| stateRecoil[] | Play specified recoil anmation. |
“NoRecoil†|
| stateScript[] | Method to execute on entering this state. Scoped to this image class name, then shapeBaseImageData, ... | |
| stateSequenceRandomFlash[] | Play random flash animation. | [ false , true ] |
| stateSequence[] | Play this animation. | |
| stateSound[] | Play sound specified by this audio file. | |
| stateSpinThread[] | Play this spin animation (blended). |
“Ignore†|
| stateTimeoutValue[] | Time in seconds for this state to time out. | [ 0.0 , inf ) |
| stateTransitionOnNotLoaded[] | Transition to this named state if the state of loaded is 'Empty'. | someStateName |
| stateTransitionOnTriggerDown[] | Transition to this named state if the fire button is pressed. | someStateName |
| stateTransitionOnTriggerUp[] | Transition to this named state if the fire button is released. | someStateName |
| stateTransitionOnAmmo[] | Transition to this named state when the ammo the image has ammo. | someStateName |
| stateTransitionOnLoaded[] | Transition to this named state when the loaded state of the image is 'Loaded'. | someStateName |
| stateTransitionOnNoAmmo[] | Transition to this named state when the the image has no ammo. | someStateName |
| stateTransitionOnNoTarget[] | Transition to this named state when the image has no target. | someStateName |
| stateTransitionOnNotWet[] | Transition to this named state when the image is not underwater. | someStateName |
| stateTransitionOnWet[] | Transition to this named state when image is underwater. | someStateName |
| stateTransitionTarget[] | Transition to this named state when the image has a target. | someStateName |
| stateTransitionTimeout[] | Transition to this named state when the current state transition timeout time has elapased. | someStateName |
| stateWaitForTimeout[] | If false, this state ignores timeout and transitions immediately if other tests are met. | [ false , true ] |
| Miscellanous | ||
| computeCRC | Verify that the CRC of the client's image matches the server's CRC for the image on load by client. | [ false , true ] |
SimDataBlock
This class is the root class for all datablock classes. It does not define any fields or console methods of it’s own.
SimGroup
Same fields as SimSet.
SimObject
Console Method Summaries
| delete | dump | getClassName |
| getGroup | getId | getName |
| getType | save | schedule |
Console Methods
|
delete() |
|
Purpose
|
|
dump() |
|
Purpose
|
|
getClassName() |
|
Purpose
|
|
getGroup() |
|
Purpose |
|
getId() |
|
Purpose |
|
getName() |
|
Purpose |
|
getType() |
|
Purpose
|
| $TypeMasks::StaticObjectType | $TypeMasks::EnvironmentObjectType |
| $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType |
| $TypeMasks::WaterObjectType | $TypeMasks::TriggerObjectType |
| $TypeMasks::MarkerObjectType | $TypeMasks::GameBaseObjectType |
| $TypeMasks::ShapeBaseObjectType | $TypeMasks::CameraObjectType |
| $TypeMasks::StaticShapeObjectType | $TypeMasks::PlayerObjectType |
| $TypeMasks::ItemObjectType | $TypeMasks::VehicleObjectType |
| $TypeMasks::VehicleBlockerObjectType | $TypeMasks::ProjectileObjectType |
| $TypeMasks::ExplosionObjectType |
|
schedule(time , command , <arg1 ... argN> ) |
|
Purpose |
|
setName( name ) |
|
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 13 || Part 14 || Part 15



