Page 2 of 2

Re: Gif Player LuaScript Failure [Solved!]

Posted: Thu Oct 11, 2018 7:51 pm
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()

Re: Gif Player LuaScript Failure

Posted: Thu Oct 11, 2018 8:39 pm
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.

Re: Gif Player LuaScript Failure

Posted: Fri Oct 12, 2018 12:29 am
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

Re: Gif Player LuaScript Failure

Posted: Fri Oct 12, 2018 8:01 am
by Tony Li
Glad to help!

Re: Gif Player LuaScript Failure [Solved!]

Posted: Wed Oct 24, 2018 6:50 pm
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!

Re: Gif Player LuaScript Failure [Solved!]

Posted: Thu Oct 25, 2018 10:08 am
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.