AngelScript 2.7.0 has been released
LUA seems to be following the 'slower bigger updates' philophosy. AngelScript has always followed the 'quicker smaller updates' model (atleast since I've discovered it). But that doesn't mean a project has to update every time a new version is released.
September 16, 2006 12:41 PM
Sorry, i must be missing something, but calling a function in my application soesn't work... Accessing variables is OK though..
Any ideas ?
Any ideas ?
You need to tell us more. From what you're saying the problem could be numerous things.
I also suggest you start a new thread, so that we can focus on only your problem when reading about it and responding.
Regards,
Andreas
I also suggest you start a new thread, so that we can focus on only your problem when reading about it and responding.
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
September 20, 2006 02:16 PM
First of all, i would like to thank you for the reply. I knew it i need to tell more, but i was kind of "passerby" and a bit lazy ;P
Now to the point...
The init looks like this :
engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterScriptString(engine);
int r ;
r = engine->RegisterGlobalProperty("bool gun_light", &gun_light);
r = engine->RegisterGlobalFunction("void Boom()", asFUNCTION(Boom), asCALL_CDECL); assert( r >= 0 );
// Do not output anything else to printf
engine->SetCommonMessageStream(0);
Declarations look like this :
void Boom(void) ;
bool gun_light = true ;
This works :
char* script = "gun_light = false" ;
int r = engine->ExecuteString(0, script);
This doesn't
char* script = "Boom();" ;
int r = engine->ExecuteString(0, script);
I'm sorry , but can you please tell what i'm missing here ?
Thanks
Now to the point...
The init looks like this :
engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
RegisterScriptString(engine);
int r ;
r = engine->RegisterGlobalProperty("bool gun_light", &gun_light);
r = engine->RegisterGlobalFunction("void Boom()", asFUNCTION(Boom), asCALL_CDECL); assert( r >= 0 );
// Do not output anything else to printf
engine->SetCommonMessageStream(0);
Declarations look like this :
void Boom(void) ;
bool gun_light = true ;
This works :
char* script = "gun_light = false" ;
int r = engine->ExecuteString(0, script);
This doesn't
char* script = "Boom();" ;
int r = engine->ExecuteString(0, script);
I'm sorry , but can you please tell what i'm missing here ?
Thanks
You're not using the latest version of AngelScript, since the method SetCommonMessageStream() has been substituted for SetMessageCallback(). What version are you using?
I assume the assert() passes? Have you tried compiling in Debug mode? In Release mode the assert() is not executed.
From what I can see your code should work, even if you're not using the latest version. The only thing I can think of is that you're working with a compiler and/or operating system for which AngelScript doesn't have support for native calling conventions, in which case the only calling convention that is supported would be asCALL_GENERIC.
What compiler and platform are you working with?
Can you try changing the asCALL_CDECL to asCALL_GENERIC and see if it works? Since the function doesn't take any parameters, you don't have to modify anything else.
Regards,
Andreas
I assume the assert() passes? Have you tried compiling in Debug mode? In Release mode the assert() is not executed.
From what I can see your code should work, even if you're not using the latest version. The only thing I can think of is that you're working with a compiler and/or operating system for which AngelScript doesn't have support for native calling conventions, in which case the only calling convention that is supported would be asCALL_GENERIC.
What compiler and platform are you working with?
Can you try changing the asCALL_CDECL to asCALL_GENERIC and see if it works? Since the function doesn't take any parameters, you don't have to modify anything else.
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
September 21, 2006 08:49 PM
Yep, i'm not using the latest version,should i ? :)
I'm using VC 7.0 + DX9.
Thanks, it worked fine with GENERIC flag.
Thanks again, sorry for spamming the topic, you could delete my ramblings now.
Great library !
I'm using VC 7.0 + DX9.
Thanks, it worked fine with GENERIC flag.
Thanks again, sorry for spamming the topic, you could delete my ramblings now.
Great library !
You don't have to use the latest version if you don't want to, but obviously the latest version has new features that you might find useful. Also, there are always bug fixes with new versions that you might need.
I find it strange that it doesn't work with asCALL_CDECL. Unless of course you're compiling for a 64bit target. Are you?
I find it strange that it doesn't work with asCALL_CDECL. Unless of course you're compiling for a 64bit target. Are you?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
September 23, 2006 12:25 PM
No, i'm not compilling for 64 bit target.It's a pretty big application now and i'm using other third-party libraries like OpenAL and Newton.I Don't know if they interfere in some way. Here's a short video, in case you are interested : www.suryx.net/early_test.wmv
By the way, i'm using version 2.4.1e of your library.
By the way, i'm using version 2.4.1e of your library.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement