Jump to content
  • Advertisement
Sign in to follow this  
3DModelerMan

Access scripted components in entity system

This topic is 2544 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

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?

Share this post


Link to post
Share on other sites
Advertisement
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. ;)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!