Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


- - - - -

Wanted: UnregisterObjectType


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 nonpop   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 March 2004 - 01:47 AM

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).

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3416

Like
Likes
Like

Posted 12 March 2004 - 06:12 AM

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]

#3 nonpop   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 March 2004 - 07:39 AM

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]

#4 Andreas Jonsson   Moderators   -  Reputation: 3416

Like
Likes
Like

Posted 12 March 2004 - 02:07 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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS