I want to move verious parts of my app into simple scripts, to allow people that do not have a strong knowleagd of c++ to be able to edit and implement various features.
Because its a real time app, I need to have some kind of multi-tasking for these scripts, idealy I want it so that the c++ app calls a script function which then continues running (under the c++ thread) untill either a pause point (Wait(x)), or it returns. In the case of it waiting the state needs to be saved ready for the script to be restarted the next time the app loops after the duration has expired.
The scripts also need to be able to call c++ functions, idealy using the c++ classes rather than just plain functions which wrap the c++ classes.
I don't want to spend a massive amount of time implementing this, so using an existing scripting lanaguage is prefered to trying to write my own. I heard that Python and Lua can be integrated into a c++ app, but I do not know how to do this to achive my goals.
- The scripts must be able to call c++ functions
- The scripts must be able to "pause" when certain functiosn are called (eg Wait), and be restarted again by the c++ thread
- Needs to be pretty fast, this is for a real time app and there could potentialy be alot of scripts running.
I can probebly roll the multi-tasking code fairly easily, provideing the scripts can be saved, and restarted (posibly by a diffrent thread to the origenal)