Substring replacement

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

Re: Substring replacement

Post by Tony Li »

Yes, that's correct.
korsak42
Posts: 34
Joined: Tue Jul 19, 2022 7:36 am

Re: Substring replacement

Post by korsak42 »

Hi again!
I have a problem with localization. As you can see on the screenshots I've filled all fields but the system always takes "ru" option on the fields that have scripts, I've tried to delete script callings and nothing has changed.
Attachments
2.png
2.png (26.53 KiB) Viewed 1128 times
1.png
1.png (63.99 KiB) Viewed 1128 times
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Substring replacement

Post by Tony Li »

Hi,

It's possible that the language setting "ru" is stored in PlayerPrefs.

Inspect your Dialogue Manager GameObject. Click Localization Settings > Reset Language PlayerPrefs. This will clear the language setting that's stored in PlayerPrefs.
korsak42
Posts: 34
Joined: Tue Jul 19, 2022 7:36 am

Re: Substring replacement

Post by korsak42 »

Omg, thank you so much!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Substring replacement

Post by Tony Li »

Glad to help!
korsak42
Posts: 34
Joined: Tue Jul 19, 2022 7:36 am

Re: Substring replacement

Post by korsak42 »

I have another strange bug. As you can see on the screenshot I have 1 lua function in dialogue field and two in the script field, but lua function but when playing the lua dialog, the GetNextQuestSettlementName() function is called twice - once before executing the ActivateOptionStage() method, and the second time after. What could cause this behavior?
Attachments
Без имени3.jpg
Без имени3.jpg (158.88 KiB) Viewed 1079 times
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Substring replacement

Post by Tony Li »

Hi,

In a regular conversation such as this, the Dialogue System must process the text in Dialogue Text twice -- once when determining which dialogue entries are currently valid to show, and again before showing the text.

The first time is required to prepare the text prior to invoking any custom OnConversationLine() methods. This way your custom OnConversationLine() methods contain the properly-processed text.

The second time is to prepare the text for display. This is required because an OnConversationLine() method may have modified the text to add more markup tags, or if you are showing a subtitle that, for example, was generated procedurally instead of in a regular conversation.

Can you move the call to GetNextQuestSettlementName() to the Script field? The Script field will only be invoked once. It will be invoked before the second time that the text is processed. If GetNextQuestSettlementName() sets a DS variable, you can use it in the text. Example:

Code: Select all

void GotoNextQuestSettlementName()
{
    string yourSettlementName = /* your code here to get next settlement name */
    DialogueLua.SetVariable("SettlementName", yourSettlementName);
}
  • Dialogue Text: "End with finding home. Go [var=SettlementName]."
sumodont
Posts: 1
Joined: Fri Sep 29, 2023 5:00 am

Re: Substring replacement

Post by sumodont »

Oh, that's not good, but it's still hard to put into words how grateful I am for your help. I'm trying to save money now so I can buy the full version and not have to suffer anymore.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Substring replacement

Post by Tony Li »

sumodont wrote: Fri Sep 29, 2023 5:07 am Oh, that's not good, but it's still hard to put into words how grateful I am for your help. I'm trying to save money now so I can buy the full version and not have to suffer anymore.
If you're referring to TextMesh Pro support, it's now built into the evaluation version so you can test the Dialogue System with TextMesh Pro.
korsak42
Posts: 34
Joined: Tue Jul 19, 2022 7:36 am

Re: Substring replacement

Post by korsak42 »

Hi! In some dialogs, some nodes call up Russian text instead of English, although all nodes are filled in the same way, the locale is English, and the “Use system language” setting has been removed. Why might this happen?
Attachments
Без имени.png
Без имени.png (62.79 KiB) Viewed 709 times
Post Reply