Page 1 of 1

Question about [nosubtitle] tag.

Posted: Tue Aug 14, 2018 8:09 pm
by hellwalker
Hey,
whats the correct use of [nosubtitle] tag. ?
I tried it in both Menu Text field and Subtitle Text Field, but the text was still displayed.
I'm importing it from Articy if that changes anything.
I have latest asset store version of DS.

Thanks

Re: Question about [nosubtitle] tag.

Posted: Tue Aug 14, 2018 8:39 pm
by Tony Li
Hi,

If a dialogue fragment would normally be shown as a subtitle, and if the dialogue fragment's text contains "[nosubtitle]", then it won't be shown as a subtitle. It will, however, still play the dialogue fragment's sequence. There's no issue importing it from articy.

Can you post a screenshot of how you're using it?

Re: Question about [nosubtitle] tag.

Posted: Tue Aug 14, 2018 11:13 pm
by hellwalker
Sure,
Image

This shows up in Response reminder subtitle I think, since I have response dialogue after this. Basically I'm trying to use something like blank [About topic...] action, that lead to response dialogues of that topic.

Unrelated question, but is it possible to register Lua function that accepts multiple arguments?

I tried something like this but I kept getting errors.

Code: Select all

 void OnEnable()
    {
        //Lua.RegisterFunction("GetRandomUnhandledLine", this, typeof(CustomLuaFunctions).GetMethod("GetRandomUnhandledLine"));
        Lua.RegisterFunction("GetRandomUnhandledLine", this, SymbolExtensions.GetMethodInfo(() => GetRandomUnhandledLine((double)0), (double)0), (double)0)));
    }

    void OnDisable()
    {
        Lua.UnregisterFunction("GetRandomUnhandledLine");
    }

    public double GetRandomUnhandledLine(double _MinInt, double _Max, double _OldValue)
    {
      
        if (_MinInt >= _Max)
            return _MinInt;

        List<double> _Numbers = new List<double>();
        for (double i = _MinInt; i <= _Max; i++)
        {
            if (i != _OldValue)
            {
                _Numbers.Add(i);
            }
        }

        return _Numbers[Random.Range(0, _Numbers.Count)];
    }


Re: Question about [nosubtitle] tag.

Posted: Tue Aug 14, 2018 11:34 pm
by Tony Li
Hi,

That may be an oversight on my part when there's Menu Text and Dialogue Text in the same node. The rule is that if Dialogue Text is blank (which it is after removing the [nosubtitle] tag), then it uses Menu Text as the Dialogue Text. I'll check this out and fix it if necessary in 2.0.4.

In the meantime, try adding some additional text to the Dialogue Text, such as: "[nosubtitle]About the family...".
hellwalker wrote: Tue Aug 14, 2018 11:13 pm Unrelated question, but is it possible to register Lua function that accepts multiple arguments?
Yes. Looks like it's just some parenthesis issues. Try this line:

Code: Select all

Lua.RegisterFunction("GetRandomUnhandledLine", this, SymbolExtensions.GetMethodInfo(() => GetRandomUnhandledLine((double)0, (double)0, (double)0)));

Re: Question about [nosubtitle] tag.

Posted: Wed Aug 15, 2018 3:25 pm
by hellwalker
Thanks!
The additional text did not do the trick, but I think I can hijack the subtitle text through event and replace it manually.

Re: Question about [nosubtitle] tag.

Posted: Wed Aug 15, 2018 4:45 pm
by Tony Li
Yeah, I steered you wrong on that. I checked the code, and it doesn't care if there's more text or just [nosubtitle].

Could you please provide steps to reproduce this issue? I haven't been able to reproduce it.

Your text contains the square brackets, right? So the entire tag is "[nosubtitle]", not "nosubtitle".

Re: Question about [nosubtitle] tag.

Posted: Wed Aug 15, 2018 11:50 pm
by hellwalker
Sorry it was my fault. :oops: ,
I had some code in OnConversationLine that combined speaker name and subtitle that I used to use in DS 1. That was fighting the nosubtitle tag. Hazard of reusing old code I guess. Once I deleted it, the tag works.

Thanks for the help.

Btw Is there a way to get Conversation line after it has been processed by all the tags etc? And what would be best approach to add custom tags?

Re: Question about [nosubtitle] tag.

Posted: Thu Aug 16, 2018 8:50 am
by Tony Li
Hi,

When OnConversationLine(subtitle) is called, subtitle.formattedText.text will contain the processed text without tags. You can read the other properties of subtitle.formattedText to see what tags were extracted.

You can process your own custom tags in OnConversationLine, too. The dialogue UI will display subtitle.formattedText in whatever state your OnConversationLine method leaves it in. You can also change subtitle.sequence in OnConversationLine.

Re: Question about [nosubtitle] tag.

Posted: Tue Aug 21, 2018 6:16 pm
by hellwalker
Awesome, thanks!