Original Post
Hi there i've been trying AngelScript for a few days and find it so useful (and lack of documentation :P). Now, into the busyness: i need to make a different type of function call, which would create a new instance of that function, instead of the normal run. I explain: The main idea of this is create a pseudo multy-process management class, like the example "concurrent" that comes with AngelScript, with just a few differeces: -instead of stoping every Script (in my case: process) after a certain amount of time, every process can call a function Frame () to tell the manager it has done everything it needs to do in that frame, and thus, be sent to sleep In fact, this "frame" function is a refference to some function in the App which simply Suspends the context -Every Process is in fact, a Context. The Manager stores the Contexts into a vector, so we can do something like:
...
for ("every Context")
Manager.ContextVector->Execute ();
End For
...
Remember: Scripts will pause themselves with a Call to Frame () My Problem: Well, i've already managed to implement the Frame () related stuff thanks to the functionality of angelscript: Register a Global Function: Frame, which simply calls ActiveContexts->Suspend (). What i CANT do and cant figure out how to do is: Catch Function Calls within the scripts. Everytime a script calls a function, this function call shoudld be taken by the App and passed to the Manager, which will then allocate the contexts and do the necessary stuff to create a new process. any ideas? EDIT: actually, what i need is a way to thell the App "hey, create a new instance of *this* Process using *this* parameters". Something like Create_Process (MyHappyProcess, Param1, Param2, ... , ParamN) where the N Parameters will be passed to MyHappyProcess when it is created [Edited by - ALRAZ on September 4, 2005 8:46:53 PM]