Skip to main content
GameDev.net gamedev.net
🔒 Locked

Wanted: UnregisterObjectType

Started by nonpop Mar 12, 2004 at 7:47 AM 2 replies 1.8k views
Original Post
nonpop
nonpop
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).
WitchLord
WitchLord
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]
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
nonpop
nonpop
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:

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]
WitchLord
WitchLord
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
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.