Receiving Reward

I’m hoping someone else out there might have wanted to implement the quest reward system differently than how it is presented in this course. Instead of the reward being given upon quest completion, I would rather have the reward given once you return to the quest giver. Any suggestions would be greatly appreciated.

Simply make the last Quest Objective to Speak to the Quest Giver.
Then condition your Dialogue so that the Complete Objective on the Quest Giver is not called unless you have completed the other conditions in the test.

For example: If the quest is

Quest:  Kill Bill
Objective:  Obtain Five Finger Death Punch
Objective:  Convince Bill to Fight you
Objective:  Defeat Bill 
Objective:  Return to B.B. (Quest Giver)

On B.B. you’ll have a DialogueTrigger for that final Return to B.B.

In the Dialogue, the node that calls that Trigger will have a condition that approximates to

HasQuest(Kill Bill)
!CompletedQuest(Kill Bill)
CompletedObjective(Obtain Five Finger Death Punch)
CompletedObjective(Convince Bill To Fight You)
CompletedObjective(Defeat Bill)

Thanks for the help Brian. I’ve got it working with your suggestions but I do have some weird behavior.

My quest is set up as such with three objectives: killRogue, collectBone, returnToGuardian

My NPC has been set to be the QuestGiver. It has a dialog trigger to give the quest and as well as a dialog trigger to set this NPC as a quest objective (returnToGuardian in the quest scriptableObject).

The dialog has the GiveTheReward dialog action set from the NPC and has been set to the dialog node that has the star on it in this snapshot.

Here’s the weirdness. If I complete the objective to kill the rogue first, then collect the bones next and go back to the quest giver, I get the proper response as well as the reward from the NPC. If I complete the objective to collect the bones first, followed by killing the rogue and go back to the quest giver, it doesn’t give me the reward or give me the proper response. But if I go away and reactive the dialog, then I get the proper response as well as reward. I can’t figure out why this happens. Thanks for your help.

Is that behavior consistent?

Which node is it selecting when it fails? Can I see the Conditions on the other three nodes branching off of the root?

No. It’s not always consistent. Here are the other nodes showing the conditions.

Thanks for any insight.

These look correct., and I can’t directly think of a reason why it would only work properly if you did the objectives out of order.

Zip up your project and upload it to https://gdev.tv/projectupload and I’ll take a look at it.

  • Be sure to tag me (Brian T) as the requesting instructor or I won’t get a link to the download (or even a notification)
  • Be sure to remove the Library folder to conserve space.

Thanks Brian. I posted it late last night to web server, naming you the teaching assistant.

As it turns out I was able to duplicate the results regardless of the order, sometimes completing the quest and sometimes not completing the quest.

The issue lies in the conditions. in the 1st tier

  • if(!HasQuest(quest))
  • if(HasQuest(quest) && !CompletedQuest(quest) && CompletedObjective(A) && CompletedObjective(B)
  • if(HasQuest(quest) && !CompletedQuest(quest)
  • if(CompletedQuest(quest)

Condition three then leads to the differentiation between the three possible non compliance conditions.

The trouble lies in if you haven’t completed the quest, but you have completed the objectives, condition 3 will still resolve as true.

We need to change the 3rd condition to read

if(HasQuest(quest) && !CompletedQuest(Quest) && (!CompletedObjective(A) || !CompletedObjective(B))


Thank you so much Brian. Works as it should. I guess my conditional checking needed more checks. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.