How to use the Interacting Entity as the Quest Giver?

Announcements, support questions, and discussion for Quest Machine.
Post Reply
SysOp
Posts: 8
Joined: Thu May 09, 2024 7:52 pm

How to use the Interacting Entity as the Quest Giver?

Post by SysOp »

Hello!

Let's say I am trying to have multiple shopkeepers. Dialogue System has a way to find the current entity by using

Code: Select all

[var=Conversant]
if not mistaken.

So I want them to give all shopkeepers the same quests, after some conversation is finished. The problem is that Dialogue System uses

Code: Select all

GiveQuest("Shopkeeper", "harvestCarrots")
, and actually needs an actor Shopkeeper as a param ?

Is there a method to do something like

Code: Select all

GiveQuest(var=Conversant, "harvestCarrots")
so I can reuse the quests and dialogs? Thank you!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the Interacting Entity as the Quest Giver?

Post by Tony Li »

Hi,

Try:

Code: Select all

GiveQuest(Variable["Conversant"], "harvestCarrots")
This will find the Quest Giver whose ID matches the conversant's Display Name (or Name if no Display Name) and give that Quest Giver's harvestCarrots quest to the player.
SysOp
Posts: 8
Joined: Thu May 09, 2024 7:52 pm

Re: How to use the Interacting Entity as the Quest Giver?

Post by SysOp »

I had to remove all references of the actor, in order to work, but the end result is as expected, thank you! :D
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use the Interacting Entity as the Quest Giver?

Post by Tony Li »

Hi,

I'm not sure why you had to remove actor references (see the Logging & Debugging Tips video to check which GameObjects are being used as actor & conversant), but anyway I'm glad you got it working the way you want!
SysOp
Posts: 8
Joined: Thu May 09, 2024 7:52 pm

Re: How to use the Interacting Entity as the Quest Giver?

Post by SysOp »

Ah, I just simply had to remove any references to 'Villager' (it was called like that on my setup), deleting it's name basically from different fields. Otherwise it wouldn't give me the quest. Here's the result, same quest, different givers:

Post Reply