Jump to content

[SOLVED] How to handle externed variables when their plugin isn't loaded?


photo

Recommended Posts

We have a plugin which externs a variable from C++ which works fine however the plugin may not always be loaded in our case. We're trying to figure out how to handle this from within the Unigine script. We can test if the variable exists by putting it in some test code in an Expression and then calling isCompiled() before trying to access the variable. But even though we branch around the use of the variable Unigine still seems to process all paths of the branching and give a script error at runtime saying that the variable is undefined.

Link to comment

Hello there!

 

Sorry for the late reply. You can use get_extern_info function in order to get all extern classes/functions/variables. This function returns a single string containing all extern info so all you need to do is to search for your variable in that string and that's all.

 

Also, make sure you have proper binaries (build with USE_EXTERN_INFO define).

Link to comment
×
×
  • Create New...