Torque Reference Tables


Table A.1: Torque Script Object Type Masks

Mask Identifier

Number

Mask Bit Position

DefaultObjectType

0

0

StaticObjectType

1

1

EnvironmentObjectType

2

2

TerrainObjectType

4

3

InteriorObjectType

8

4

WaterObjectType

16

5

TriggerObjectType

32

6

MarkerObjectType

64

7

unassigned

128

8

unassigned

256

9

DecalManagerObjectType

512

10

GameBaseObjectType

1024

11

ShapeBaseObjectType

2048

12

CameraObjectType

4096

13

StaticShapeObjectType

8192

14

PlayerObjectType

16384

15

ItemObjectType

32768

16

VehicleObjectType

65536

17

VehicleBlockerObjectType

131072

18

ProjectileObjectType

262144

19

ExplosionObjectType

524288

20

unassigned

2097152

21

CorpseObjectType

1048576

22

DebrisObjectType

4194304

23

PhysicalZoneObjectType

8388608

24

unassigned

33554432

25

StaticTSObjectType

16777216

26

StaticRenderedObjectType

67108864

27

unassigned

268435456

28

unassigned

536870912

29

unassigned

1073741824

30

unassigned

2147483648

31

Table A.2: Torque Object Methods

Object Class

Method

AIPlayer

ai.moveForward()
ai.walk()
ai.run()
ai.stop()
ai.setMoveSpeed(float)
ai.setTargetObject(object)
ai.getTargetObject()
ai.targetInSight()
ai.aimAt( point)
ai.getAimLocation()

BanList

BanList::add(id, TA, banTime)
BanList::addAbsolute(id, TA, banTime)
BanList::removeBan(id, TA)
BanList::isBanned(id, TA)
BanList::export(filename)

Camera

camera.getPosition()
camera.setOrbitMode(obj, xform,min-dist,max-dist, cur-dist)
camera.setFlyMode()
watchView.edit(newValue)
watchView.remove()
watchView.queryAll()
watchView.clear()

Debris

obj.init(position, velocity)

EditTSCtrl

EditTSCtrl.renderSphere(pos, radius,=)
EditTSCtrl.renderCircle(pos, normal, radius,=)
EditTSCtrl.renderTriangle(pnt, pnt, pnt)
EditTSCtrl.renderLine(start, end)

FileObject

file.openForRead(fileName)
file.openForWrite(fileName)
file.openForAppend(fileName)
file.writeLine(text)
file.isEOF()
file.readLine()
file.close()

FlyingVehicle

FlyingVehicle.setCreateHeight(bool)

GameBase

obj.getDataBlock()
obj.setDataBlock(DataBlock)

GameConnection

conn.chaseCam(size)
conn.setControlCameraFov(fov)
conn.getControlCameraFov()
conn.transmitDataBlocks(seq)
conn.activateGhosting()
conn.resetGhosting()
conn.setControlObject(%obj)
conn.getControlObject()
conn.isAIControlled()
conn.play2D(AudioProfile)
conn.play3D(AudioProfile,Transform)
conn.isScopingCommanderMap()
conn.scopeCommanderMap(bool)
conn.listenEnabled()
conn.getListenState(clientId)
conn.canListen(clientId)
conn.listenTo(clientId, true|false)
conn.listenToAll()
conn.listenToNone()
conn.setVoiceChannels(0-3)
conn.setVoiceDecodingMask(mask)
conn.setVoiceEncodingLevel(codecLevel)
conn.setBlackOut(fadeTOBlackBool, timeMS)
conn.setMissionCRC(crc)

GuiBitmapCtrl

guiBitmapCtrl.setBitmap(blah)
guiBitmapCtrl.setValue(xAxis, yAxis)

GuiCanvas

canvas.renderFront(bool)
canvas.setContent(ctrl)
canvas.getContent()
canvas.pushDialog(ctrl)
canvas.popDialog()
canvas.popLayer()
canvas.cursorOn()
canvas.cursorOff()
canvas.setCursor(cursor)
canvas.hideCursor()
canvas.showCursor()
canvas.repaint()
canvas.reset()
canvas.isCursorOn()
canvas.getCursorPos()
canvas.setCursorPos(pos)

GuiControl

ctrl.getPosition()
ctrl.getExtent()
ctrl.getMinExtent()
ctrl.resize(x, y, w, h)
ctrl.setValue(value)
ctrl.getValue()
ctrl.setActive(value)
ctrl.isActive()
ctrl.setVisible(value)
ctrl.isVisible()
ctrl.isAwake()
ctrl.setProfile(profile)
ctrl.makeFirstResponder(value)

