Sign in to follow this  
N-DReW25

Player Animations during conversation.

Recommended Posts

Hi, I was wondering if it would be at all possible to have the player character perform animations during a conversation with an NPC. What I want is for the player to play an animation during the entirety of an NPC line but also perform the same animation during the "reply menu" like the one shown down below.

 

img-33.jpg

 

This specific animation is the animation in TSL where the NPC is picked up off the ground and is choking in mid air.

Share this post


Link to post
Share on other sites

I don't know if a DLG will respect anims specified directly on a reply node. I seem to recall in K1 not having any luck with that. But you should be able to script it. Although in both cases the actual node isn't what you see in the pic above, as you haven't chosen it yet. You may actually need to insert some dummy nodes that fire an animation beforehand so they are playing while the player waits to make a choice. Or fire the script on the previous entry with a delay so it starts once the NPC's VO finishes.

19 minutes ago, N-DReW25 said:

This specific animation is the animation in TSL where the NPC is picked up off the ground and is choking in mid air

The Sith Lord power Crush?

Edit: Ah, LIFTED_CHOKED.

Share this post


Link to post
Share on other sites
33 minutes ago, DarthParametric said:

I don't know if a DLG will respect anims specified directly on a reply node. I seem to recall in K1 not having any luck with that. But you should be able to script it.

The Sith Lord power Crush?

If it is the animation seen in these screens then yes, those are the ones I'm looking. (Atton and Tobin)

nnnnn.PNG.a103d554c9894ae4dfe966ca9a5be641.PNG

I do have a script here where an animation does play via said script though I cannot seem to find the ID value for the generic Force Crush animation "10460" in the dlg editor where the animations generally are located... yet alone the animation I'm looking for (The animation ID seems to be 1024 in the dlg but not for the script)

Quote

     DelayCommand(3.0, AssignCommand(oDarthNihilus, ActionPlayAnimation(121, 1.0, 2.0)));
    DelayCommand(3.0, AssignCommand(oDarthNihilus, ActionWait(4.0)));
    DelayCommand(3.0, AssignCommand(GetFirstPC(), ActionPlayAnimation(10460, 1.0, 3.0)));
    DelayCommand(3.0, AssignCommand(GetObjectByTag("VisasMarr", 0), ActionPlayAnimation(10460, 1.0, 3.0)));
    DelayCommand(3.0, AssignCommand(oMand, ActionPlayAnimation(10460, 1.0, 3.0)));

 

Would it be possible to modify this script with the correct ID I need and make it so the animation plays indefinitely until a second script later on removes it and/or overwrites it with the "dropping" animation which would free the player from this animation.

v vnmnm.PNG

Share this post


Link to post
Share on other sites
2 hours ago, N-DReW25 said:

The animation ID seems to be 1024 in the dlg but not for the script

