Getting Speaker&Listener from Script uses previous node's values
Posted: Tue Apr 01, 2025 4:59 pm
Hi Tony
I've been using the Dialogue System for years, so I'm familiar with most things, but running into a new issue that is only popping up because the new project I'm working on has 'conversations' that take place between two NPCs (and not just between the NPC and the "player").
The issue seems to be the same thing this person had, where if you are checking who the Speaker & Listener are via a "Script" field command, you get the Speaker & Listener from the previous node: https://www.pixelcrushers.com/phpbb/vie ... hp?p=37361
In my case, I'm using the Script field to send a command to our FSM to make the appropriate character do an animation, so I need to know which NPC is the Speaker and which is the Conversant for each particular node:
How can I get the actual Speaker & Listener for the node that the "Script" command is being processed from? I'm a bit confused as to why the Speaker/Listener wouldn't already have been updated to the new node's values when the "Script" commands are being executed. The fact that it isn't updated at that point makes me think that the "Script" commands might not be intended to be used in this way (to apply an animation to the Speaker/Listener for the current node). If that's the case, what would be the recommended way to do it? I could potentially make a custom Sequence command for triggering animations on our NPCs if that is more of the intended way... but in our situation these animation-triggers aren't meant to be used in any sort of actual 'sequence', they should just get fired off immediately when the conversation reaches that node, so thats why we are simply using "Script" commands.
Thanks for any help!!
Edit: Just wanted to add that I'm on version 2.2.39, a pretty old version, in case any changes to this has been made since then - I scanned through the patch notes and didn't notice anything related to it.

I've been using the Dialogue System for years, so I'm familiar with most things, but running into a new issue that is only popping up because the new project I'm working on has 'conversations' that take place between two NPCs (and not just between the NPC and the "player").
The issue seems to be the same thing this person had, where if you are checking who the Speaker & Listener are via a "Script" field command, you get the Speaker & Listener from the previous node: https://www.pixelcrushers.com/phpbb/vie ... hp?p=37361
In my case, I'm using the Script field to send a command to our FSM to make the appropriate character do an animation, so I need to know which NPC is the Speaker and which is the Conversant for each particular node:
How can I get the actual Speaker & Listener for the node that the "Script" command is being processed from? I'm a bit confused as to why the Speaker/Listener wouldn't already have been updated to the new node's values when the "Script" commands are being executed. The fact that it isn't updated at that point makes me think that the "Script" commands might not be intended to be used in this way (to apply an animation to the Speaker/Listener for the current node). If that's the case, what would be the recommended way to do it? I could potentially make a custom Sequence command for triggering animations on our NPCs if that is more of the intended way... but in our situation these animation-triggers aren't meant to be used in any sort of actual 'sequence', they should just get fired off immediately when the conversation reaches that node, so thats why we are simply using "Script" commands.
Thanks for any help!!
Edit: Just wanted to add that I'm on version 2.2.39, a pretty old version, in case any changes to this has been made since then - I scanned through the patch notes and didn't notice anything related to it.