Working with StateMachine Assets

For game objects that include a state machine reference, you can drag and drop state machine assets onto game objects in the LevelEditor Project Lister. The game object’s behavior is then determined by the state machine to which it is bound. For each individual game object that includes a state machine reference, you can modify its state machine properties to specify the object’s desired behavior in the game environment.

To add state machines to a game object, perform the following tasks:

  1. Add the game object to the project, and select it in the Project Lister. Ensure that the object has a state machine reference (stmRef property).
  2. Drag a StateMachine Editor project file (.stmproj) from the “AI” folder of the Resources list to the game object’s stmRef property in the Project Lister, as shown in the figure below.
  3. Select the game object’s stmRef property and open the Property Editor (or Grid Property Editor) to modify the object’s state machine properties, as shown in the figure below. The figure shows a state machine for a tank object.

 

The figure below shows a tank object with an associated state machine that specifies the object’s name, aggression, approach speed, intelligence, and turn radius. You can change the default state values using the slider bars in the Property Editor, or you can edit them directly in either the Property Editor or Grid Property Editor. You can select a state property to view a description of that property; these descriptions are defined as annotations in the StateMachine Editor.