GuiEditCtrl

editCtrl.addNewCtrl(ctrl)
editCtrl.select(ctrl)
editCtrl.setRoot(root)
editCtrl.setCurrentAddSet(ctrl)
editCtrl.toggle()
editCtrl.justify(mode)
editCtrl.bringToFront()
editCtrl.pushToBack()
editCtrl.deleteSelection()

GuiFilterCtrl

guiFilterCtrl.getValue()
guiFilterCtrl.setValue(f1, f2,...)
guiFilterCtrl.identity()

GuiFrameSetCtrl

gfsc.frameBorder(index, enable)
gfsc.frameMovable(index, enable)
gfsc.frameMinExtent(index, w, h)

GuiInspector

inspector.inspect(obj)
inspector.apply(newName)

GuiMessageVectorCtrl

[GuiMessageVectorCtrl].attach(MessageVectorId)
[GuiMessageVectorCtrl].detach()

GuiPopUpMenuCtrl

menu.sort()
menu.add(name,idNum{,scheme})
menu.addScheme(id, fontColor, fontColorHL, fontColorSEL)
menu.getText()
menu.setText(text)
menu.getValue()
menu.setValue(text)
menu.clear()
menu.forceOnAction()
menu.forceClose()
menu.getSelected()
menu.setSelected(id)
menu.getTextById(id)
menu.setEnumContent(class, enum)
menu.findText(text)
menu.size()
menu.replaceText(bool)

GuiSliderCtrl

guiSliderCtrl.getValue()

GuiTerrPreviewCtrl

guiTerrPreviewCtrl.reset()
guiTerrPreviewCtrl.setRoot()
guiTerrPreviewCtrl.getRoot()
guiTerrPreviewCtrl.setOrigin(x, y)
guiTerrPreviewCtrl.getOrigin()
guiTerrPreviewCtrl.getValue()
guiTerrPreviewCtrl.getValue(t)

GuiTextListCtrl

textList.getSelectedId()
textList.setSelectedById(id)
textList.setSelectedRow(index)
textList.clearSelection()
textList.clear()
textList.addRow(id,text,index)
textList.setRow(id,text)
textList.getRowId(index)
textList.removeRowById(id)
textList.getRowTextById(id)
textList.getRowNumById(id)
textList.getRowText(index)
textList.removeRow(index)
textList.rowCount()
textList.scrollVisible(index)
textList.sort(colId{,increasing})
textList.sortNumerical(colId{, increasing})
textList.findText(text)
textList.setRowActive(id)
textList.isRowActive(id)

GuiTreeViewCtrl

treeViewCtrl.open(obj)

HTTPObject

obj.get(addr, request-uri)
obj.post(addr, request-uri, query, post)

InteriorInstance

[InteriorObject].activateLight()
[InteriorObject].deactivateLight()
[InteriorObject].echoTriggerableLights()
[InteriorObject].getNumDetailLevels()
[InteriorObject].setDetailLevel(level)

Item

obj.isStatic()
obj.isRotating()
obj.setCollisionTimeout(object)
obj.getLastStickyPos()
obj.getLastStickyNormal()

Lightning

[LightningObject].warningFlashes()
[LightningObject].strikeRandomPoint()
[LightningObject].strikeObject(id)

MessageVector

[MessageVector].deleteLine(DeletePos)
[MessageVector].clear()
[MessageVector].dump(filename{, header})
[MessageVector].getNumLines()
[MessageVector].getLineText(Line)
[MessageVector].getLineTag(Line)
[MessageVector].getLineTextByTag(Tag)
[MessageVector].getLineIndexByTag(Tag)

PhysicalZone

obj.activate()
obj.deactivate()

Player

obj.setActionThread(sequenceName)
obj.setControlObject(obj)
obj.getControlObject()
obj.clearControlObject()
obj.getDamageLocation(pos)

Precipitation

precipitation.setPercentage(percentage <1.0 to 0.0>)
precipitation.stormPrecipitation(percentage <0 to 1>, Time)

SceneObject

obj.getScale()
obj.getWorldBox()
obj.getWorldBoxCenter()
obj.getObjectBox()
obj.getForwardVector()

ShapeBase

