Invector integration: How do I link a conversation node to Dialogue System Events.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
62qBruv
Posts: 22
Joined: Sun Jul 12, 2020 5:38 pm

Invector integration: How do I link a conversation node to Dialogue System Events.

Post by 62qBruv »

I am trying to get a NPC character to change its FSM Behaviour Controller from FSM Civilian to FSM Melee. There is an option in Dialogue System Events to change the FSM Behavior and it works fine. (I can do this using the On Conversation End (Transform)). However, I want this Event to fire when the Player responds in a particular way - not at the end of the conversation. So, if the Player chooses a response option the NPC "doesn't like", it immediately becomes an Enemy and attacks. So what can I use in the particular conversation node script or condition that will link to the Dialogue System Events and therefore fire the change of FSM?

Please remember I don't know LUA and I'm a relative beginner, (but I did really try to do this myself).

EDIT: Ah, just read one of your posts where you indicate "abandoned" is equivalent to "cancelled". So there is an Event called On Conversation Cancelled so if I use script in the appropriate conversation node to SetQuestState("****", "abandoned"); then I can use the On Conversation Cancelled to make the transition. Is that right? (I'll try it anyway).

EDIT 2: Sadly, it didn't work. I'll wait for expert advice.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Invector integration: How do I link a conversation node to Dialogue System Events.

Post by Tony Li »

Hi,
  • Open the scene with the NPC.
  • Inspect the node. Expand the "OnExecute() Events" foldout and click Add Scene-Based Event. This will add a UnityEvent.
  • Configure it to change the NPC's FSM.
This should be in a node with no follow-up nodes, so the player isn't stuck in conversation mode while the NPC starts attacking.
Post Reply