03-13-2014, 11:34 PM
So long story short, I have this script in my game's message boxes that pauses rendering for a bit after a . ! or ? (A sentence-by-sentence script instead of letter-by-letter) The regular expression that does this is:
I want to change it so the pause before the next sentence to be based on the length of the sentence. How would I modify this regular expression to capture the sentence length into a variable?
Code:
@text.gsub!(/([?.!][^\n\z"])/) { "#{$1}\005[#{$game_system.message.end_delay}]" }
I want to change it so the pause before the next sentence to be based on the length of the sentence. How would I modify this regular expression to capture the sentence length into a variable?