GotoState - All Scripts

From the CreationKit Wiki
Revision as of 16:02, 26 October 2011 by imported>Jlundin
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: Any and all scripts.

Sets this object's current state, issuing OnBeginState and OnEndState events as necessary.

Syntax[edit | edit source]

Function GotoState(string asNewState)

Parameters[edit | edit source]

  • asNewState: The state to go to. Subsequent calls to GetState will return this string exactly as passed in. The state name is not case-sensitive with the state blocks in script.

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; Set this object as being in the "Running" state
GotoState("Running")

Notes[edit | edit source]

GotoState doesn't return until the OnEndState event of the current state and the OnBeginState event of the new state finish running. (And the events won't overlap)

See Also[edit | edit source]