Animations In Conversations (Via the editor) - Not Always Working

@Gnomocratic_Agent,

Your info may help @4760 more than myself, as this is outside of my knowledge. :slight_smile:

However, I still believe there is some other issue at work here, as I have had the SAME animation work on one node and then fail on another … on the same model and in the same conversation.

I also set up a test where I had a male elf do various animations from a node. I then ran the same conversation twice or more, and some animations would fail a second time around.

Hopefully, those who understand animations and models far more than I do will be able to crack it eventually … maybe somebody like yourself?

For example, how do you get on with the SCRATCH_HEAD animation repeated in the same conversation … or perhaps those mentioned by others above - which they got to work, but I could not?

Thanks, Lance.

Hard to troubleshoot for you without the dialog files and scripts in question. But feel free to send them my way. the appearance.2da too

2 Likes

@Gnomocratic_Agent

Thanks for taking a look …Files removed.

Unfortunately, I deleted the conversations as they were only test ones. Basically, I just had a MALE ELF with a conversation attached and with various animations attached to their different response nodes.

A particularly weird one (for me) was the SCRATCH_HEAD that worked the first time around but would fail subsequently.

Check my list in the above thread for my entire results list, and maybe you can confirm or deny of any are different for you … but the SCRATCH_HEAD would be a start.

Thanks, Lance.

I’d suggest trying with firing the animation from a script.
void main()
{
PlayCustomAnimation(OBJECT_SELF, ā€œanim_file_name_whatever_it_isā€, FALSE);

}
put that into an nss, compile, use it in the convo, you’d need to find the animation file name.

I think it’d be P_HHM_scratchhead.gr2 so in that quote you’d just write in ā€œscratchheadā€
so the line would be PlayCustomAnimation(OBJECT_SELF, ā€œscratchhead", FALSE);

you can also make it loop by turning that FALSE to TRUE or play faster with a decimal value, so like
PlayCustomAnimation(OBJECT_SELF, ā€œscratchhead", TRUE, 0.5f);
would loop it twice as fast

@Gnomocratic_Agent,

There is a ga script that does something like this, which I imagine may well work, hopefully. (Not tried, but may well resort to it if need be.)

I just noticed your second post with info, so I will check that too. Thanks.

I suppose I was hoping there may be an answer to why the animation tab in the conversation was so temperamental and that maybe I was missing some important point of application regarding its usage.

EDIT: I just knocked up a very quick TEST conv with three HEAD SCRATCH nodes and only the first one ever fires - but even this initial FAILS to fire on a subsequent conversation.

EDIT 2: OK, I just tested it again and this time I had a curious result … This time the head scratch worked on the initial node around 80% of the time (after restarting the conversation), but still failed on subsequent nodes. I could not see anything obvious happening on the elf other than it may have been due to the amount of time I left the conversation before starting it again. For instance, if the elf started to move again (before I restarted the conversation), then the conversation appeared to fail - but (again) I have not been able to say this is consistent.

(ALSO @4760) EDIT 3: OK - I think the initial one may fail if the NPC it is attached to is in the process of orienting themselves to the player - which is why it appeared random. That may explain the initial fail of the animation, but I still see no reason for the later nodes to fail.

Thanks, Lance.

Back later.

maybe the amount of time you take before firing the latter ones, if the previous anim isn’t finished running, it doesn’t get interrupted.

I did try delaying the next node by not moving the conversation forward and I know @4760 ensured the same with delays in his tests.

I thought about this too, and added ga_play_custom_animation("$OWNER", "%", 0, 0) at the node before the next animation but unfortunately it didn’t solve the issue.

i never could get animations to work properly with just the dialogue interface. i always use the ga_play_custom_animation script with an npc tag, which works as it should. obsidian used this script in their conversations too. to make sure that the animation works with the npc’s skeleton i cross reference the nwn2/data/lod_merged.zip file.

in a quick test i could fire the scratchhead animation multiple times in a row. in another node i stacked multiple scripts with different delay times, which also worked without issues. the npc knelt down, stayed idly in kneeling position and was reset to idle with passing % to the script. even rushing through the dialogue fires all the animations, overwriting the ones not finished. i don’t think that there’s a timing issue involved here.

ps: not tested with facial animations. i usually not bother with those.

Maybe the dialogue interface is just buggy when it comes to this then? The few times I’ve used animations in dialogue I’ve mostly used custom scripts, I believe. But I’ve had a bit of problems there too, with timing and such. Mostly the animations would run, but sometimes not right away. And don’t get me started on the sitting animations I’ve struggled with in my third module. Those gave me serious headaches and I gave up eventually. In the end those worked 50 % of the time, and I would just have to be satisfied with that.

Just for the sake of exhaustivity, did you set any duration to the nodes involved?

I don’t think so, based on your comment here, but in my case that would narrow the culprit to the action scripts I wrote I guess (namely: how to play several animations on the same node).
Thanks for the report @Semper

only at the node with stacked ga_play_custom_animation scripts. i looked up the duration of an animation in the animation viewer and set the duration accordingly. if there’s only one script attached to a node, i don’t use duration.

to clarify things: if there’re stacked ga_play_custom_animation scripts on a node with no duration set, only the last animation in the stack will be played, overwriting all the other animations. if there’re multiple nodes in quick sequence, each with ga_play_custom_animation script, then the running animation will be overwritten at the time a following node fires its script (plays the animation) IF it’s a different animation from the one already running. if the animations are the same, no overwriting happens.
after all the scripts are fired, the npc will return to the last looping animation. to return to idle one has to pass % to the ga_play_custom_animation script.

can’t really say if this breaks at one time in bigger projects. i tested this with a fresh module and a single area. the dialogue was set to multiplayer/non-multiplayer and nwn1/non-nwn1 style. didn’t clear my overwrite folder, and tested with and without the client extension enabled.
my last serious module is years in the past, and i can’t remember if there were issues with animations in dialogues, besides using the simple interface to select animations to be played.

@Semper

Yes, I have now resigned to doing them this way where there do not work. As you say, I used the ga_play_custom_animation script with scratchhead and it works fine from the node, whereas the conversation tab version simply does not fire for me.

I just find it strange how there are mixed results for both myself and others.

@4760
@andgalf

Thanks all, Lance.

Hi All,

OK, I have also found that if a conversation starts with a scripted animation, it helps to ā€œunlockā€ animations that follow. So, I even have ga_play_custom_animation using just the % at the first node where there isn’t any other animation and it appears to help animations on nodes that follow.

So, I still think that some animations are interrupted by things such as an initial setup of the conversation and potential other animations (that are not obvious) preventing some from playing.

Cheers, Lance.

@andgalf (This may interest you if your issues have been similar to my own with some triggers.)

EDIT: I have also discovered that (in my testing at least) that if a creature is in the middle of an animation, then a trigger to start a conversation with them may fail. I have found that I need to add the following line just after a ClearAllActions on them to help ensure the conversation starts from a trigger:-

PlayCustomAnimation(oSpeaker,"%", 0);

Thanks, Lance.

Well, I don’t know if you remember, but you, me and kevL_s were trying to get a scene of mine to work where sometimes, instead of sitting down just when a conversation started, they in a few cases walked a few steps forward toward the PC before sitting down and that screwed with things, since I wanted them to sit at a very particular spot on the ground. We never solved this.
I don’t know if this new information could help but…well…I would need to dig up the conversation and the scripts again…and I had already given up on that scene. For the most part it works, but sometimes it was buggy. 4760 never mentioned this scene at all in during his beta testing, and my brother said it looked fine also. So my guess is the bugs were pretty random.

It was this thread. We discussed this at length back in march this year:

@andgalf

That thread was a large can of worms if I recall correctly. I see I posted a few times in that thread. Was the point you are making now different from what we were discussing back then, or just another aspect? i.e. I thought it ā€œwasā€ resolved. EDIT: OK, I read through some of it again, and see it is to do a situation in Chapter 3 of yours - and requires closer inspection by the looks of it.

Anyway, here is the point that I ā€œthinkā€ is happening, at least with some of my own tests … you can see if this helps your scripts I guess …

In my own situation, I had an NPC walking scripted waypoints, so that they performed an animation at certain waypoints. The player could approach them and walk through a trigger that starts a conversation with said NPC.

The problem was that if the player just happened to walk through the trigger (to start the conversation) at exactly the point the animation was playing (which could be a couple of seconds), then the PC could potentially walk through the trigger and the conversation fail to start, even when I was using ClearAllActions(TRUE) to bring the NPC to begin new actions. However, it appears to me that the ClearAllActions is not sufficient to bring the NPC out of their animation to allow the script to fire their conversation.

However, when I added the PlayCustomAnimation(oSpeaker,"%", 0); straight after the ClearAllActions before continuing with the rest of the script to start their conversation, all appeared to work consistently.

So, if you need to start a conversation after the NPCs reaches a certain waypoint and perform a certain animation, I believe you would have to time it so that the NPC calls the conversation after any animations you require, and also using the PlayCustomAnimation(oSpeaker,"%", 0); to stop it completely before starting the conversation. And actually, in hinsight, maybe the ā€œproperā€ way to do this would be to apply any animations you want to include within the conversation itself. i.e. Rather than walk, sit down and start a conversation, maybe it should be walk, start a conversation with an opening animation on the first node to sit down.

Maybe this is nothing like you need, but I explain it in case it helps.

Take care, Lance.

If I remember correctly, how I did it was that when they arrive at the waypoint there is a conversation starting and in that first node they sit down. However, when they start that conversation, the companion moves from the waypoint he arrived at, to walk towards the player because of starting a conversation. I remember we trying to fix this by doing it with ignoring distance and all sorts of things, but none worked. So I don’t know if this PlayCustomAnimation(oSpeaker,"%", 0); would actually help in this case. I don’t know if the companion moving towards the PC, if the NWN2 perceives this as an animation.

@andgalf

OK … I think this would be different then.

If the companion is not actually involved in the conversation (or even if they are, as I have not tested such a situation), did you try to add a paralysis, cutscene, or movement restriction kind of effect.

I used EffectCutsceneImmobilize when I want to stop a character from moving … It paralyses legs and prevents movement.

// PREVENT MOVEMENT
effect FREEZE = EffectCutsceneImmobilize();
ApplyEffectToObject(DURATION_TYPE_PERMANENT, FREEZE, oCreature);

I then remove it with:-

RemoveSpecificEffect(EFFECT_TYPE_CUTSCENEIMMOBILIZE, oCreature);

there’s a setting somewhere, either in the dialog file itself (dlg) or when the convo is called, or on the creature itself, that sets the minimum range they can talk with others in.

you want to increase that range basically