Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualthePyro_13

Posted 26 May 2012 - 08:39 PM

That's right, they all inherit from Entity(except the level scripts).

I've declared it as shared, but I'm having trouble defining the interface.
r = ScriptEngine->RegisterObjectMethod("Area", "asIScriptObject@ CreateEntity(std::string source, int posx, int posy)", asMETHOD(Area, CreateEntity), asCALL_THISCALL); assert( r >= 0 );

This line throws an assert. Do I have to register to Entity type to the Script engine? And do I define the function above as returning asIScriptObject@ or Entity@(The C++ function is now returning asIScriptObject*)?

#1thePyro_13

Posted 26 May 2012 - 07:13 PM

That's right, they all inherit from Entity.

I've declared it as shared, but I'm having trouble defining the interface.
r = ScriptEngine->RegisterObjectMethod("Area", "asIScriptObject@ CreateEntity(std::string source, int posx, int posy)", asMETHOD(Area, CreateEntity), asCALL_THISCALL); assert( r >= 0 );

This line throws an assert. Do I have to register to Entity type to the Script engine? And do I define the function above as returning asIScriptObject@ or Entity@(The C++ function is now returning asIScriptObject*)?

PARTNERS