Difference between revisions of "OnBeginState"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Cipscis
(This event ''will'' be called when the object is sent into an undefined state, such as "")
imported>Antares
(Was curious if multiple GoToState calls would send multiple events if they were all for the same state. Seems like they do. Updated the page with this info)
 
Line 7: Line 7:


This event ''will'' be called if the object it sent to a state that is not defined, including states that cannot be defined such as those with invalid names (e.g. "State #3" or "").
This event ''will'' be called if the object it sent to a state that is not defined, including states that cannot be defined such as those with invalid names (e.g. "State #3" or "").
This event will also be called by any subsequent GoToState() calls even if the script is already in that state.


== Syntax ==
== Syntax ==

Latest revision as of 14:13, 12 September 2016

Member of: Any and all scripts.

Event called when the state the event is in has just been switched to. Note that this event will not be called for an auto state when the object is initialized.

This event will be called if the object it sent to a state that is not defined, including states that cannot be defined such as those with invalid names (e.g. "State #3" or "").

This event will also be called by any subsequent GoToState() calls even if the script is already in that state.

Syntax[edit | edit source]

Event OnBeginState()

Parameters[edit | edit source]

None

Example[edit | edit source]

State Running
  Event OnBeginState()
    Debug.Trace("Entered the running state!")
  EndEvent
EndState

See Also[edit | edit source]

OnEndState