Jump to content

[SOLVED] Using C++ classes in scripts


photo

Recommended Posts

Hi

 

I made a new class which I want to use inside a script.

I created a new dll with this new class included.

 

According the documentation a have to register the new class inside the main function.

The problem is that I can not compile the main application because it uses nVidia files which I do not have (using 3DSurround).

 

Can I register the class using functions inside the dll?

Link to comment

Try creating Unigine plug-in dll. Have a look into existing Unigine plug-ins (e.g <unigine-sdk>\source\plugins\Network) for an example. Script exposure code example can be found in e.g. NetworkInterpreter.h/.cpp

Link to comment

The problem is that it is a subclass of Player. I want to create a PlayerPilot class.

And the Node class need to be aware of it too (defining a PLAYER_PILOT in the enumeration list of the Node class).

 

Can this be done in a plug-in too?

Link to comment

The problem is that it is a subclass of Player. I want to create a PlayerPilot class.

And the Node class need to be aware of it too (defining a PLAYER_PILOT in the enumeration list of the Node class).

 

Can this be done in a plug-in too?

 

Don't think so, this will require modification of UNIGINE source code and rebuild of engine dll

Link to comment
  • 4 weeks later...

Yes, any modifications of the source code require rebuilding of the engine dll. Extending the enumeration list of the Node class is just the case. Good news is that all Apps, including 3DSurround, have became plugins. So now you can customize the main app as you like.

 

To load a plugin library, you just need to specify extern_plugin option on the start-up:

 

main_x86d -extern_plugin App3DSurround

Link to comment
×
×
  • Create New...