Access scripted components in entity system
I have a component based entity system that I'm working on adding script support to. I have methods for components to access other components in C++. The game object has a getComponent method that takes the type of component that is being searched for, and returns the component of that type. I want to be able to have scripts support that as well. I know I can just register the C++ component types; but how would I make it so that script classes can access other script component types?
Here's a few links to articles and add-ons that I think can help you figure out how to do what you want:
- generic handle add-on (ref) - this can be used to hold any reference type, which can then be cast to the desired type
- generic container add-on (any) - can hold any type, both reference types and value types
- interfaces - interfaces are useful for passing objects between scripts without having to know the underlying implementation
- shared script code - shared script code allow classes to be used across different script modules
- type conversions in script - the syntax for casting reference types
Let me know if this helps or if you need something more specific, in which case I will need a more specific question too. ;)
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