• Content count

  • Joined

  • Last visited

Community Reputation

109 Neutral

About AnantaDas

  • Rank
  1. AngelScript "this"?

    Thanks for help, I revised my code and everything is working fine now :)
  2. AngelScript "this"?

      Thanks for the reply, however, I don't think I understand it properly. Let me summarize:   1. In AngelScript I will have InitScriptInstance( @this ); as you wrote   2. In C++ I will register the function using declaration "void InitScriptInstance( ?&in )", is this still correct?   3. The function itself will look like this void InitScriptInstance( void* pointer, int type ) { asIScriptObject* obj = (asIScriptObject*)pointer; }   This does not work, so I guess one of the three steps caused misunderstanding on my side. Would you please care to elaborate? Thanks   P.S.: If I rewrite the 'pointer' getter in the function above like this: asIScriptObject** obj = (asIScriptObject**)pointer; the dereference *obj is then NULL.
  3. AngelScript "this"?

    Hello, I've got a question about AngelScript. I need to pass a reference to a script class instance into C++ for future access, so I created a function and exported it to AScript using "void InitScriptInstance( ?&in )". It works fine but the problem is I don't know how to pass a reference to current object (like 'this' in C++) - when I try to write:   class MyClass { MyClass() { InitScriptInstance( this ); } }   The program goes into an infinite loop. If I replace the 'this' with something else (like 5) it works well but this obviously isn't what I need. Anyone knows the correct syntax?   Thanks