I've made a custom [pause] tag which partly works - basically if it finds the tag, it adds the absolute index of the character to an array, and then in my typewriter script if the visible character count is equal to the first value in the array, increase the wait delay and remove the first entry in the pause array so it can move onto the next.
extends RichTextEffect
class_name RTEPause
var bbcode := "pause"
var done = false
func _process_custom_fx(char_fx):
if not done:
done = true
Global.text_pause_positions.push_back(char_fx.absolute_index)
return true
This works for the first character, but if I include multiple [pause] tags only the first index gets added.
I feel like it's due to the done flag that makes the function only run once, maybe it doesn't get set back to false so the next tag doesn't actually do anything?