obj.setShapeName(tag)
obj.getShapeName()
obj.playAudio(slot,AudioProfile)
obj.playAudio(slot)
obj.playThread(thread)
obj.setThreadDir(thread,bool)
obj.stopThread(thread)
obj.pauseThread(thread)
obj.mountObject(object,node)
obj.unmountObject(object)
obj.unmount()
obj.isMounted()
obj.getObjectMount()
obj.getMountedObjectCount()
obj.getMountedObjectNode(index)
obj.getMountedObject(index)
obj.getMountNodeObject(node)
obj.mountImage(DataBlock,slot,[loaded=true],[skinTag])
obj.unmountImage(slot)
obj.getMountedImage(slot)
obj.getPendingImage(slot)
obj.isImageFiring(slot)
obj.isImageMounted(DataBlock)
obj.getMountSlot(DataBlock)
obj.getImageSkinTag(slot)
obj.getImageState(slot)
obj.getImageTrigger(slot)
obj.setImageTrigger(slot,bool)
obj.getImageAmmo(slot)
obj.setImageAmmo(slot,bool)
obj.getImageTarget(slot)
obj.setImageTarget(slot,bool)
obj.getImageLoaded(slot)
obj.setImageLoaded(slot,bool)
obj.getMuzzleVector(slot)
obj.getMuzzlePoint(slot)
obj.getSlotTransform(slot)
obj.getAIRepairPoint()
obj.getVelocity()
obj.setVelocity(Vector)
obj.applyImpulse(Pos,Vector)
obj.getEyeVector()
obj.getEyeTransform()
obj.setEnergyLevel(value)
obj.getEnergyLevel()
obj.getEnergyPercent()
obj.setDamageLevel(value)
obj.getDamageLevel()
obj.getDamagePercent()
obj.setDamageState(state)
obj.getDamageState()
obj.isDestroyed()
obj.isDisabled()
obj.isEnabled()
obj.applyDamage(value)
obj.applyRepair(value)
obj.setRepairRate(value)
obj.getRepairRate()
obj.setRechargeRate(value)
obj.getRechargeRate()
obj.getControllingClient()
obj.getControllingObject()
obj.canCloak()
obj.setCloaked(true|false)
obj.isCloaked()
obj.setDamageFlash(flash level)
obj.getDamageFlash()
obj.setWhiteOut(flash level)
obj.getWhiteOut()
obj.setInvincibleMode(time, speed)
obj.getCameraFov()
obj.setCameraFov(fov)
obj.hide(bool)
obj.isHidden()
startFade( U32, U32,bool)
obj.setDamageVector(vec)

ShapeBaseData

obj.checkDeployPos(xform)
obj.getDeployTransform(pos, normal)

SimpleNetObject

obj.setMessage(msg)

Sky

sky.stormCloudsOn(0 or 1,Time)
sky.stormFogOn(Percentage <0 to 1>, Time)
sky.realFog(0 or 1, max, min, speed)
sky.getWindVelocity()
sky.setWindVelocity(x, y, z)
sky.stormCloudsShow(bool)
sky.stormFogShow(bool)

StaticShape

obj.setPoweredState(bool)
obj.getPoweredState(bool)

TCPObject

obj.listen(port)
obj.send(string,...)
obj.connect(addr)
obj.disconnect()

Terraformer

Terraformer.canyon(dst, freq, turb, seed)
Terraformer.preview(dst_gui, src)
Terraformer.previewScaled(dst_gui, src)
Terraformer.clearRegister(r)
Terraformer.fBm(r, freq, 0.0-1.0{roughness}, detail, seed)
Terraformer.smoothRidges(src,dst,0-1{factor},iterations)
Terraformer.setTerrain(r)

Trigger

[TriggerObject].getNumObjects()
[TriggerObject].getNumObjects(Object Index)

TriggerData

[TriggerData].enterTrigger(Trigger, ObjectId)
[TriggerData].leaveTrigger(Trigger, ObjectId)
[TriggerData].tickTrigger(Trigger)

WaterBlock

waterBlock.toggleWireFrame()

WorldEditor

worldEditor.redirectConsole(objID)

Table A.3: Torque Script Keywords

Keyword

Description

break

Breaks execution out of a loop.

case

Indicates a choice in a switch block.

continue

Causes execution to continue at top of loop.

datablock

Indicates that the following code block defines a datablock.

default

Indicates the choice to make in a switch block when no cases match.

do

Indicates start of a do-while type loop block.

else

Indicates alternative execution path in an if statement.

false

Evaluates to 0, the opposite of true.

for

Indicates start of a for loop.

function

Indicates that the following code block is a callable function.

if

Indicates start of a conditional (comparison) statement.

new

Creates a new object datablock.

package

Indicates that the following code block encompasses a package.

return

Indicates return from a function.

switch

Indicates start of a switch selection block.

true

Evaluates to 1, the opposite of false.

while

Indicates the start of a while loop.

Table A.4: Torque Script Operators

Symbol

Meaning

+

Add.

