registering specialized template class?

Started by
5 comments, last by slicer4ever 11 years, 6 months ago
I'm attempting to register several specialzed template classes, but i keep getting the error: "Error : Failed in call to function 'RegisterObjectType' with 'LLObject<ConvexHull@>' (Code: -8)"

i'm registering it like so:


m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT);
m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);


any tips on what i'm doing wrong?, if you need more code, i can post more, just tell me w/e u need.

edit: also, i'm using AS 2.25.0
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.
Advertisement
Have you registered the LLObject template first?

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

yes, i've tried it with declaring it as a template, before i declared the specialized class like so:


m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT);
m_ScriptEngine->RegisterObjectType("LLObject<class T>", 0, asOBJ_REF|asOBJ_NOCOUNT|asOBJ_TEMPLATE);
m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);


but this still results in the same error code.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.
It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.

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


It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.


Thanks Andreas, in the meantime, I can probably come up with an alternative solution, not exactly what i'd like, but it'll have to do for now=-).
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.
The registration was failing because the LLObject template type didn't have a default constructor, which AngelScript treated as if the template type cannot be instanciated at all.

I've fixed this in revision 1424.

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

thanks Andreas=-), i've successfully templated several types without any complaints from the compiler so far.

I'll post a response if i run into any more issues.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

This topic is closed to new replies.

Advertisement