Page 1 of 1

Select Answer based on object interacted with

Posted: Wed Mar 09, 2022 6:25 am
by F1foux
Hi Tony,

I'm working on a System in which the dialogue itself is a game. So a conversation is triggered, NPC speaks a line then the player get's into a minigame where the enemies are the possible answers to the npcs dialogue.

So I disabled the Dialogue Managers response menue because I won't use it. The enemies get an index assigned which is the same as their Dialogue Entry ID. What would be the best way to have the killed enemy send their index to the dialogue manager and make the conversation select the answer with that ID, or have the conversation continue from that answers branch?

I hope it's understandable what I'm trying to do. Btw I'm working with Bolt, so if possible pls don't go too deep into scripting language ;)

Thx for your help and thx for the great asset!

Re: Select Answer based on object interacted with

Posted: Wed Mar 09, 2022 11:44 am
by Tony Li
Without scripting, it might be simpler to branch based on the value of a variable. Here's an example scene:

DS_AlternateResponseExample.unitypackage

It uses this conversation:
alternateResponse1.png
alternateResponse1.png (15.53 KiB) Viewed 468 times

The "Shoot an enemy" node waits for the sequencer message "ShotEnemy".

When the 3 enemies in the scene are killed, they record their enemy number in a variable and use a one-line script to send the sequencer message "ShotEnemy". You could use Bolt instead of the one line of code if you prefer, or you can just use the included script.

The Delay Evaluation node is because you're setting a variable and Conversations Evaluate Conditions One Extra Level Ahead.

The 3 final nodes check the value of the variable.

Re: Select Answer based on object interacted with

Posted: Thu Mar 10, 2022 3:57 am
by F1foux
Hi Tony,

Thank you for your fast response.
I think I solved the problem by implementing the "GotoEntry" sequencer command you have listed under extras on your website.
The enemy killed sends a message to the dialogue system with it's ID number and "GotoEntry(2)@Message(2)" moves the conversation to the correct entry.

But I keep your solution in mind if mine doesn't work out.

Cheers!

Re: Select Answer based on object interacted with

Posted: Thu Mar 10, 2022 8:00 am
by Tony Li
Hi,

That's a good solution, too!