Hi, newbie compiling question here
Hi I'm new to the forum, My name is Nicolás, I'm from Argentina and I'm developing on C++ for Iphone and trying to implement Angel Script for a little editor app I'm working on at the moment...
I'm having a bit of a struggle trying to compile and run a simple method call... I'm trying to bind a test "printInt" function which only prints something on the console to a corresponding print function in angel script. Having already initialized the engine without any problems (most of my initialization code was copied from one of the examples that come inside angel script's files), this is how I'm trying to bind it:
int asResult = 0;
asResult = engine->RegisterObjectType("InputOutput", 0, asOBJ_REF | asOBJ_NOHANDLE );
assert( asResult >= 0 );
asResult = engine->RegisterObjectMethod("InputOutput", "void printInt()", asMETHOD( DF2ScriptEngine, printInt), asCALL_THISCALL);
assert( asResult >= 0 );
asResult = engine->RegisterGlobalProperty( "InputOutput io", this );
assert( asResult >= 0 );
my script code is:
io.printInt();
everything seems fine so far, however when trying to build the module, it doesn't recognize the identifier "io", I check to see if the object was properly set in the engine and I get these results:
Number of Global Properties: 1
Number of object types in engine: 1
Number of object Types in module: 0
so... I'm kinda wondering if I'm missing something or I did something wrong, I'm planning on using hte scriptBuilder add-on to see if that solves this issue but posting here and getting some feedback wouldn't hurt...
thanks for your time!
From looking what you posted and assuming that this actually machtes your implementation, you are missing the ADD_REF and RELEASE behaviour methods for your InputOutput type. Even if you don't need them you have to provide dummy methods for those two behaviours. I had the same problem in the beginning, registering a class the same way as you do with asOBJ_REF.
Thoran
Thoran
My website
Actually, since the InputOutput type is registered with asOBJ_NOHANDLE, then no asBEHAVE_ADDREF or asBEHAVE_RELEASE behaviours should be registered.
From the code you showed us you seem to do everything correctly. I need to know what the error is. What is the compilation error you get from AngelScript? Did you set the message stream to get that information?
Also, I'd like to know from you if you have run into the problem mentioned in this other thread: Registered class methods on iPhone doesn't seem to work.
From the code you showed us you seem to do everything correctly. I need to know what the error is. What is the compilation error you get from AngelScript? Did you set the message stream to get that information?
Also, I'd like to know from you if you have run into the problem mentioned in this other thread: Registered class methods on iPhone doesn't seem to work.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement