[SOLVED] Player Reward Branching

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

[SOLVED] Player Reward Branching

Post by mschoenhals »

I have a player quest (a timer quest) where the player may choose 1 of 2 rewards (items) after succeeding. I'm using both Dialogue System and Quest System. I've already written the give item script which works perfectly with Quest System.

How would I setup the branching logic so that the player can choose one of two options for reward from the quest giver after successfully completing the quest? I don't want the player to have the ability to go back to the quest giver and get the second item though. It would be nice to have it happen through the quest giver dialogue if possible.

Thanks in advance.
Last edited by mschoenhals on Thu Nov 12, 2020 8:35 pm, edited 2 times in total.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: [HELP] Player Reward Branching

Post by Tony Li »

Hi,

For reward branching in Quest Machine, please see the Demo's Pesky Rabbits quest. In the Return to NPC node's Active state, the Dialogue Text content includes two buttons: accept 5 coins or 2 carrots as a reward. You can set your quest up similarly, and configure the buttons' actions to use your give item script.

To show the Quest Machine dialogue UI, don't include any Dialogue System Conversation quest content items in the node's Dialogue Text. If Quest Machine does not find any Dialogue System Conversation quest content for the current quest state, it will use its own dialogue UI instead of starting a Dialogue System conversation.
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Re: [HELP] Player Reward Branching

Post by mschoenhals »

Thanks for the reply Tony.

It works somewhat in that I now get a pop up where I can select the reward but, I can select both rewards numerous times (until I close the window). How do I limit the choice to just one of the two items?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: [HELP] Player Reward Branching

Post by Tony Li »

Hi,

Inspect each Button content and tick 'Group Selection'. Then set the same Group Number (e.g., 0). When buttons are in a group selection, you can only click one. Once you've clicked it, its actions run, and the group's buttons become non-interactive.
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Re: [HELP] Player Reward Branching

Post by mschoenhals »

Hi Tony,
Just letting you know that this worked out great. Thanks for your help.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED] Player Reward Branching

Post by Tony Li »

Awesome! Happy to help.
Post Reply