I\'m hoping to use Ruby as a scripting language for my game engine. I\'ve found the usual articles describing how to call Ruby classes from C++ code and vice versa (e.g. her
You could always re-design the way the scripts work to suit the script engine rather than trying to get the engine to work with the original scripting paradigms.
So, if you had this:
proc:
action 1
action 2
sleep a bit
action 3
end
which would require the script to be suspended on the sleep line, do this:
proc
action1
action2
set timer (time, callback_proc)
end
callback_proc
action3
end
which lets the scripting engine finish each method neatly. It wouldn't need many changes to the hosting side - each version requires some form of event system which can restart the script engine.