-

Subtract.

*

Multiply.

/

Divide.

%

Modulus.

++

Increment by 1.

Decrement by 1.

+=

Addition totalizer.

-=

Subtraction totalizer.

*=

Multiplication totalizer.

/=

Division totalizer.

%=

Modulus totalizer.

@

String append.

( )

Parentheses—operator precedence promotion.

[ ]

Brackets—array index delimiters.

{ }

Braces—indicate start and end of code blocks.

SPC

Space append macro (same as @ " " @).

TAB

Tab append macro (same as @ "\t" @).

NL

New line append (same as @ "\n" @).

~

(Bitwise NOT) Flips the bits of its operand.

|

(Bitwise OR) Returns a 1 in a bit if bits of either operand is 1.

&

(Bitwise AND) Returns a 1 in each bit position if bits of both operands are 1s.

(Bitwise XOR) Returns a 1 in a bit position if bits of one but not both operands are 1.

<<

(Left-shift) Shifts its first operand in binary representation the number of bits to the left specified in the second operand, shifting in 0s from the right.

>>

(Sign-propagating right-shift) Shifts the first operand in binary representation the number of bits to the right specified in the second operand, discarding bits shifted off.

|=

Bitwise OR with result assigned to the first operand.

&=

Bitwise AND with result assigned to the first operand.

=

Bitwise XOR with result assigned to the first operand.

<<=

Left-shift with result assigned to the first operand.

>>=

Sign-propagating right-shift with result assigned to the first operand.

!

Evaluates the opposite of the value specified.

&&

Requires both values to be true for the result to be true.

||

Requires only one value to be true for the result to be true.

==

Left-hand value and right-hand value are equal.

!=

Left-hand value and right-hand value are not equal.

<

Left-hand value is less than right-hand value.

>

Left-hand value is greater than right-hand value.

<=

Left-hand value is less than or equal to right-hand value.

>=

Left-hand value is greater than or equal to right-hand value.

$=

Left-hand string is equal to right-hand string.

!$=

Left-hand string is not equal to right-hand string.

//

Comment operator—ignore all text from here to the end of the line.

;

Statement terminator.

.

Object/datablock method or property delimiter.

Table A.5: Torque Script Operator Precedence

High Priority

Low Priority

( )

*

/

%

+

-

=

Table A.6: Torque Script Tokens

Token

Description

string constant

A sequence of alphanumeric characters bracketed by single or double quotes.

variable

Prefixed with % for local variable or $ for global variable, which is then always followed by a letter character. After the initial letter character, there can be a series of alphanumeric characters, underscores, or colons; a variable cannot end with a colon.

identifier

An initial letter character followed by an optional sequence of alphanumeric characters or underscores.

number

A decimal integer or floating point number. Hexadecimal numbers can be used if the token begins with 0x (zero-x).

Table A.7: Torque Script String Formatting Codes

Code

Description

\r

Embeds a carriage return character.

\n

Embeds a new line character.

\t

Embeds a tab character.

\xhh

Embeds an ASCII character specified by the hex number (hh) that follows the x.

\c

Embeds a color code for strings that will be displayed on-screen.

\cr

Resets the display color to the default.

\cp

Pushes the current display color onto a stack.

\co

Pops the current display color off the stack.

\cn

Uses n as an index into color table defined by GUIControlProfile.fontColors.

Table A.8: Torque Datablocks

Datablock

Parent

AudioDescription

SimDataBlock

AudioEnvironment

SimDataBlock

AudioProfile

SimDataBlock

AudioSampleEnvironment

SimDataBlock

CameraData

ShapeBaseData

DebrisData

GameBaseData

DecalData

SimDataBlock

ExplosionData

GameBaseData

FlyingVehicleData

VehicleData

GameBaseData

SimDataBlock

HoverVehicleData

VehicleData

ItemData

ShapeBaseData

LightningData

GameBaseData

MissionMarkerData

ShapeBaseData

ParticleData

SimDataBlock

ParticleEmitterData

GameBaseData

ParticleEmitterNodeData

GameBaseData

PlayerData

ShapeBaseData

PrecipitationData

GameBaseData

ProjectileData

GameBaseData

ShapeBaseData

GameBaseData

ShapeBaseImageData

GameBaseData

SimDataBlock

none

SplashData

GameBaseData

StaticShapeData

ShapeBaseData

TSShapeConstructor

SimDataBlock

TriggerData

GameBaseData

VehicleData

ShapeBaseData

WheeledVehicleData

VehicleData

WheeledVehicleSpring

SimDataBlock

WheeledVehicleTire

SimDataBlock




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net