-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Real set variable #240
Real set variable #240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not forget to update unit tests or add new like you say
Empty lines are here to make code more readable, why you remove them ?
I'm doing it, this is way I made this PR a draft in the first place.
Wow sorry dude, but you made new line so often that for me it looked bad, so I thought that some thing was wrong. |
I added tests, but my code doesn't work and I don't know way. |
I not forgot you @Jeremi360 😊 |
I think I already restored your empty lines @theludovyc |
@Jeremi360 I mean, to help you 😊 |
var var_ = null | ||
if Rakugo.has_variable(var_name): | ||
var_ = Rakugo.get_variable(var_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rakugo.get_variable return null if variable is not found. So you do not need to use has_variable before get_variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I made this if this way as Rakugo would crash when get_variable()
returns null - we program it this way,
push_error()
stops program no matter what is next.
Rakugo-Dialogue-System/addons/Rakugo/Rakugo.gd
Lines 74 to 85 in d11e1fe
func get_variable(var_name: String): | |
var vars_ = var_name.split(".") | |
match vars_.size(): | |
1: | |
if store_manager.variables.has(var_name): | |
return store_manager.variables.get(var_name) | |
2: | |
return get_character_variable(vars_[0], vars_[1]) | |
push_error("Rakugo does not knew a variable called: " + var_name) |
addons/Rakugo/lib/systems/Parser.gd
Outdated
if str_expression.is_empty(): | ||
parse_array.push_back([key, result]) | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your str_expression is empty why you do not send an error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, I last touch this code over a month ago, so maybe I was to change into something and forgot.
I will test with out this if
-block and only if find that is really need restore it in proper form.
@Jeremi360 Do you try to debug with prints ? |
@Jeremi360 You need to fix this bug #99, to fix yours |
@theludovyc About #99 I will try to fix it also then. When I try to run any of RKScripts examples in Godot 4.1.1 it always start for this 3 errors: |
I found why we have these errors now godotengine/godot#78214 (comment) Edit : Fix is ready, I made a pr soon :) ! Edit : here #241 |
@theludovyc Nice! I will merge it soon! |
partialy implemented by #263 |
fixes #237