TorqueScript Reference
Public Member Functions | List of all members
BehaviorComponent Class Reference

Inherits DynamicConsoleMethodComponent.

Inherited by Scene, and SceneObject.

Public Member Functions

bool addBehavior (BehaviorInstance bi)
 
void clearBehaviors ()
 
bool connect (outputBehavior, inputBehavior, outputName, inputName)
 
bool disconnect (outputBehavior, inputBehavior, outputName, inputName)
 
int getBehavior (string BehaviorTemplateName)
 
int getBehaviorByIndex (int index)
 
string getBehaviorConnection (outputBehavior, outputName, connectionIndex)
 
int getBehaviorConnectionCount (outputBehavior, outputName)
 
int getBehaviorCount ()
 
bool raise (outputBehavior, outputName,[deltaTime])
 
bool removeBehavior (BehaviorInstance bi,[bool deleteBehavior=true])
 
bool reOrder (BehaviorInstance inst,[int desiredIndex=0])
 

Member Function Documentation

bool addBehavior ( BehaviorInstance  bi)

Add a behavior to the object

Parameters
biThe 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
bool connect ( outputBehavior  ,
inputBehavior  ,
outputName  ,
inputName   
)

Connects a behavior output to a behavior input.

Parameters
outputBehaviorThe behavior that owns the output.
inputBehaviorThe behavior that owns the input.
outputNameThe output name owned by the output behavior.
inputNameThe input name owned by the input behavior.
Returns
(bool success) Whether the connection was successful or not.
bool disconnect ( outputBehavior  ,
inputBehavior  ,
outputName  ,
inputName   
)

Connects a behavior output to a behavior input.

Parameters
outputBehaviorThe behavior that owns the output.
inputBehaviorThe behavior that owns the input.
outputNameThe output name owned by the output behavior.
inputNameThe input name owned by the input behavior.
Returns
(bool success) Whether the disconnection was successful or not.
int getBehavior ( string  BehaviorTemplateName)

gets a behavior

Parameters
BehaviorTemplateNameThe name of the template of the behavior instance you want
Returns
(BehaviorInstance bi) The behavior instance you requested
int getBehaviorByIndex ( int  index)

Gets a particular behavior

Parameters
indexThe 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
outputBehaviorThe behavior that owns the output.
outputNameThe output name owned by the output behavior.
connectionIndexThe 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>.
int getBehaviorConnectionCount ( outputBehavior  ,
outputName   
)

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

Parameters
outputBehaviorThe behavior that owns the output.
outputNameThe output name owned by the output behavior.
Returns
The number of connections on the behavior output on the specified behavior.
int getBehaviorCount ( )

Get the count of behaviors on an object

Returns
(int count) The number of behaviors on an object
bool raise ( outputBehavior  ,
outputName   
)

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

Parameters
outputBehaviorThe behavior that owns the output.
outputNameThe 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.
bool removeBehavior ( BehaviorInstance  bi)
Parameters
biThe behavior instance to remove
deleteBehaviorWhether or not to delete the behavior
Returns
(bool success) Whether the behavior was successfully removed
bool reOrder ( BehaviorInstance  inst)
Parameters
instThe behavior instance you want to reorder
desiredIndexThe index you want the behavior instance to be reordered to
Returns
(bool success) Whether or not the behavior instance was successfully reordered