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

Rework Rakugo/Parser, parse_scripts(folder_path:String) #84

Open theludovyc opened 2 years ago

theludovyc commented 2 years ago

Currently if you want to parse script, you use : func parse_script(file_name:String) It's parse a .rk file and execute it.

In Parser class, parse and execute are already split but user "can't" access it.

I propose to add or update funcs.

parse_script(file_path:String) <= parse a file and store result in dictionary (like a cache). Key it's fileName without extension.

parse_scripts(folder_path:String) <= parse all rk files in folder at path and store them.

execute_script(file_name:String) <= execute script already stored.

This also sets the stage for jumping between scripts.

Jeremi360 commented 2 years ago

parse_script(file_path:String) <= parse a file and store result in dictionary (like a cache). Key it's fileName without extension.

I love :heart: this idea of pseudo-compilation, we can save it to files so build game will be faster.

parse_scripts(folder_path:String) <= parse all rk files in folder at path and store them.

Maybe we can use it with tool mode, so it parses all scripts before launching game. And if we save this cache to files, then we can recompile only changed scripts

This also sets the stage for jumping between scripts.

Yes, :fireworks:

theludovyc commented 2 years ago

Maybe we can use it with tool mode, so it parses all scripts before launching game. And if we save this cache to files, then we can recompile only changed scripts

Keep it in mind :)

theludovyc commented 2 years ago

Do #92 before :)

Jeremi360 commented 2 years ago

reopen as mentioned in #118

theludovyc commented 2 years ago

parse_script(file_path:String) done

execute_script(file_name:String) done

parse_scripts(folder_path:String) <= parse all rk files in folder at path and store them.