SetActorState:A question about future custom states support
Moderator: GZDoom Developers
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
- TheDarkArchon
- Posts: 7656
- Joined: Sat Aug 07, 2004 5:14 am
- Location: Some cold place
There you go:
If tid is 0, it affects the script activator, otherwise it affects all the matching actors. Statename is the name of the state you want to put the actor in. 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:
and the actor has a Foo state but no Foo.Bar state, it will enter the Foo state. If you set exact to 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.
Code: Select all
int SetActorState (int tid, str statename, optional bool exact);Code: Select all
SetActorState (0, "Foo.Bar");Code: Select all
SetActorState (0, "Foo.Bar", true);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.
- Cutmanmike
- Posts: 11354
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
- Shadelight
- Posts: 5113
- Joined: Fri May 20, 2005 11:16 am
- Location: Labrynna
