Jump to content
  • Advertisement
Sign in to follow this  
Black Dot

Little problem with registering

This topic is 4842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I tried:


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


None of them seem to work :(

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!