Idle animation speed help

Started by , Tue 03/02/2009 18:03:33

Previous topic - Next topic

m0ds

Hola! I've tried searching but haven't found a particular solution, but all my character's idle animations run extremely slowly. The view/loops are set to delay 0 and the overall animation speed for each character is 3 which means their animations should run quite quickly, but none of the idle animations do. With AnimateCharacter you'd call the delay interval between frames ie 5 or 3 or whatever but how do you set that for Idle animations? Because it seems to be at a default of about 5 or 6, which is too slow for me because the animations are quite lengthy.

Many thanks :)

Pumaman

Hmm, the idle animation speed is currently hardcoded to the character's Animation Speed + 5.

I'd forgotten it did that, and it's a bit rubbish, I need to fix it.

As a workaround, you can set the individual frame delay of each frame in the idle view to -5 or something, to counteract it.

m0ds

Gotcha, thanks for the reply CJ. I'll try the -5 trick then :)

m0ds

Hi CJ, this doesn't resolve the issue :( No change in animation speed.

Any other ideas?

I'm still getting used to the latest version, but if it doesn't exist yet perhaps it'd be worth including a third option in SetIdleView to set the animation speed in future editions :)

Pumaman

Strange, has anyone else had problems with the frame-specific delay not being applied?

ThreeOhFour

I got around this problem in the past by using a timer and a check in the room's repeatedly execute function, but this was with an older version of the editor.

It's a pretty rubbish way of doing it, but it seemed to work alright (except for some reason I had to make it blocking, which was silly).

I'd love an adjustable character idle animation speed  property :).

Dave Gilbert

Hi!  This is a bit of an old thread, but I have encountered this exact same problem.  I tried doing the framerate speed thing, but I had the same problem as M0ds (i.e., it didn't work).  Was this ever resolved or did anyone ever find a workaround? 

Grim

Had that problem few weeks ago. The -5 trick worked for me, so it's definitely worth a try!:)

TM

Quote from: Dave Gilbert on Thu 25/02/2010 17:24:45
Hi!  This is a bit of an old thread, but I have encountered this exact same problem.  I tried doing the framerate speed thing, but I had the same problem as M0ds (i.e., it didn't work).  Was this ever resolved or did anyone ever find a workaround? 

The solution is to not enter the -5 value in the preview pane (where it gets auto reset to 1), but down in the display settings box where it says "delay", above "flipped". That's how I got it to work, anyway.

My website & blog

DoorKnobHandle

Sorry to warm this up again but it still is relevant.

I have an idle view with 8 directions and 32 frames for each. I *need* the idle view to play at a much faster rate than what it is currently and there's no way I'm entering some value into 256 fields (frame delay for every frame) and then don't even know if that new one is correct.

Any news on this? I was actually a little surprised to see such a common thing missing from AGS functionality!

Khris

This should do it:

Code: ags
void SetFrameDelay(int view, int value) {
  int l, f;
  ViewFrame*vf;
  while (l < Game.GetLoopCountForView(view)) {
    f = 0;
    while (f < Game.GetFrameCountForLoop(int view, int l)) {
      vf = Game.GetViewFrame(int view, int l, int f);
      vf.Speed = value;
      f++;
    }
    l++;
  }
}

DoorKnobHandle

#11
Unfortunately, ViewFrame.Speed is read-only! :(

EDIT: And there doesn't seem to be a way to edit the speed/delay value for a viewframe via code at all. Oh noes!!

Khris

Oh my, that's unfortunate indeed.
You could do the idle animation manually. But changing its speed should really be supported, I'd post this in the current wish list thread.

Dave Gilbert

The only way to really handle this is to avoid the SetIdleView function altogether and run the animation manually using a timer.  This has lots of other unforeseen complications (like if you make the character walk while the animation is playing, the character could get stuck in the idle animation while it is moving), but it's the only way I've managed to get it right.

m0ds

#14
Sorry to drag up and old thread but dagnabit, still having some issues here. Did anything ever happen about this or is there a better workaround? I can play the animations manually but that becomes a problem with scenes that are already quite animation heavy. Thanks!

edit: Actually, for NPC's "if cEgo.Animating == false" is okay. But for the main character...not so easy.

Weilard

Sorry for my bad habit for digging graves. But I suppose that this type of archeology little bit better than creation new earth holes. Have any news from this ancient place? What about idle animation speed?

Danvzare

Quote from: Weilard on Mon 14/11/2016 06:24:10
Sorry for my bad habit for digging graves. But I suppose that this type of archeology little bit better than creation new earth holes. Have any news from this ancient place? What about idle animation speed?
In the view that contains the idle animation, you can setup the delay of each frame, making the animation take as long as you want.
If you want to speed it up though, I think your only option is to change the character's rather general AnimationDelay property, and adjust the delay on the frames on all of their other views.

Crimson Wizard

What if you change Character.AnimationSpeed only for the time of idle animation? You can detect if character is currently running idle animation in rep exec:

Something along the lines of:
Code: ags

function repeatedly_execute_always()
{
    if (player.Animating && player.View == player.IdleView)
        Character.AnimationSpeed = IDLE_ANIM_SPEED;
    else
        Character.AnimationSpeed = NORMAL_ANIM_SPEED;
}


This could be optimized a bit, of course, but I am curious if this solution will work in general.

SMF spam blocked by CleanTalk