🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Little problem with registering

Started by
3 comments, last by Black Dot 18 years, 10 months ago
Hello, there! I have a slight problem I can't resolve. I hope you'll be able to help me. Here is the method I have:

void SomeClass::Target( OtherClass* cl )
{
   (...)
}
And here is how I want to register it:

r = ScriptEngine->RegisterObjectMethod("SomeClass", "void Target(OtherClass&)", asMETHOD(SomeClass,Target), asCALL_THISCALL);assert(r >= 0);
Unfortunately, there is always an assert error :( . Can you help? Thanks. Regards, Black Dot
Falling Man GamesFeel free to visit us!
Advertisement
Add the 'in', 'out', or 'inout' keyword after the reference name. 'Otherclass & in'.

Your C++ function also takes a pointer, not a reference. Underneath they are the same; but I don't know if that will cause problems or not.
I tried:

void Target(OtherClass& in)void Target(OtherClass& inout)void Target(OtherClass ∈)void Target(OtherClass@ in)


None of them seem to work :(
Falling Man GamesFeel free to visit us!
Well, if you've tried all these combinations and neither work, then it would seem that the OtherClass type hasn't been registered yet.

How did you register the OtherClass type?

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

Haha, oh my god, how stupid I am :D.

Of course I did everything in wrong order :). Now everything works!
WitchLord to save the day again :) Thank you very much!
Falling Man GamesFeel free to visit us!

This topic is closed to new replies.

Advertisement