Page 3 of 3

Re: How to set all dialouge values to true

Posted: Thu Apr 22, 2021 1:37 pm
by Tony Li
Hi,

That error means that the TimetrialManager component is not on the same GameObject as this script. Try changing this:

Code: Select all

if (GetComponent<TimetrialManager>().isIntimeTrialMode)
to this:

Code: Select all

if (FindObjectOfType<TimetrialManager>().isIntimeTrialMode)

Re: How to set all dialouge values to true

Posted: Thu Apr 22, 2021 2:03 pm
by soniclinkerman
Ok changing it seems to make the triggers stop the dialogue, but is there a way to keep the conversation from EVER showing? It seems like it'll open up, but no dialogue will show. But the dialogue should never show up at all in this mode

Re: How to set all dialouge values to true

Posted: Thu Apr 22, 2021 2:19 pm
by Tony Li
There are a few ways, which I listed in my first reply. You could try this instead:

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers.DialogueSystem;

public class PreventAllConversations : MonoBehaviour
{
    void Start()
    {
        DialogueManager.IsDialogueEntryValid = CheckTimetrial;
    }
    
    bool CheckTimetrial(DialogueEntry entry)
    {
        return !FindObjectOfType<TimetrialManager>().isIntimeTrialMode;
    }
}
Make sure "Skip If No Valid Entry" is ticked on all of your Dialogue System Triggers.

Re: How to set all dialouge values to true

Posted: Thu Apr 22, 2021 2:34 pm
by soniclinkerman
This is it! Works perfectly. Thank you so much Tony! I was having trouble implementing it, but you helped me out a ton

Re: How to set all dialouge values to true

Posted: Thu Apr 22, 2021 3:24 pm
by Tony Li
Glad to help!