Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Bug Report: Character Autodelays

A topic by Draque created Feb 26, 2025 Views: 94 Replies: 7
Viewing posts 1 to 7

This one is pretty specific, and the only character I have found that it applies to is the standard exclamation point. The autodelay will not be applied, given the code below. If I set the period with the same code, it will work. If I change the ruleset to  STMAutoDelayData.Ruleset.FollowedByDifferentCharacter, it will work.

The code below will yield the bug:

'''

var autoDelay = ScriptableObject.CreateInstance<STMAutoDelayData>();
autoDelay.character = '!';
autoDelay.ruleset = STMAutoDelayData.Ruleset.FollowedBySpace;
autoDelay.count = 5;
dialogText.data.autoDelays[autoDelay.character.ToString()] = autoDelay;

'''

I'm still experimenting with what works best with my system and writing style, so it's not a huge problem or anything, but I thought it would make sense to just toss a bug report up for it.

Developer

What is the string of text you're trying to print? The different rulesets can prevent the delay from happening.

Ok! I've found the issue here. (Also, please let me know if the bug reports are getting annoying, I'm not trying to be a problem, user. ^^;) It's a bit more complex than I anticipated. The specifics here (the exclamation point) have to do with some of my in game preprocesing of text, but it still applies to STM.

Ultimately the bug is this: The next character which is considered includes the opening "<" of tags when it should ideally be testing the next VISIBLE character. Consider this string:

"<i>I'll never give up!</i> I'll try forever!"

The first sentence will not have its autodelay fire off for the exclamation point even though the next visible character is a space. I am changing some of how my preprocessing works and will be able to work around this, but its worth considering. It's a bit of an edge case, but when it comes up, it's pretty confusing.

On line 2601 of SuperTextMesh.cs (in my version, actual if statement quoted below), the test which determines whether the autodelay will happen is processed. The problem is that when you have this pattern: "!<TAG> " that it only returns true when the '<' character is evaluated. '<' is never printed, so the delay does not fire off. 

'''else if(data.autoDelays.ContainsKey(myText[i-1].ToString()))'''

(2 edits)

EDIT: I am actively debugging this, will post results shortly.


This string will cause the bug to appear:

"This is a test EN! This is a testEN. This is a testEN? This is a testEN, This is a test; This is a testJP! This is a testJP。 This is a testJP?This is a testJP、 blah"

I did this testing with the default autoDelay settings left in place, and tested with Japanese punctuation marks as well as English ones. I am wondering whether there is something that is interpreting/consuming the exclamation mark in SuperTextMesh logic before a given character can be assigned the auto-delay in the preprocessing step.

And again, this only appears when the ruleset it set to STMAutoDelayData.Ruleset.FollowedBySpace.

Developer

The thread kinda split, so replying here!

Oh wow I somehow never caught that, but yeah that makes a lot of sense... I'm going to see what I can do in regards to this and the other bug soon! I'd really like to fix these and push the new update out, but I need juuust a bit more time

Sounds good! And again, thank you for being so responsive on the boards!

Developer

ok, should be fixed!

Woo!