Hey everyone, I’m new with Chaiscript (started using it some days ago).
I’m trying to create a 2D Platform game and I wanted to embed a script language in my game.
I chose Chaiscript because it looked like it had the best integration with C++.
I had some difficulties with some parts (and there isn’t much docs online) but I always found what I wanted.
Now I’m having difficulties again with States, it seems that saving / loading states does not have any effects.
My script is running in a thread so I stop the thread before saving the state, and then I load the state while the thread is still not running.
I store states in a map :
this->stateDatabase[stateToSave] = this->scrExec->get_state();
And I restore them like this :
Then I can start the thread again :
this->scrThread = new std::thread(&ScriptEnv::run, this);
Did I do something wrong ? Tell me if I forgot to add some details required to answer