🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Script Threads question

Started by
0 comments, last by WitchLord 17 years, 5 months ago
Hi I am using anglescript for my project and was wondering if these 2 things are possible: -a wait function in script that simply waits for the specified time to pass in seconds before continuing in script, game runs as normal -ability to call several script threads at once (maybe one is a while(1) loop, etc etc) If it is possible to do these things in angelscript are there any examples anyone could point me to? So far I have not had much luck in finding any. Thanks for anyones help,
Advertisement
Yes, you can register an application function that will call Suspend() on the context. At a later time the application can resume the script execution by calling Execute() on the context again.

Yes, you can have multiple contexts executing for short periods of time during each game loop. You do this by setting a line callback function that suspends the execution after a certain time has gone by.

Have you looked at the samples that come with the AngelScript SDK (in the /samples/ folder)? They show you how to do these things.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement