Jump to content
  • Advertisement
Sign in to follow this  
SiddharthBhat

Multiple Definiton in Angelscript

This topic is 2070 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!