Original Post
Hi everyone.
I''m aware at how (relatively) easy it is to embed something like Spidermonkey / Javascript into a C or C++ application.
I would very much like to have a script for a character in a game that goes something like this:
// pseudocode Walk to forest; get firewood; walk to house; drop item; // etcOf course when the "walk to house" or "pick up item" is executed, it will take the character some time to walk to the house. So ideally, I want to be able to store on the object, the fact that bob is walking to the house (having calculated the route etc), and store the execution stack of the script, and be able to carry out other tasks while he''s walking there (like moving other NPCs, drawing stuff, and responding to user input) I''m not interested in using a native thread for each actor - that would be far too cumbersome. I''m just interested in having the ability to "block" out in a script, and continue it once a given action is complete. Also what would be useful would be to completely jump out of the script (say bob had some other stimulus which caused him to give up taking the wood to the house), and start a new one -some exception handling or signalling mechanism perhaps - or just the ability to stop a script at a given blocking point and abandon its execution context. Any ideas? Mark