Wanted: UnregisterObjectType
So, in contrast to RegisterObjectType I would need an UnregisterObjectType or at least UnregisterGlobalProperty as the actual objects containing the methods'' code might be loaded and unloaded at run-time (they may reside in DLL files).
Would it be ok for you to create another instance of the engine instead? Unregister doesn't really make sense at this time because you would have to recompile the scripts anyway. If the engine configuration changes it is better to create another one.
In the future when the engine allows modification of compiled scripts, an unregister method could be considered.
www.AngelCode.com - game development and more...
AngelScript - free scripting library
[edited by - WitchLord on March 12, 2004 1:13:11 PM]
In the future when the engine allows modification of compiled scripts, an unregister method could be considered.
www.AngelCode.com - game development and more...
AngelScript - free scripting library
[edited by - WitchLord on March 12, 2004 1:13:11 PM]
Hmm... but then I'd have to somehow register the other types to the new instance. How about a possibility to enumerate the registered types and get them as some type objects which could then be used to register the types to the new instance... like this:
Well, that would not be very elegant a solution. Maybe I'll just do some redesign
EDIT: Fixed typo..
[edited by - nonpop on March 12, 2004 2:39:49 PM]
TypeObject typo;//for each type except the one not wanted anymore:oldengine->GetNextType (&typo, ...);newengine->RegisterType (&typo);
Well, that would not be very elegant a solution. Maybe I'll just do some redesign
EDIT: Fixed typo..
[edited by - nonpop on March 12, 2004 2:39:49 PM]
What I do is to have one function that does all the registration. In your case you could make this function check what dlls are loaded and register only the types and functions available for those dlls. That way when you unload a dll, or load a new one you simple create a new engine and then call this same function.
I''m trying to keep AngelScript as simple and light weight as possible. Anything that can be put outside of the AngelScript library will be outside. I''m even working to remove built in support for the bstr type, instead I will release the code for registering all the necessary system functions to have it work as before.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
I''m trying to keep AngelScript as simple and light weight as possible. Anything that can be put outside of the AngelScript library will be outside. I''m even working to remove built in support for the bstr type, instead I will release the code for registering all the necessary system functions to have it work as before.
__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement