TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Object
Function Categories

## Functions
Boolean | isObject (handle)
Integer | nameToID (string objectName)

## Detailed Description

## Function Documentation

Boolean isObject | ( | handle |  | ) |

check if the name or ID specified is a valid object.

Parameters

  handle | A name or ID of a possible object.

Returns
  true if handle refers to a valid object, false otherwise

See Engine Function/Method
  Sim::findObject

Integer nameToID | ( | string | objectName | ) |

Use the nameToID function to convert an object name into an object ID.

Helper function for those odd cases where a string will not covert properly, but generally this can be replaced with a statement like: ("someName")

Parameters

  objectName | A string containing the name of an object.

Returns
  a positive non-zero value if the name corresponds to an object, or a -1 if it does not.

See Engine Function/Method
  Sim::findObject