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

#include <behaviorComponent_ScriptBinding.h>

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
void assignFieldsFrom (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)
 
Boolean setEditFieldValue (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] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ addBehavior()

Boolean 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

◆ clearBehaviors()

void clearBehaviors ( )

Clear all behavior instances

Returns
No return value

◆ connect()

Boolean 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.

◆ disconnect()

Boolean 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.

◆ getBehavior()

Integer 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

◆ getBehaviorByIndex()

Integer getBehaviorByIndex ( int  index)

Gets a particular behavior

Parameters
indexThe index of the behavior to get
Returns
(BehaviorInstance bi) The behavior instance you requested

◆ getBehaviorConnection()

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>.

◆ getBehaviorConnectionCount()

Integer 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.

◆ getBehaviorCount()

Integer getBehaviorCount ( )

Get the count of behaviors on an object

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

◆ raise()

Boolean 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.

◆ removeBehavior()

Boolean 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

◆ reOrder()

Boolean 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