Gif Player LuaScript Failure [Solved!]

Announcements, support questions, and discussion for the Dialogue System.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Gif Player LuaScript Failure [Solved!]

Post by CodePrincess »

That's the one. Normally it's invisible until you mouse over Maya, then the message shows up in yellow.

Here's all the errors I could find:

Dialogue System: UnityUIDialogueUI NPC Subtitle Line needs to be assigned.
UnityEngine.Debug:LogWarning(Object)
PixelCrushers.DialogueSystem.UnityUIDialogueUI:FindControls()
PixelCrushers.DialogueSystem.UnityUIDialogueUI:Awake()

Dialogue System: UnityUIDialogueUI NPC Subtitle Line needs to be assigned.
UnityEngine.Debug:LogWarning(Object)
PixelCrushers.DialogueSystem.UnityUIDialogueUI:FindControls()
PixelCrushers.DialogueSystem.UnityUIDialogueUI:Awake()

Dialogue System: UnityUIDialogueUI Response buttons need to be assigned.
UnityEngine.Debug:LogWarning(Object)
PixelCrushers.DialogueSystem.UnityUIDialogueUI:FindControls()
PixelCrushers.DialogueSystem.UnityUIDialogueUI:Awake()

Dialogue System: UnityUIDialogueUI Alert Line needs to be assigned.
UnityEngine.Debug:LogWarning(Object)
PixelCrushers.DialogueSystem.UnityUIDialogueUI:FindControls()
PixelCrushers.DialogueSystem.UnityUIDialogueUI:Awake()
Last edited by CodePrincess on Wed Oct 24, 2018 6:48 pm, edited 1 time in total.
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gif Player LuaScript Failure

Post by Tony Li »

Hi,

The Selector component controls that text. If the Selector detects the Usable (Maya) but thinks it's too far away, it will show the text in gray. Inspect Maya's Usable component, and increase Max Use Distance. If you're making a 2D game, you can bump this up to something high like 9999 so you never have to worry about distances between GameObjects.

Also make sure the Selector's Select At dropdown is set to Mouse Position. It might have accidentally gotten changed to Center Of Screen, which makes it select Usables in the center of the screen instead of Usables under the mouse position.


Side note: If you're not too far in your dialogue UI design, consider switching to the Basic Standard Dialogue UI located in Plugins / Pixel Crushers / Dialogue System / Prefabs / Standard UI Prefabs / Templates / Basic. (Or any of the other dialogue UI prefabs in Standard UI Prefabs.) The Generic Unity UI Dialogue UI prefab is still fully supported, but I think the new Standard Dialogue UI prefabs are easier to work with and customize.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Gif Player LuaScript Failure

Post by CodePrincess »

It's highlighting just fine now, just not playing the conversation. Maybe a fresh start would be a smart move. I'll do just like you say.

Thanks so much, Mr. Li!

- CodePrincess
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gif Player LuaScript Failure

Post by Tony Li »

Glad to help!
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

Re: Gif Player LuaScript Failure [Solved!]

Post by CodePrincess »

CodePrincess wrote: Fri Oct 05, 2018 11:55 pm Hello, everybody!

So I bought a gif player from OldMoat games and I wanted to be able to control which gifs play when from the comfort of my dialog editor. I wrote this script:

Code: Select all

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GifManager : MonoBehaviour {
    [SerializeField] public OldMoatGames.AnimatedGifPlayer[] Gif;

    public GifManager()
    { 

    }

    public void HideGif(double e)
    {
        Gif[(int)e].enabled = false;
    }

    public void ShowGif(double e)
    {
        Gif[(int)e].enabled = true;
    }

    private void OnEnable()
    {
        PixelCrushers.DialogueSystem.Lua.RegisterFunction("HideGif", this, typeof(
            GifManager).GetMethod("GifManager"));
        PixelCrushers.DialogueSystem.Lua.RegisterFunction("ShowGif", this, typeof(
           GifManager).GetMethod("GifManager"));
    }

    private void OnDisable()
    {
        PixelCrushers.DialogueSystem.Lua.UnregisterFunction("HideGif");
        PixelCrushers.DialogueSystem.Lua.UnregisterFunction("ShowGif");
    }
}
Plunked it in my Dialogue Manger, then used the functions in my editor, they looked like this:
GifFunctionCalls.png

When I ran the program, nothing happened.

Does anybody see a glaring error or two?

Thank you and take care!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: Gif Player LuaScript Failure [Solved!]

Post by Tony Li »

Hi!

I see the subject is marked [SOLVED]. Is everything working OK now? If not, I'll be happy to help; just let me know.
Post Reply