[bug] config.say_menu_text_filter doesn't work with menus?
Posted: Wed Apr 21, 2021 4:16 am
Hi everyone.
First of all I want to say I scoured the forums looking for this issue in case it was known. Also, I'm not sure if it's actually a bug or if I'm just doing something wrong. I seem to get different results with a say statement, versus a menu statement. I borrowed Remix's code here. I was testing this with a comma that was inside a menu statement. It didn't work for me, so I spent a few hours poking it with a stick trying to figure out what I'd done wrong. After a bit of desperation, I tested it with a say statement outside of the menu statement, and it works fine.
Is this a limitation of "config.say_menu_text_filter", or is it a limitation of the "wait" text tag, or is it a bug after all? Here are a couple of code examples to explain what I've done and what results I got...
This works fine - the wait tags are injected into the say statement when there's a comma or full stop inside the statement.
This doesn't work - although I'm using the same code, and the function describes itself as working with both say and menu statements, in the documentation.
First of all I want to say I scoured the forums looking for this issue in case it was known. Also, I'm not sure if it's actually a bug or if I'm just doing something wrong. I seem to get different results with a say statement, versus a menu statement. I borrowed Remix's code here. I was testing this with a comma that was inside a menu statement. It didn't work for me, so I spent a few hours poking it with a stick trying to figure out what I'd done wrong. After a bit of desperation, I tested it with a say statement outside of the menu statement, and it works fine.
Is this a limitation of "config.say_menu_text_filter", or is it a limitation of the "wait" text tag, or is it a bug after all? Here are a couple of code examples to explain what I've done and what results I got...
This works fine - the wait tags are injected into the say statement when there's a comma or full stop inside the statement.
Code: Select all
init python:
def alter_say_strings( str_to_test ):
str_map = {
". " : ". {w=0.75}",
", " : ", {w=0.45}",
}
for key in str_map:
str_to_test = str_to_test.replace( key, str_map[ key ] )
return str_to_test
define config.say_menu_text_filter = alter_say_strings
"The comma in this statement, pauses the text for 0.45 seconds."
Code: Select all
init python:
def alter_say_strings( str_to_test ):
str_map = {
". " : ". {w=0.75}",
", " : ", {w=0.45}",
}
for key in str_map:
str_to_test = str_to_test.replace( key, str_map[ key ] )
return str_to_test
define config.say_menu_text_filter = alter_say_strings
menu:
"The comma in this statement, is just ignored."
"Option One.":
"The first option was chosen."
"Option Two.":
"The second option was chosen."