TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
BehaviorComponent Class Reference

Inherits DynamicConsoleMethodComponent.

Inherited by Scene, and SceneObject.

## Public Member Functions
Boolean | addBehavior (BehaviorInstance bi)
void | clearBehaviors ()
Boolean | connect (outputBehavior, inputBehavior, outputName, inputName)
Boolean | disconnect (outputBehavior, inputBehavior, outputName, inputName)
Integer | getBehavior (string BehaviorTemplateName)
Integer | getBehaviorByIndex (int index)
String | getBehaviorConnection (outputBehavior, outputName, connectionIndex)
Integer | getBehaviorConnectionCount (outputBehavior, outputName)
Integer | getBehaviorCount ()
Boolean | raise (outputBehavior, outputName, [deltaTime])
Boolean | removeBehavior (BehaviorInstance bi, [bool deleteBehavior=true])
Boolean | reOrder (BehaviorInstance inst, [int desiredIndex=0])
Public Member Functions inherited from DynamicConsoleMethodComponent
String | callOnBehaviors (methodName, argi)
Public Member Functions inherited from SimComponent
Boolean | addComponents (compObjName, compObjName2,...)
Integer | getComponent (idx)
Integer | getComponentCount ()
Boolean | isEnabled ()
Boolean | removeComponents (compObjName, compObjName2,...)
void | setEnabled (enabled)
Public Member Functions inherited from SimObject
Integer | clone ([copyDynamicFields=false]?)
void | delete ()
Integer | getId ()
void | setName (newName)
String | getName ()
String | getClassNamespace ()
String | getSuperClassNamespace ()
void | setClassNamespace (nameSpace)
void | setSuperClassNamespace ()
Boolean | isMethod (string methodName)
String | call (methodName, [args]*)
void | dumpClassHierarchy ()
void | dump ()
Boolean | isMemberOfClass (string classname)
String | getClassName ()
String | getFieldValue (fieldName)
Boolean | setFieldValue (fieldName, value)
Integer | getDynamicFieldCount ()
String | getDynamicField (index)
Integer | getFieldCount ()
String | getField (int index)
void | setProgenitorFile (file)
String | getProgenitorFile ()
Integer | getType ()
String | getFieldType (fieldName)
void | setInternalName (string InternalName)
String | getInternalName ()
Boolean | isChildOfGroup (groupID)
Integer | getGroup ()
Boolean | startTimer (callbackFunction, float timePeriod, [repeat]?)
void | stopTimer ()
Boolean | isTimerActive ()
Integer | schedule (time, command, [arg]*)
Boolean | save (fileName, [selectedOnly]?)
void | addFieldFilter (fieldName)
void | removeFieldFilter (fieldName)

## Member Function Documentation

Boolean addBehavior | ( | BehaviorInstance | bi | ) |

Add a behavior to the object

Parameters

  bi | The behavior instance to add

Returns
  (bool success) Whether or not the behavior was successfully added

void clearBehaviors | ( |  | ) |

Clear all behavior instances

Returns
  No return value

Boolean connect | ( | outputBehavior | ,
|  | inputBehavior | ,
|  | outputName | ,
|  | inputName |
| ) |  |

Connects a behavior output to a behavior input.

Parameters

  outputBehavior | The behavior that owns the output.
  inputBehavior | The behavior that owns the input.
  outputName | The output name owned by the output behavior.
  inputName | The input name owned by the input behavior.

Returns
  (bool success) Whether the connection was successful or not.

Boolean disconnect | ( | outputBehavior | ,
|  | inputBehavior | ,
|  | outputName | ,
|  | inputName |
| ) |  |

Connects a behavior output to a behavior input.

Parameters

  outputBehavior | The behavior that owns the output.
  inputBehavior | The behavior that owns the input.
  outputName | The output name owned by the output behavior.
  inputName | The input name owned by the input behavior.

Returns
  (bool success) Whether the disconnection was successful or not.

Integer getBehavior | ( | string | BehaviorTemplateName | ) |

gets a behavior

Parameters

  BehaviorTemplateName | The name of the template of the behavior instance you want

Returns
  (BehaviorInstance bi) The behavior instance you requested

Integer getBehaviorByIndex | ( | int | index | ) |

Gets a particular behavior

Parameters

  index | The index of the behavior to get

Returns
  (BehaviorInstance bi) The behavior instance you requested

String getBehaviorConnection | ( | outputBehavior | ,
|  | outputName | ,
|  | connectionIndex |
| ) |  |

Gets a comma-delimited list of connections on the behavior output on the specified behavior.

Parameters

  outputBehavior | The behavior that owns the output.
  outputName | The output name owned by the output behavior.
  connectionIndex | The connection index.

Returns
  Returns a comma-delimited list of connections on the behavior output on the specified behavior of the format <OutputBehavior>,<InputBehavior>,<OutputName>,<InputName>.

Integer getBehaviorConnectionCount | ( | outputBehavior | ,
|  | outputName |
| ) |  |

Gets the number of connections on the behavior output on the specified behavior.

Parameters

  outputBehavior | The behavior that owns the output.
  outputName | The output name owned by the output behavior.

Returns
  The number of connections on the behavior output on the specified behavior.

Integer getBehaviorCount | ( |  | ) |

Get the count of behaviors on an object

Returns
  (int count) The number of behaviors on an object

Boolean raise | ( | outputBehavior | ,
|  | outputName |
| ) |  |

Raise a signal on the behavior output on the specified behavior.

Parameters

  outputBehavior | The behavior that owns the output.
  outputName | The output name owned by the output behavior.
  [deltaTime] | Optional time-delta (ms) when the raise should occur.

Returns
  (bool success) Whether the signal raise was successful or not.

Boolean removeBehavior | ( | BehaviorInstance | bi | ) |

Parameters

  bi | The behavior instance to remove
  deleteBehavior | Whether or not to delete the behavior

Returns
  (bool success) Whether the behavior was successfully removed

Boolean reOrder | ( | BehaviorInstance | inst | ) |

Parameters

  inst | The behavior instance you want to reorder
  desiredIndex | The index you want the behavior instance to be reordered to

Returns
  (bool success) Whether or not the behavior instance was successfully reordered