Advertisement

Multiple Definiton in Angelscript

Started by February 19, 2013 04:44 AM
1 comment, last by SiddharthBhat 11 years, 9 months ago

Hi all!

I'm finding it more and more annoying that on binding the same function twice to angelscript, it just dosen't give you a sensible warning. Angelscript doesn't warn you when you register then function the 2nd time, but rather tells you that there are "multiple matching signatures" to the function. I just spent a whole day looking for an alternate signature, after which I realized I was binding the function twice.

is there some sort of flag that we can send to AS_Engine that notifies us on registering a function twice? (Sure, there will be some overhead in checking this, maybe O(n) if we do a linear search, or O(1) if we decide to hash the string. That's why we could have a flag that lets us control this). Or is there some other way to figure out if a function (or a class) is being bound twice? (BTW, binding a class twice gives some weird errors. Angrlscript starts complaining about the destructor of the class that the behavior I'm trying to register is invalid. It also doesn't let you instantiate the class properly. I guess this maybe the accepted behavior? )

but it would be really nice to have some sort of a feature like this. Heck, I'd be happy to implement it if you told me where to modify the code.

/rant

Thanks.

~Bollu.

PS- English isn't my first language, so do correct me if I've made some sort of mistake :)

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)

Hmm. The engine is supposed to check against registering duplicate functions, methods, and types. The registration function should return an error (you do check the return codes, don't you?), and if you ignore that error and try to compile a script anyway you'll get an "Invalid configuration" error.

Can you give examples? Perhaps there is some bug that makes the code not see the duplicates.

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

Advertisement

I am checking most of them, but this one might have slipped past. lemme go and check my code :)

a WIP 2d game engine: https://code.google.com/p/modulusengine/

English is not my first language, so do feel free to correct me :)

This topic is closed to new replies.

Advertisement