Hello everyone. I have a very weird issue I cannot solve.
I have only left and right animations for my main actor. No up, down or diagonal animations exist. I simply use the left and right animations everywhere:
; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\
ACTOR
{
NAME = "MainActor"
CAPTION=""
SCALABLE = TRUE
INTERACTIVE = FALSE
SCRIPT="actors\MainActor\MainActor.script"
FONT = "fonts\outline_red.font"
ANIMATION
{
NAME = "idle"
LEFT = "actors\MainActor\left\idle.sprite"
RIGHT = "actors\MainActor\right\idle.sprite"
UP = "actors\MainActor\right\idle.sprite"
DOWN = "actors\MainActor\right\idle.sprite"
UP_LEFT = "actors\MainActor\left\idle.sprite"
UP_RIGHT = "actors\MainActor\right\idle.sprite"
DOWN_LEFT = "actors\MainActor\left\idle.sprite"
DOWN_RIGHT = "actors\MainActor\right\idle.sprite"
}
ANIMATION
{
NAME = "walk"
LEFT = "actors\MainActor\left\walk.sprite"
RIGHT = "actors\MainActor\right\walk.sprite"
UP = "actors\MainActor\right\walk.sprite"
DOWN = "actors\MainActor\right\walk.sprite"
UP_LEFT = "actors\MainActor\left\walk.sprite"
UP_RIGHT = "actors\MainActor\right\walk.sprite"
DOWN_LEFT = "actors\MainActor\left\walk.sprite"
DOWN_RIGHT = "actors\MainActor\right\walk.sprite"
}
ANIMATION
{
NAME = "talk"
LEFT = "actors\MainActor\left\talk.sprite"
RIGHT = "actors\MainActor\right\talk.sprite"
UP = "actors\MainActor\right\talk.sprite"
DOWN = "actors\MainActor\right\talk.sprite"
UP_LEFT = "actors\MainActor\left\talk.sprite"
UP_RIGHT = "actors\MainActor\right\talk.sprite"
DOWN_LEFT = "actors\MainActor\left\talk.sprite"
DOWN_RIGHT = "actors\MainActor\right\talk.sprite"
}
}
I display the dialogue in comic book bubbles above the actors. I don't use
actor.Talk(), instead I have my own mechanism that prints the text in a static control inside the bubble. But, I use
actor.TalkAsync("", null, 10000) to trigger the talk animations of each actor.
My issue is that, sometimes my main actor uses the opposite direction animation. When I click on another actor, he walks toward the point I want him to stand, turns to the other actor (I explicitly call
MainActor.TurnTo(direction)). e.g. He has direction 2 (DI_RIGHT) but, while TalkAsync is running, he turns left (i.e. the "left" talk animation is played). Game.Msg(MainActor.Direction) displays 2 which is the correct direction.
This does not always happens. One functionality of my game is that when user clicks on the exit, he immediately exits without walking. So, if I am at a scene and talking to another actor and I am turned left while talking, then I click on exit, go to another scene (through the map), and talk to another actor, this issue occurs. When I click somewhere to walk around and then go back and talk to the other actor, the issue vanishes, but not always!
Is there something I don't understand about TalkAsync or actor directions?