TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

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

Public Member Functions | List of all members
ParticleAsset Class Reference

Inherits AssetBase.

## Public Member Functions
Integer | addDataKey (time, value)
Boolean | addEmitter (emitterId)
Boolean | clearDataKeys ()
void | clearEmitters ()
String | createEmitter ()
| Emitter asset methods. More...
void | deselectField ()
Integer | findEmitter (emitterName)
String | getDataKey (keyIndex)
Integer | getDataKeyCount ()
Integer | getEmitter (emitterIndex)
Integer | getEmitterCount ()
Float | getFieldValue (time)
String | getLifeMode ()
Float | getLifetime ()
Float | getMaxTime ()
Float | getMaxValue ()
Float | getMinTime ()
Float | getMinValue ()
Float | getRepeatTime ()
Integer | getSelectableFieldCount ()
| Particle asset fields. More...
String | getSelectableFieldName (fieldIndex)
String | getSelectedField ()
Float | getValueScale ()
void | moveEmitter (fromEmitterIndex, toEmitterIndex)
Boolean | removeDataKey (keyIndex)
Boolean | removeEmitter (emitterId, [bool deleteEmitter])
Boolean | selectField (fieldName)
Boolean | setDataKeyValue (keyIndex, value)
void | setLifeMode (lifeMode)
| Particle asset accessors. More...
void | setLifetime (lifeTime)
Boolean | setRepeatTime (repeatTime)
Integer | setSingleDataKey (value)
Boolean | setValueScale (valueScale)
Public Member Functions inherited from AssetBase
String | getAssetId ()
void | refreshAsset ()
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

Integer addDataKey | ( | time | ,
|  | value |
| ) |  |

Add Data-Key to Graph.

Parameters

  time | The key time.
  value | The value at specified time

Returns
  Returns the index of the new data-key or -1 on failure.

Boolean addEmitter | ( | emitterId |  | ) |

Adds an existing emitter.

Parameters

  emitterId | The emitter to add.

Returns
  On success it returns the ID of the emitter, or 0 if failed.

Boolean clearDataKeys | ( |  | ) |

Clears all data-key(s) from the field.

Returns
  Whether the operation was successful or not.

void clearEmitters | ( |  | ) |

Clear all the emitters.

Returns
  No return Value.

String createEmitter | ( |  | ) |

Emitter asset methods.

Creates and add a new emitter.

Returns
  The new emitter that was added or 0 if failed.

void deselectField | ( |  | ) |

Deselect any selected field. If no field is selected then nothing happens.

Returns
  No return value.

Integer findEmitter | ( | emitterName |  | ) |

Finds the emitter by its name.

Parameters

  emitterName | The name of the desired emitter.

Returns
  The emitter or 0 if not found.

String getDataKey | ( | keyIndex |  | ) |

Gets the data-key at the specified index from the field.

Parameters

  keyIndex | The index of the data-key to be retrieved.

Returns
  The data-key comprising both the time and value or nothing if the key is invalid.

Integer getDataKeyCount | ( |  | ) |

Gets the data-key count.

Returns
  The number of data-keys in the currently selected field or -1 if no field is selected.

Integer getEmitter | ( | emitterIndex |  | ) |

Gets the emitter at the specified index.

Parameters

  emitterIndex | The index for the desired emitter

Returns
  The emitter or 0 if not found.

Integer getEmitterCount | ( |  | ) |

Gets the emitter count.

Returns
  Returns the number of emitters as an integer.

Float getFieldValue | ( | time |  | ) |

Get the fields' value at the specified time.

Parameters

  time | The time to sample the field value at.

Returns
  The fields' value at the specified time or always 0.0 if no field is selected.

String getLifeMode | ( |  | ) |

Gets the life-mode of the particle effect.

Returns
  The life-mode of the particle effect.

Float getLifetime | ( |  | ) |

Gets the lifetime of the particle effect.

Returns
  The lifetime of the particle effect.

Float getMaxTime | ( |  | ) |

