End quest from NPC other than quest giver

Announcements, support questions, and discussion for Quest Machine.
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

End quest from NPC other than quest giver

Post by Hiiyan90 »

Hello again.

This is not so much a technical question as I wrote earlier but I am wanting to do a simple delivery quest like the demo but I don't want to have to return to the quest giver.

Basically, you recive a letter and you put it in a mailbox and when you put it in the mailbox the quest ends.

Everything works fine and the correct dialogue plays at the right times in the quest nodes but how do I make it so when I go to the letterbox and it says "letter delivered" just like when the pirate says "thanks for the carrots" the quest ends there? Like a force success when you talk to the mailbox.

It seems in the examples you need to always go to the quest giver to end the quest? I thought I should ask if this is the case always :) There are some big journeys in my game so I am trying to be kind to the player and avoid backtracking where I can.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: End quest from NPC other than quest giver

Post by Tony Li »

Hi,

To end the "Food Delivery" quest as soon as you talk to the captain, remove the "Return To Farmer" node, and link "Talk To Captain" directly to a Success node.
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

Re: End quest from NPC other than quest giver

Post by Hiiyan90 »

Oh yes I see! Thanks. I added a sound and alert and I can see it now. For some reason, it is not coming up as complete in the journal but I must have an option clicked other than the "Show Completed Quests" on the prefab. Glad it's working though!

I thought it should be that simple. Needed to make it more obvious for myself hah.

Thanks
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: End quest from NPC other than quest giver

Post by Tony Li »

Make sure the player's Quest Journal > Remember Completed Quests is ticked.
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

Re: End quest from NPC other than quest giver

Post by Hiiyan90 »

Thank you! Yes I see that now. Sorry I only just came across your post regarding the player journal and how to show/hide the content. Thank you so much. I see how the message system works well now to!

I have one last question and all is working great. Sorry for the time. Using the Ultimate Inventory System/Character integration and the pixel crushers save system. It works amazing! Very smooth and happy with my results. My only quest machine issue is if I load a quest halfway that gives an item when accepting (like the letter to deliver), it duplicates the item on load in the inventory. This only happens with quest items and it seems when loading default items on the character. Anything I have picked up does not seem to be affected.

I have unselected save inventory on the player UCC Saver as it said this would duplicate but that does not change the default or active quest items from duplicating. I am okay to not have any starting items so I don't mind the default being duplicated, just the quest items can be an issue. I also noticed that if I finish the quest and save and load the rewards and alerts come up again and the items are duplicated each time I save and load. I can just do this over and over and increase my money each time by more haha.

Thank you!

After this, it is all perfect. I have already given your products 5 stars for the great help and work so far. Thank you.
Last edited by Hiiyan90 on Fri Apr 23, 2021 9:58 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: End quest from NPC other than quest giver

Post by Tony Li »

Hi,

Thank you very much for your review!

How are you giving the quest item to the player? Are you using a quest action in the quest's Actions list? If so, then it should not give a duplicate when loading the quest. Actions are not re-run when loading saved games (for this very reason).
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

Re: End quest from NPC other than quest giver

Post by Hiiyan90 »

Yes as an action :) Should it specifically be in the "Success" node in active or true or in the general success spot when clicking off the node in the editor?
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

Re: End quest from NPC other than quest giver

Post by Hiiyan90 »

I will try adding things to the node directly first!
Last edited by Hiiyan90 on Fri Apr 23, 2021 10:19 am, edited 1 time in total.
Hiiyan90
Posts: 10
Joined: Tue Apr 20, 2021 9:50 pm

Re: End quest from NPC other than quest giver

Post by Hiiyan90 »

Oh, Okay so I fixed the reward by making the actions happen from the success node! But I still have the issue of the letter that was given when accepting the quest duplicating. I also tried adding this to a node but that didn't work. Any suggestions?

Thanks!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: End quest from NPC other than quest giver

Post by Tony Li »

Let's debug the issue. Please add this line at line 32 of UISAddItemQuestAction.cs:

Code: Select all

Debug.Log("Adding item " + itemName);
Then play the game and reproduce the issue. When you load the game, does this line appear? It should only appear when the player accepts the quest and first receives the letter. It should not appear when loading the game.

On UIS's Game object, did you untick the Inventory System Manager's Don't Destroy On Load checkbox?

At any point, please feel free to send a reproduction project to tony (at) pixelcrushers.com.
Post Reply