Page 1 of 1

Quest Tracker is not Updating

Posted: Mon Aug 22, 2022 6:14 am
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");

Re: Quest Tracker is not Updating

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

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

Code: Select all

DialogueManager.SendUpdateTracker();

Re: Quest Tracker is not Updating

Posted: Wed Aug 24, 2022 6:05 am
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!

Re: Quest Tracker is not Updating

Posted: Wed Aug 24, 2022 8:16 am
by Tony Li
Glad to help!