Thanks chris. Can i use char.charstate to check the character state ? Like this:
if(_char.charstate==AC.charstate.idle)
i used this but always return true. Even if the character is in talk or walk state. Thanks again
I'm using 1.73.5, I updated to the latest version but then my project got a few errors and I decided to revert to 1.73.5 that was best for me, but for now, I want to play custom animations to characters when they're not talking or walking (in idle mode) I created a custom actionlist but this is my problem now, I used same charstate function that I said earlier for the player and its works good but for NPCs its not. i used charstate and isTalking but none of them works for NPCs. and yes I use regular speech system. i will test more solutions. thanks again Chris. have a good day
Comments
You can access the NPC's isTalking property and IsMovingAlongPath function to check these states.
See the Manual's "Character scripting" chapter, and the Scripting guide's Char class for details on accessing character information through script.
if(_char.charstate==AC.charstate.idle)
i used this but always return true. Even if the character is in talk or walk state. Thanks again
Characters can walk and talk independently, so charState can't be used to check if a character is talking.
The charState variable should be set Move when walking, though. An alternative would be to check their moveSpeed is over a set threshold, i.e.:
I can't recreate such an issue. What is your AC version, and are you using AC's regular speech system for dialogue?
I'm using 1.73.5, I updated to the latest version but then my project got a few errors and I decided to revert to 1.73.5 that was best for me, but for now, I want to play custom animations to characters when they're not talking or walking (in idle mode) I created a custom actionlist but this is my problem now, I used same charstate function that I said earlier for the player and its works good but for NPCs its not. i used charstate and isTalking but none of them works for NPCs. and yes I use regular speech system. i will test more solutions. thanks again Chris. have a good day
An alternative to using isTalking would be to hook into the OnStartSpeech and OnStopSpeech custom events, in a script attached to the character:
thanks a lot, Chris. I'll try this. thanks again and have a nice day