Menu Text and Dialogue Text -> ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Posted: Sat Mar 23, 2024 5:29 pm
Hello, maybe someone stumbled across similar issue. I sometimes get this " ArgumentOutOfRangeException: Index and length must refer to a location within the string." exception on some nodes regarding text from Menu Text/Dialogue Text.
The consequence is that dialogue/menu text from specific node is not being written (I use typewriter textMeshPro effect). It however shows up as already written, when the next node is being written "by typewritter".
I can't find the connection why it is happenning. I first thought, that it happens, when text from Menu Text and Dialogue Text have the same length, but it is not always the case.
This is full Exception:
ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <bfbc89a04b6b4dd49c3614d03fc31ce8>:0)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect+<Play>d__40.MoveNext () (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:245)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <f7237cf7abef49bfbb552d7eb076e422>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect:StartTypewriterCoroutine(Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:233)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect:StartTyping(String, Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:204)
PixelCrushers.DialogueSystem.TypewriterUtility:StartTyping(UITextField, String, Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TypewriterUtility.cs:47)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetSubtitleTextContent(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:626)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetContent(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:582)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitleNow(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:292)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:278)
PixelCrushers.DialogueSystem.StandardUISubtitleControls:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:511)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitleImmediate(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:276)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:242)
PixelCrushers.DialogueSystem.ConversationView:StartSubtitle(Subtitle, Boolean
The consequence is that dialogue/menu text from specific node is not being written (I use typewriter textMeshPro effect). It however shows up as already written, when the next node is being written "by typewritter".
I can't find the connection why it is happenning. I first thought, that it happens, when text from Menu Text and Dialogue Text have the same length, but it is not always the case.
This is full Exception:
ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <bfbc89a04b6b4dd49c3614d03fc31ce8>:0)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect+<Play>d__40.MoveNext () (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:245)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <f7237cf7abef49bfbb552d7eb076e422>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect:StartTypewriterCoroutine(Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:233)
PixelCrushers.DialogueSystem.TextMeshProTypewriterEffect:StartTyping(String, Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TextMeshProTypewriterEffect.cs:204)
PixelCrushers.DialogueSystem.TypewriterUtility:StartTyping(UITextField, String, Int32) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Utility/TypewriterUtility.cs:47)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetSubtitleTextContent(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:626)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:SetContent(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:582)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitleNow(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:292)
PixelCrushers.DialogueSystem.StandardUISubtitlePanel:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitlePanel.cs:278)
PixelCrushers.DialogueSystem.StandardUISubtitleControls:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardUISubtitleControls.cs:511)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitleImmediate(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:276)
PixelCrushers.DialogueSystem.StandardDialogueUI:ShowSubtitle(Subtitle) (at Assets/Editor Default Resources/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Dialogue/StandardDialogueUI.cs:242)
PixelCrushers.DialogueSystem.ConversationView:StartSubtitle(Subtitle, Boolean