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

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/ 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.


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.


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:


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.


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.

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

// Starts a conversation with oObjectToConverseWith - this will cause their
// OnDialog event to fire.
// - oObjectToConverseWith
// - sDialogResRef: If this is blank, the creature's own dialogue file will be used
// - bPrivateConversation
// Turn off bPlayHello if you don't want the initial greeting to play
void ActionStartConversation(object oObjectToConverseWith, string sDialogResRef="", int bPrivateConversation=FALSE, int bPlayHello=TRUE, int bIgnoreStartDistance=FALSE, int bDisableCutsceneBars=FALSE);

here, int bIgnoreStartDistance=FALSE, you have to set that parameter to true

Yes, I think I remember trying that @Gnomocratic_Agent but in this case it didn’t work. It was very weird.
Honestly, I don’t know if I want to go down the rabbit hole and try to tinker with this again. Maybe I’ll just leave it as it is.


I don’t know if you saw the post l made above, but did you ever test that function I mentioned above?

@Lance_Botelle Yes, I saw it. I just haven’t had the time to go into the “wormhole” again to try it. It does sound like a thing that could maybe work though. I should probably examine it.

Let me know if it does work. It may be the breakthrough you were after. :slightly_smiling_face:

I’ll do that.

Right now, after trying to help another one here on the vault with a “light a torch” script, I got curious how that would work in NWN2, so I downloaded a script I found and trying to make sense of that now.:

It’s quite relaxing (and I really need to relax in these crazy depressing times) to see if I can make sense of it.
1 Like


I have ignitable torches and other light sources in The Scroll.

I’m not at computer at the moment, but they are added as prefabs I made. Scripts attached to the placeables.

Thanks, but I just got the one I downloaded to work. Looks really nice. I think I will make a prefab out of that one.