SetActorState
From ZDoom Wiki
int SetActorState (int tid, str statename, optional bool exact);
Usage
Forces the actor(s) with the matching tid into the specified state, as defined in Decorate. If tid is 0, the activator is affected.
The final parameter, exact, specifies whether or not partial state name matches are accepted. If you don't specify it or set it to false, if you try to do something like:
SetActorState (0, "Foo.Bar");
and the actor has a Foo state but no Foo.Bar state, it will enter the Foo state. If you set exact to true:
SetActorState (0, "Foo.Bar", true);
then the actor must have a Foo.Bar state, or it will not change state at all, even if it has a Foo state.
The return value for this function is the number of actors that successfully changed state.
Note that you should refrain from using this function for any actors that use the monster AI, or unpredictable results could occur.
Examples
| Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contibutions are greatly appreciated. |

