New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Executer, Variables in string are only replaced in SAY #255
Comments
@theludovyc We must fix it, I think we could miss it because the Visual Novel Kit used a parser, which also had such functionality for variables and this meant that this error was not seen before. |
On all strings :) |
I'm working on it, @theludovyc , but I see that you make parsing strings for |
What do you want to mean by that ? 😊 |
@theludovyc I'm just curious way this is done in Executer.gd and not in Parser.gd. But it dones't matter as I done this in #256 , I need just to test it - I will do it soon. |
I not get it what you mean by parse string in executer and not in parser ? You can name it: replace_variables() |
@theludovyc never mind, I already understood why it must be done in Executer.gd and not in Parser.gd
Yes this is good idea. |
@theludovyc Unit Test I made for Variables in String gvies me pass for every one test 😁 : But is this a good test ? I don't have much experience with those so I'm not sure: |
Yes good, but at wrong places. You do not need to recreate one. Add them in TestSay, testMenu and testAsk. And you should verify the test end properly, with wait_execute_script_finished 😊 |
@theludovyc I added |
@theludovyc a = 2
"a is <a>" # -> a is 2
a = 4
"a is <a>" # -> a is 2 # it wouldn't react to change in line above Also there is already test Rakugo-Dialogue-System/Test/TestParser/TestSay/TestSay.gd Lines 54 to 73 in 9a7efde
|
When we split parser and executer we start to split tests too. But the job is not finished yet and you have test in Parser folder that parse and execute. But you have some tests in Execute folder. And if I am not wrong we have one for Say and Ask, maybe not Menu. You can update them to make them better. You do not need to create variable from an rkscript you can use Rakugo.set_variable if needed. |
@theludovyc never mind, Okay my bad, there are TestSay, testMenu and testAsk in TestExecuter. |
@theludovyc I see why I made this mistake and was so confused, by mistakie you connected TestParser scripts to TestExcute scenes:
I will fix that! |
@theludovyc I fixed this and moved all test from TestVarsInStrings.gd to proper test in TestExecuter, but I need to fix one thing |
Woups... Sorry about that, I never saw it because of gut. Maybe the scene is not needed ? Thank you to handle it 😊 |
@theludovyc Now it works and pass all test and I added test for dynamic use
and test it passes is 100%: func test_variables_in_strings():
watch_rakugo_signals()
await wait_parse_and_execute_script(file_path)
assert_variable("test_var", TYPE_STRING, "c")
assert_variable("test_var_b", TYPE_STRING, "cb")
await wait_execute_script_finished(file_base_name) |
@theludovyc do you think I can merge #256 ? |
No, I will make a review when I will be at home. It the meantime you can squash your commits and remove unrelated files 😊 |
@theludovyc What "unrelated files" you mean ? |
Review is ready 😊 (maybe next time we can talk all about the technical stuff in the pr and not in the issue 😅) |
This is a combination of 3 commits: Commit 1: ffb6268 - Merge remote-tracking branch 'theludovyc/master' into godot-4 Commit 2: 5517046 - clean up in plugin.gd and not needed .git conf files inside addons/Rakugo Commit 3: adf1c39 - fix rakugoteam#255
When you put a variable in ask like "How old are you <gd.name> ?"
The variable is not replaced. It is only works for SAY.
The text was updated successfully, but these errors were encountered: