by randi » Mon Mar 19, 2007 5:02 pm
There you go:
Code: Select all
int SetActorState (int tid, str statename, optional bool exact);
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:
Code: Select all
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.
There you go:
[code]int SetActorState (int tid, str statename, optional bool exact);[/code]
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:
[code]SetActorState (0, "Foo.Bar");[/code]
and the actor has a Foo state but no Foo.Bar state, it will enter the Foo state. If you set exact to true:
[code]SetActorState (0, "Foo.Bar", true);[/code]
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.