aimodel.setInitialState

Flag one AIModel state to be the initially active one.

Prototype

  1. bOk = aimodel.setInitialState ( hAIModel, sName|nIndex )

Description

Flag one AIModel state to be the initially active one according to its specified name or index.


Parameters

hAIModel - valid AIModel handle
sName|nIndex - state name string or index number 1..nStateCount


Return values

bOk - true on success


Sample

  1. -- if just one state exists, make it the initial one
  2. if ( aimodel.getStateCount ( hResource ) == 1 ) then
  3. aimodel.setInitialState ( hResource, 1 )
  4. end

Available since ShiVa 2.0