rakugoteam / Rakugo-Dialogue-System

Inspired by Ren'Py, Rakugo is a project aiming to provide a way to make narrative-based games on Godot easily. Simplify your project, if it is a visual novel, point and click, RPG, interactive text game or many other styles and blends of styles.
https://rakugoteam.github.io
MIT License
222 stars 7 forks source link

`SET_VARIABLE` allows only for int, float, string, bool, other variable #214

Open Jeremi360 opened 1 year ago

Jeremi360 commented 1 year ago

Need to fix this we should be able, thanks to how godot is coded, easy be able to suport any variable type that GDScript supports.

Jeremi360 commented 1 year ago

Our discord discussion stooped on this:

I was thinking that we just update SET_VARIABLE regex to just "(?{VARIABLE}) = ((?.+)" And use str_to_var() then var_to_bytes() But I see that for example there can be problem if some one will try something like Object.new()in rkscript - for that we would need to run somehow gdsript code - I don't have idea how yet. Or maybe there is something different I don't see here ?

this only way I find to execute gdscipt code from string: https://godotengine.org/qa/339/does-gdscript-have-method-to-execute-string-code-exec-python

Jeremi360 commented 1 year ago

@theludovyc I also just realize that our SET_VARIABLE is almost just DEFINE_VARIABLE, in script is only possible to do x = 2 and x = 3, but can't do x = 2 + 1 or x += 1 or logic in it x = a or b - this is bad! It means that now for base math and logic user need to add custom regex and it shouldn't be this way. I just have idea how to handle it, but I need to test it first.

theludovyc commented 1 year ago

in script is only possible to do x = 2 and x = 3, but can't do x = 2 + 1 or x += 1 or logic in it x = a or b - this is bad

We can think about this for later version. You can make an issue 😊

we will need to convert Rakugo variables to GDScript variables before executing this code. I just have idea how to handle gdscript code, but I will post code of here it later.

Okay. I have just one question I cannot answer now, it is : if we convert them to gdscript variable how can we access them ?

Jeremi360 commented 1 year ago

We can think about this for later version. You can make an issue 😊

I made new issue #237 for it @theludovyc