Closed theludovyc closed 2 years ago
Another problem is save/load system. How can I start a thread on hello_world() where I want ?
@theludovyc About threads in Rakugo they are only in it for 3 reasons:
yield()
But how this works is black magic to me, as they were programmed, by this other guy.
Law is "In Godot we can't kill a thread. So to quit properly, all thread need to be finished". So we can think first, add a flag in all function say(), ask(), notify(), menu(), etc... to check if a thread want to ended and do nothing. But we can add what we want in hello_world() because it's gdscript, save, pop things, make beautiful effect, etc... And them be executed !
I'm not sure what you mean by this, but if this is a good solution then go with it, I trust you.
Another problem is save/load system. How can I start a thread on hello_world() where I want ?
I remember that this was working the only place I can point you to are scripts: Store.gd and StoreStack.gd in addons/Rakugo/lib dir.
So, we do this https://github.com/rakugoteam/RakuScript
For now project use thread
Dialogue.gd
default_starting_event is a function name, like this one
We can see step()
If we refer to doc https://docs.godotengine.org/en/stable/tutorials/performance/threads/using_multiple_threads.html#semaphores ,
step_semaphore.wait()
need to be used in thread. I don't know if it executed in thread but "it's work".In Godot we can't kill a thread. So to quit properly, all thread need to be finished.
We can see _exit_tree()
But thread need to be finished, so hello_world() must be executed in whole. So we run game, step() it's called, we want to quit, _exit_tree() is called, step_semaphore is released and go on. say(), ask(). And there we have a problem.
We can see ask()
In ask(),
step_semaphore.wait()
is executed. After we want to close. And in _exit_tree() we waiting withthread.wait_to_finish()
. So it's never ended...Law is "In Godot we can't kill a thread. So to quit properly, all thread need to be finished". So we can think first, add a flag in all function say(), ask(), notify(), menu(), etc... to check if a thread want to ended and do nothing. But we can add what we want in hello_world() because it's gdscript, save, pop things, make beautiful effect, etc... And them be executed !