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

Set up class members from c++

Started by
2 comments, last by _Engine_ 6 years ago

Hi!

Currently I am trying to implement script system similar to Unity.

So script will be looks like this:


class NewInst : Interface 
{
  SomeCPPObjectRef@ ref;
  void Update()
  {
    //do some stuff
    ...
  }
}

And I need to create instance of class NewInst and set up class member. Of course both actions must be done from c++ side.

I looked into documentation and looks AngelSAcript is not suitable (((  

Maybe I am wrong and this can be realized but question how it can be done?

Advertisement

I'm not familiar with how Unity works so I'm not entirely sure what you're trying to accomplish, but in AngelScript you can create instances of script classes from C++ side and initialize the members manually if you wish.

You can use the engine->CreateUninitializedScriptObject then enumerate the members and set their values.

The serializer add-on can potentially be used to help understand how to do this.

 

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

18 hours ago, WitchLord said:

I'm not familiar with how Unity works so I'm not entirely sure what you're trying to accomplish, but in AngelScript you can create instances of script classes from C++ side and initialize the members manually if you wish.

You can use the engine->CreateUninitializedScriptObject then enumerate the members and set their values.

The serializer add-on can potentially be used to help understand how to do this.

 

Code from serializer add-on is helped. Thank you :)

This topic is closed to new replies.

Advertisement