English

Forum

Back to OverviewNew post
nfuchs
nfuchs

Can I control charater''s animations with actions?

12/21/2011, 13:34
Hello!

-The following is what I'd like to be able to do:
My character is standing. I want him to go somewhere on the screen. According to where I click (let's say its direction 'right'wink I'd like the engine to play a 'turning to right' animation I've created (while holding it's position on screen), then when this turning anim ended, start moving the character to the direction I've clicked (while playing it's regular walking animation (right)).
If it's upper right direction the I'd like the engine to playe the 'Turning upwards to the right' anim and then start moving the character toward the position...and so all the other directions.

When the character is near it's destination I'd like the engine to slow down the movement of the sprite and the animation too...according to speed reducing parameters I set via numbers or curves and before the movement fully stops, I'd like the engine to play a 'the character stops' anim I created. This would be a few frames showing tha character stepping into the standing position of that direction it came from.

So this way I could create nicely blending animations and overcome the 'moonwalking character' effect we now see in 2d games.

-Also I'd like to be able to set the walking speed individually for vertical movement and for horizontal movement aswell.

Are these possible right now with the engine ( I could'n tfigure it out yet ) or can it be done if someone knows how to script it?

I hope I was clear and you understand what I'm talking about. smile

Thanks!
 
petitfilou
petitfilou

RE: Can I control charater''''s animations with actions?

12/21/2011, 18:24
I agree, it would be nice to have more control over the vertical and horizontal speed. The characters seem to walk from A to B in the vertical, way too fast, compared to horizontal speed.
And a small turn of the character before he/she walks the other way would be nice. It's 2 things for example Day of the Tentacle does well.
 
Alex
Alex

RE: Can I control charater''''s animations with actions?

12/23/2011, 18:06
I already know how the character movement should be improved. This would allow individual speed for each direction, actually only moving the character depending on the current animation frame. This would avoid the "moonwalking" effect. Unfortunately I didn't have time to implement it so far.

I think further customizations should be done with lua function hooks/event handlers but I'm not sure yet how they should look like.
 
nfuchs
nfuchs

RE: Can I control charater''''s animations with actions?

12/26/2011, 16:51
That sounds good. But does it solve the instantly turning character problem?
I was trying to blend the animations...The idea was, when I click somewhere, I wanted to change the character's outfit to one wich has only turning animations and after the turning anim played, then change the outfit back to the normal one wich has regular walking animations loaded and start the movement of the sprite. I couldn't do it...the 'delay movement by x seconds after click happened' command is missing. confuse
 
Alex
Alex

RE: Can I control charater''''s animations with actions?

12/29/2011, 20:17
no, it doesn't solve the turning character problem. As I said we would need lua hooks to achieve this. I think hook functions would be the best solution, it would keep the editor simple and still give maximum flexibility. Only drawback is that you would need a script - but this needs only be written once and then could be shared by other users. The only question remains is how the lua hook(s) should look like?

I was thinking about something like this:
a hook "onCharacterDirectionChanged" which is called when the character direction is changed (obviously). If the function returns true the character is still turning and should not move forward, if it returns false the character should start moving again with the currently set direction. The function has two parameters, the first is the character (as a Visionaire object), the second parameter is the destination direction (after turning is finished). When the character is turning you could start the standing animation for the desired direction and show the first frame. Or you could start an own character animation especially created when the character is turning.

maybe some of the more experienced users could post their opinion if this would be a good solution. Other ideas are also welcome.
 
Back to OverviewNew post