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

Script classes inheriting from application class

Started by
1 comment, last by WitchLord 4 years, 2 months ago

I was reading a couple of older threads from 2008, 2010 and wanted to verify that script classes cannot inherit from application defined non-abstract base classes. The question of “why” also came up. I'd like to allow script developers the flexibility to extend/specialize base classes that are implemented in the application interface. I also read some references to registering an interface with AS, but as far as I could tell this would not allow inheritance of base class functionality. Please comment.

Advertisement

It's not possible to directly inherit from application registered classes. The reason being that script classes simply doesn't work exactly like C++ classes.

However, with a little bit of glue code you make it work as if an inheritance happens. The manual has an article that shows how this works:

http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_inheritappclass.html

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