Aller au contenu

Photo

Jittery animation during cutscene


  • Veuillez vous connecter pour répondre
13 réponses à ce sujet

#1
rjshae

rjshae
  • Members
  • 4 478 messages

I'm having an issue where looping animation isn't working properly in a cutscene and I suspect it's the cutscene mechanics that's causing it. I've got a custom action script that applies a death animation as follows:

DelayCommand( 0.9, AssignCommand( oPC, ActionPlayAnimation( ANIMATION_LOOPING_DEAD_BACK, 1.0, 25.0 ) ) );

During the subsequent cutscene activities though, one or both of the 'dead' actors stand up for a little bit, then flop back down again. Is there a way to make the animation "stick"? I want the two to stay down until the cutscene is over. I've tried applying a delayed paralyze effect, but it only helps a little.

 

Thanks.



#2
Tchos

Tchos
  • Members
  • 5 030 messages

If the animation contains frames of the character standing, then it will stand up when the animation loops.  You would need to play the falling down animation once, and then switch to an idle "on the ground" animation for the rest of the time.



#3
kevL

kevL
  • Members
  • 4 052 messages

ActionPlayAnimation ?

now, i'm not sure (i'm really not) - but shouldn't you switch to PlayCustomAnimation() in a wrapper, for NwN2?


And does anyone know if the constants for ActionPlayAnimation() are in fact different (ie, additional to) the strings used for PlayCustomAnimation()

I found that, using the latter, to get NPC to fall down and stay down I had to hunt around for a bit through the NwN2 Custom Animations -- "*proneB" is a good one i think. You might have to find a fall that segues into it nicely, and end up with something like this

    ActionDoCommand(PlayWrapper(oTarget, "wildshape", FALSE));
    ActionDoCommand(PlayWrapper(oTarget, "*proneB", TRUE));

where PlayWrapper() is just a void-returning wrapper for PlayCustomAnimation() - so the code compiles when it's put inside

AssignCommand()
DelayCommand()
ActionDoCommand()

... you know the drill,

#4
rjshae

rjshae
  • Members
  • 4 478 messages

If the animation contains frames of the character standing, then it will stand up when the animation loops.  You would need to play the falling down animation once, and then switch to an idle "on the ground" animation for the rest of the time.

 

Yes, that seems to work. Thanks.



#5
Tchos

Tchos
  • Members
  • 5 030 messages

And does anyone know if the constants for ActionPlayAnimation() are in fact different (ie, additional to) the strings used for PlayCustomAnimation()

 

That information is in nwn2_animcom.2da and nwn2_animstan.2da.  As far as I can tell, the constants only allow for a subset of the available animations that PlayCustomAnimation can use.  But I also notice that these constants are mapped to multiple custom animation names (a standard and an alternate).  Don't know how those alternates are used.



#6
kevL

kevL
  • Members
  • 4 052 messages

i was looking at those two files, the row#'s don't seem to line up with the constants. /oh well



#7
rjshae

rjshae
  • Members
  • 4 478 messages

Unfortunately, if I put the PlayCustomAnimation in a loop, it keeps playing even after another animation is activated and I try clearing all actions.



#8
Tchos

Tchos
  • Members
  • 5 030 messages

i was looking at those two files, the row#'s don't seem to line up with the constants. /oh well

 

These are what the constants match up to:  http://nwn2.wikia.com/wiki/ANIMATION_*

 

Unfortunately, if I put the PlayCustomAnimation in a loop, it keeps playing even after another animation is activated and I try clearing all actions.

 

To "clear" a custom animation, tell it to play the custom animation of "idle".

 

Then again, if you already tried telling it to play a different animation, maybe that won't work.  I seem to recall it working, though.



#9
4760

4760
  • Members
  • 1 204 messages

Unfortunately, if I put the PlayCustomAnimation in a loop, it keeps playing even after another animation is activated and I try clearing all actions.


To clear the looping animation, use "%" for the animation name.

#10
kevL

kevL
  • Members
  • 4 052 messages

These are what the constants match up to:  http://nwn2.wikia.com/wiki/ANIMATION_*


yes i was looking at that too. Those are NwN constants for ActionPlayAnimation(). Can someone explain to me how those constants match up with these string literals?

if they do

#11
rjshae

rjshae
  • Members
  • 4 478 messages

To clear the looping animation, use "%" for the animation name.

 

Interesting. How on earth did you come up with that? Is it an animation file name?



#12
4760

4760
  • Members
  • 1 204 messages

Interesting. How on earth did you come up with that? Is it an animation file name?


No, I don't think it's an animation file name. I suppose it's a hard-coded shortcut. I found it in the comments of a script; I don't remember which one but it was probably related to cutscenes.
  • rjshae aime ceci

#13
Tchos

Tchos
  • Members
  • 5 030 messages

yes i was looking at that too. Those are NwN constants for ActionPlayAnimation(). Can someone explain to me how those constants match up with these string literals?

 

Ah, I see what you mean.  I was thinking of the VFX match-ups.



#14
kevL

kevL
  • Members
  • 4 052 messages
I tried a few of them, they look the same - just a different front end to invoke.

and Ofc, a lot more are available to NwN2's PlayCustomAnimation(), a few hundred vs. ~80 ... methinks ActionPlayAnimation() is defunct outside of special purposes like porting NwN scripts to NwN2 [perhaps].