snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.6k stars 291 forks source link

IndexOutOfRangeException: Index was outside the bounds of the array. #935

Closed MonkeyZero closed 3 years ago

MonkeyZero commented 3 years ago

IndexOutOfRangeException: Index was outside the bounds of the array. Fungus.TextAdapter.get_LastRevealedCharacter () (at Assets/Fungus/Scripts/Utils/TextAdapter.cs:243) Fungus.Writer+d__57.MoveNext () (at Assets/Fungus/Scripts/Components/Writer.cs:591) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)

I get this when using TextMesh Pro for either StoryText or NameText in the SayDialog.

It stops the Flow of text when {wi} or {wc} is used and don't continue on when the Narrative/Say Command Block is used in the flowchart editor.

I do not use LUA and I would prefer to use the Flowchart blocks to create scenes.

I do have the TextMesh Pro Say Linked up to both the Say Dialog (Script) on the StoryTextGO variable and also in Writer (Script) as the TargetTextObject so that it can work as was the case to make use of TMP text elements.

It hasn't worked for me since Unity Version 2019.X to 2020.X and I really am not that great at code to fix this myself.

I would rather use TextMesh Pro as it provides cleaner looking text and Features like Justified Alignment for flush Right and Left margins. Things default Unity Text does not provide us.

Thanks for the consideration.

JLevstein commented 3 years ago

@MonkeyZero I was having the same issue until I updated to the latest version of Fungus.

This change fixed it for me: https://github.com/snozbot/fungus/commit/c0fe7869febfe0f36e9ac1f9e8eb78a299e87f5a

MonkeyZero commented 3 years ago

@JLevstein I thought i was using the latest and greatest version of Fungus. I get it off the "Package Mananger" now that the Asset Store is no longer a thing in Unity Editor.

I hate they removed Asset Store as that was a good way to get and keep up to date on the assets I use in my project.

I'll just go and delete the downloaded copy of Fungus and see if a redownload works.

stevehalliwell commented 3 years ago

@MonkeyZero you can always find latest versions in the releases section here on github.