Scripting animations in TSL requires adding 10,000 to the ID in animations.2da. So 10460 in the script is animation 460, i.e. Damage_Force_Crush. The 121 in the first line is a constant in nwscript.nss, ANIMATION_FIREFORGET_FORCE_CAST. I'm not exactly sure where the animations in a DLG are pulled from. The second half of the list, the ones that start at 10006 (DEAD) come from dialoganimations.2da, but I don't know what the source of the 1xxx numbered ones is (it doesn't match up with animations.2da). There are also names for ones in the 10xxx range that are starred out in dialoganimations.2da. Perhaps @JCarter426 can chime in with some insight on this.

But all that aside, what you have pictured there with Sion/Atton is not the Force Crush animation, those are the Hanharr/Mira cutscene animations. On the supermodels, the animation Atton is using is named CUT026L while the one Sion is using is named CUT022L. Looking at 303mira.dlg, the interesting thing is that Mira's middle looping animation (CUT026L) doesn't have a proper reference. Hanharr uses 1421 LIFT_CHOKE_HOLD but Mira uses 1425 SIT_CHAIR_DRINK. The only three animations on her body model are CUT025 / CUT026L / CUT027 (being picked up, looping in mid-air, being dropped), so it doesn't appear to be an animation override (since sitting in a chair drinking is animation animloop02 on the supermodel).

The good news is though that you can script those animations simply by adding 10K to the value shown in DLGEditor, assuming you can't add it directly to the DLG. Using:
 

AssignCommand(oTarget, ActionPlayAnimation(11425, 1.0, -1.0))

will play the same animation Atton is using in your screenshot. But you'll also want to bookend that with being picked up and dropped, assuming you are going for that specific sequence.

Share this post


Link to post
Share on other sites
2 minutes ago, DarthParametric said:

But all that aside, what you have pictured there with Sion/Atton is not the Force Crush animation, those are the Hanharr/Mira cutscene animations. On the supermodels, the animation Atton is using is named CUT026L while the one Sion is using is named CUT022L. Looking at 303mira.dlg, the interesting thing is that Mira's middle looping animation (CUT026L) doesn't have a proper reference. Hanharr uses 1421 LIFT_CHOKE_HOLD but Mira uses 1425 SIT_CHAIR_DRINK. The only three animations on her body model are CUT025 / CUT026L / CUT027 (being picked up, looping in mid-air, being dropped), so it doesn't appear to be an animation override (since sitting in a chair drinking is animation animloop02 on the supermodel).

Oh, alright. I have investigated a little bit and I think 1024_LIFTED_CHOKED is the animation to begin the choking animation while 1425_SIT_CHAIR_DRINK appears to be the continuation choking variant and 1026_CHOKED_DROPPED appears to be the end of it.

 

1 hour ago, DarthParametric said:

Scripting animations in TSL requires adding 10,000 to the ID in animations.2da. So 10460 in the script is animation 460, i.e. Damage_Force_Crush. The 121 in the first line is a constant in nwscript.nss, ANIMATION_FIREFORGET_FORCE_CAST. I'm not exactly where the animations in a DLG are pulled from. The second half of the list, the ones that start at 10006 (DEAD) come from dialoganimations.2da, but I don't know what the source of the 1xxx numbered ones is (it doesn't match up with animations.2da). There are also names for ones in the 10xxx range that are starred out in dialoganimations.2da. Perhaps @JCarter426 can chime in with some insight on this.

I tried adding "11024" to the script and as it turns out it worked. The choking and rising animation played out but since the choking and floating animation is a separate animation the player simply went back to its normal idle position.

Share this post


Link to post
Share on other sites

Yeah you'd ideally want to specify the three animations across three DLG nodes, just like is done in the Hanharr/Mira scene. You could try scripting it, but I suspect that would have problems between each animation. Cobbling it together as a stunt animation would probably be the best bet, since you could adjust the scene exactly to make sure you get proper alignment (unlike what is shown in your Sion screenshot), but that would require 3DS Max shenanigans and static cameras for the entire scene.

Share this post


Link to post
Share on other sites
5 minutes ago, DarthParametric said:

Yeah you'd ideally want to specify the three animations across three DLG nodes, just like is done in the Hanharr/Mira scene. You could try scripting it, but I suspect that would have problems between each animation. Cobbling it together as a stunt animation would probably be the best bet, since you could adjust the scene exactly to make sure you get proper alignment (unlike what is shown in your Sion screenshot), but that would require 3DS Max shenanigans and static cameras for the entire scene.

Fortunately for me, my scene with this animation is where an NPC uses the Force to levitate choke the PC like with Tobin (I used the Atton scene to demonstrate the animation I wanted, not the scene I was trying to make. Sorry for the confusion).

 

2 hours ago, DarthParametric said:

The good news is though that you can script those animations simply by adding 10K to the value shown in DLGEditor, assuming you can't add it directly to the DLG. Using:
 


AssignCommand(oTarget, ActionPlayAnimation(11425, 1.0, -1.0))

will play the same animation Atton is using in your screenshot. But you'll also want to bookend that with being picked up and dropped, assuming you are going for that specific sequence.

Tbh, I didn't even see this last bit. I have an issue where as soon as the player picks a reply option he suddenly just falls to the ground and doesn't perform an animation even if the dialogue reply has another script which is supposed to raise him again,  I suspect the reason he prematurely drops is because of the "-1.0" (As long as any party members under the effect don't speak, they will remain afloat). Setting the "-1.0" to "9999.0" fixes that but I do suspect that "9999.0" is a timer meaning in about 2 real life hours the animation would stop, the problem with this is that the animation won't stop even if I try to force the player to perform a new animation. 

 

Would you know of any means I can force the player to stop?

Share this post


Link to post
Share on other sites

You'll need to do a ClearAllActions on them first.

AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionPlayAnimation(1234567, 1.0, -1.0))

You could try something like ANIMATION_LOOPING_PAUSE for 1.0 or something like that.

Share this post


Link to post
Share on other sites
On 9/13/2019 at 11:14 PM, DarthParametric said:

You'll need to do a ClearAllActions on them first.


AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionPlayAnimation(1234567, 1.0, -1.0))

You could try something like ANIMATION_LOOPING_PAUSE for 1.0 or something like that.

With this, I do believe I have achieved what I was looking for.

 

Thank you for your assistance.

Share this post


Link to post
Share on other sites
On 9/13/2019 at 4:45 AM, DarthParametric said:

The second half of the list, the ones that start at 10006 (DEAD) come from dialoganimations.2da, but I don't know what the source of the 1xxx numbered ones is (it doesn't match up with animations.2da). There are also names for ones in the 10xxx range that are starred out in dialoganimations.2da. Perhaps @JCarter426 can chime in with some insight on this.

Animations in the 1000s are what I call "complex" animations - one sequence split across two or three different animations. They are meant to be added to consecutive nodes in the dialogue file, although they can also be scripted with as you two noticed. A typical sequence goes like this:

  • 10xx: Start of animation sequence (fire and forget)
  • 14xx: Middle of animation sequence (looping)
  • 10xx: End of animation sequence (fire and forget)

with the last digit incremented to give at least some idea of what follows what.

Here's a real example:

  • 1014: CROUCH_SHORT
  • 1415: CROUCH_LONG
  • 1016: COURTSY

Unfortunately, the names aren't always correct or even spelled correctly.

They still count as dialogue animations so that's why they don't match what's in animations.2da.

Share this post


Link to post
Share on other sites

DLGEditor isn't pulling them from any game file; the animations are enumerated in the DLGEditor code. Where this information came from, I don't know. It's not in animations.2da or dialoganimations.2da or anywhere else I've looked.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this