How to set all dialouge values to true

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to set all dialouge values to true

Post 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)
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: How to set all dialouge values to true

Post 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
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to set all dialouge values to true

Post 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.
soniclinkerman
Posts: 82
Joined: Wed Mar 31, 2021 6:48 pm

Re: How to set all dialouge values to true

Post 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
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to set all dialouge values to true

Post by Tony Li »

Glad to help!
Post Reply