🎉 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!

Problem with overloading Object-operator

Started by
5 comments, last by Rain Dog 18 years, 3 months ago
Hello, when I do this:

RegisterObjectBehaviour("cVector3f", asBEHAVE_ADD, "cVector3f f(const cVector3f& in) const", asMETHODPR(cVector3f, operator+, (const cVector3f&) const, cVector3f), asCALL_THISCALL);

I get an "Invalid configuration" error. (No details) I believe that I registered the object correctly, as I allready successfully registered some of its methods. Any ideas?
Advertisement
How is the cVector3f type registered? What behaviours does it have?

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

RegisterObjectType("cVector3f", sizeof(cVector3f), asOBJ_CLASS);//...//This works!RegisterObjectMethod("cVector3f", "float Dot(cVector3f& in)", asMETHOD(cVector3f, Dot), asCALL_THISCALL);//More methods...//No behaviours, except for the operator that does not work
I know what it is.

You're trying to register the behaviour asBEHAVE_ADD as an object behaviour, but AngelScript doesn't support this yet. AngelScript only supports global behaviours for these operators, so you'll have to write a global function instead.

I'll have to modify AngelScript to give a better explanation for this.

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

I understand.
So you plan to support this in the future?
Yes, I have plans for this, though it will be awhile.

It seems that I'm saying that a lot lately. I wish I had more time to work on AngelScript. There is so much I want to do with it, but with so few hours to work it unfortunately takes a long time for features to be implemented. It's been 3 years since I first started working on AngelScript, and I still have a long way to go for the library to be feature complete.

Anyway, keep those suggestions coming. It's the feedback from you guys that keeps me going on this project.

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

If it helps for motivation, My app would not exist without AS.

This topic is closed to new replies.

Advertisement