Quest Tracker is not Updating

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Cristianmvv
Posts: 2
Joined: Mon Aug 22, 2022 5:58 am

Quest Tracker is not Updating

Post by Cristianmvv »

Hello, it my first time working with Dialogue System for Unity. I am trying to make a simple quest where you pick up some plants and deliver it.

The problem is that the Quest Tracker in screen isn't updating the number of plants. In the journal it shows correctly, but I need to untrack and track again the quest to show the plants picket up in the Quest Tracker.

This is the code I use to pick up plants

Code: Select all

public class PlantPickUp : MonoBehaviour
{
    bool inside;

    private void Update()
    {
        if (inside && Input.GetKeyDown(KeyCode.E))
        {
            DialogueLua.SetVariable("DessertPlants", DialogueLua.GetVariable("DessertPlants").asInt +1);
            //DialogueManager.instance.SendMessage("UpdateTracker");
            print(DialogueLua.GetVariable("DessertPlants").AsInt);
        }
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
            inside = true;
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
            inside = false;
    }
 }
And this is where the Quest Log is located (Is the only thing I added quest related)
Image

I spend a long time looking but the only thing I find to update the tracker whas this line of code that didn't work for me
DialogueManager.instance.SendMessage("UpdateTracker");
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Tracker is not Updating

Post by Tony Li »

Hi,

In your script, when you pick up the plant call this line of C# code:

Code: Select all

DialogueManager.SendUpdateTracker();
Cristianmvv
Posts: 2
Joined: Mon Aug 22, 2022 5:58 am

Re: Quest Tracker is not Updating

Post by Cristianmvv »

Tony Li wrote: Mon Aug 22, 2022 8:53 am Hi,

In your script, when you pick up the plant call this line of C# code:

Code: Select all

DialogueManager.SendUpdateTracker();
Now it's working! Thanks a lot!
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Quest Tracker is not Updating

Post by Tony Li »

Glad to help!
Post Reply