Skip to main content
gamedev.net
🔒 Locked

Script Threads question

Started by gcard28 Jan 23, 2007 at 7:11 PM 0 replies 950+ views
Original Post
gcard28
gcard28
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,
WitchLord
WitchLord
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 - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.