Skip to main content
GameDev.net gamedev.net
🔒 Locked

Issues with SetLineCallback

Started by wumpee Mar 21, 2005 at 6:59 PM 3 replies 1.9k views
Original Post
wumpee
wumpee
Has anyone had any issues using line callbacks in release mode? I'm assuming the correct way to emulate ExecuteNext() is by having a line callback such as the following: void LineCallback(asIScriptContext *pContext) { pContext->Suspend(); } This works fine in a debug build, but seems to fall over in release mode. It appears that the whole script is getting executed in release mode instead of just a single line. Any thoughts? Regards, Wumpee.
Rain Dog
Rain Dog
It works fine for me.

Similar code to this:

void ASLineCallback(void *nothing){	while(ScriptPlayInfo.PauseScript && !ScriptPlayInfo.Stop)		Sleep(10);	if(ScriptPlayInfo.Stop)	{		TerminateThread(VariableThread, 0);		ScriptPlayInfo.AngelScriptContext->Abort();	}	return;}
WitchLord
WitchLord
Verify that the library isn't built with the preprocessor flag BUILD_WITHOUT_LINE_CUES set in release mode (check project settings). If this flag is set then the line callback is only called once per loop, instead of for each statement.
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
wumpee
wumpee
It turns out that it was building with BUILD_WITHOUT_LINE_CUES set in release mode. I don't remember changing anything, so maybe AS 2.1.0 Wip 6 was released with this set.

Awesome work by the way =)

Regards,
Wumpee.
WitchLord
WitchLord
Yes, I released the library with this flag set by default. This was an error, and future versions should be corrected.

I'm happy that you like my work :D
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.