Get the maximum time for the field.

Returns
  The maximum time for the field or always 0.0 if no field is selected.

Float getMaxValue | ( |  | ) |

Get the maximum value for the field.

Returns
  The maximum value for the field or always 0.0 if no field is selected.

Float getMinTime | ( |  | ) |

Get the minimum time for the field.

Returns
  The minimum time for the field or always 0.0 if no field is selected.

Float getMinValue | ( |  | ) |

Get the minimum value for the field.

Returns
  The minimum value for the field or always 0.0 if no field is selected.

Float getRepeatTime | ( |  | ) |

Gets the time period that the fields' value repeat (cycle) at.

Returns
  The time period that the fields' value repeat (cycle) at.

Integer getSelectableFieldCount | ( |  | ) |

Particle asset fields.

Gets the number of available selectable fields.

Returns
  The number of available selectable fields.

String getSelectableFieldName | ( | fieldIndex |  | ) |

Gets the selectable field at the specified index.

Returns
  The selectable field name at the specified index.

String getSelectedField | ( |  | ) |

Gets the selected field name or nothing if no field is selected.

Returns
  The selected field name or nothing if no fields is selected.

Float getValueScale | ( |  | ) |

Gets the scaling of field values' retrieved from the field.

Returns
  The scaling of field values' retrieved from the field.

void moveEmitter | ( | fromEmitterIndex | ,
|  | toEmitterIndex |
| ) |  |

Moves the emitter order.

Parameters

  fromEmitterIndex | The source index of the emitter to move.
  toEmitterIndex | The destination index to move the emitter to.

Returns
  No return value.

Boolean removeDataKey | ( | keyIndex |  | ) |

Remove the data-key from the field.

Parameters

  keyIndex | The index of the data-key you want to remove.

Returns
  Whether the operation was successful or not.

Boolean removeEmitter | ( | emitterId |  | ) |

Removes an emitter.

Parameters

  emitterId | The emitter to remove.

Returns
  No return value.

Boolean selectField | ( | fieldName |  | ) |

Select the specified field by its name.

Parameters

  fieldName | The field name to use for the selection. Use an empty name to deselect to stop accidental changes.

Returns
  Whether the field was successfully selected or not.

Boolean setDataKeyValue | ( | keyIndex | ,
|  | value |
| ) |  |

Set data-key value for the field.

Parameters

  keyIndex | The index of the key to be modified.
  value | The value to change the key to.

Returns
  Whether the operation was successful or not.

void setLifeMode | ( | lifeMode |  | ) |

Particle asset accessors.

Sets the life-mode of the particle effect.

Parameters

  lifeMode | The life-mode of the particle effect (either INFINITE, CYCLE, KILL or STOP. A life-mode of INFINITE causes the particle effect to last forever. A life-mode of CYCLE causes the particle effect to restart playing when its specified 'lifetime' has been reached. A life-mode of KILL causes the particle effect to be deleted when its specified 'lifetime' has been reached. A life-mode of STOP causes the particle effect to stop playing (but not be deleted) when its specified lifetime has been reached.

Returns
  No return value.

void setLifetime | ( | lifeTime |  | ) |

Sets the lifetime of the particle effect.

Parameters

  lifeTime | The lifetime of the particle effect. This is used according to the 'lifeMode' setting.

Returns
  No return value.

Boolean setRepeatTime | ( | repeatTime |  | ) |

Sets the time period to repeat (cycle) the fields' values at.

Returns
  Whether the operation was successful or not.

Integer setSingleDataKey | ( | value |  | ) |

Sets a single data-key at time-zero with the specified value. All existing keys are cleared.

Parameters

  value | The value to set the key to.

Returns
  Returns the index of the new data-key (always zero) or -1 on failure.

Boolean setValueScale | ( | valueScale |  | ) |

Set the scaling of field values retrieved from the field. This does not alter the actual data-key values.

Parameters

  valueScale | The scale for field values retrieved from the field.

Returns
  Whether the operation was successful or not.