Advertisement

SOS,KNIGHTS

Started by September 13, 2008 09:21 PM
3 comments, last by yzslhawk 16 years, 1 month ago
WHO CAN HELP ME? KNIGHTS IN C++, We define a struct struct stMessage{ int msg; int Param1, Param2, Param3; asCScriptString *String1, *String2; }; Then we register the struct: void RegisterMessageSt(asIScriptEngine* engine) { int r; r = engine->RegisterObjectType("stMessage", sizeof(stMessage), asOBJ_CLASS); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "int msg", offsetof(stMessage, msg)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "int Param1", offsetof(stMessage, Param1)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "int Param2", offsetof(stMessage, Param2)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "int Param3", offsetof(stMessage, Param3)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "asScriptString@ String1", offsetof(stMessage, String1)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "asScriptString@ String2", offsetof(stMessage, String2)); assert( r>=0 ); } but in running : r = engine->RegisterObjectProperty("stMessage", "asScriptString@ String1", offsetof(stMessage, String1)); assert( r>=0 ); r = engine->RegisterObjectProperty("stMessage", "asScriptString@ String2", offsetof(stMessage, String2)); assert( r>=0 ); r<0,error. who can tell me what to do ? we use the angelscript2.10.0
It returns an error. Okay. What error does it return?
Advertisement
Assertion failed!
Expression: r>=0
Did you set the message callback after creating the script engine? The engine would tell you that the asCScriptString is not a type it understands.

The asCScriptString type is called 'string' in AngelScript.

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

Great WitchLord, thank you.

This topic is closed to new replies.

Advertisement