Jump to content
  • Advertisement
Sign in to follow this  
WitchLord

AngelScript 2.22.0 is released

This topic is 2475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



This version brings a long list of smaller enhancements, including:
  • User data in asIObjectType and asIScriptModule, that can be used for holding function pointer caches
  • The asIScriptContext::Prepare method can now take the asIScriptFunction pointer rather than the function id
  • Added functions to make it slightly easier to get the asIScriptFunction pointers
  • Application can now define the modules' access to individual registered entities through bitmasks, rather than on the configuration group level
  • Added methods to the asIObjectType interface to make it easier to determine relationship between types
  • AddRefScriptObject and ReleaseScriptObject can now take a pointer to the asIObjectType instead of the type id
  • Made improvements to the interface to aid JIT compilation
  • Implemented shared script classes, i.e. classes can now be declared as 'shared' which will allow multiple modules to share the same implementation thus simplifying how objects can be passed between modules

    Most of the changes are just incremental improvements, the real exciting new feature is the shared script classes.

    Previously it was a bit complicated to have two or more modules communicate with each other, due to the inability to share types. The modules could only use the types that had already been registered by the application when passing data back and forth. Now, with the shared classes, the modules can implement common classes with data and methods to simplify this. Shared classes is just the beginning, I plan to expand this feature to global functions and properties too.

    Regards,
    Andreas

Share this post


Link to post
Share on other sites
Advertisement
Hi,

just downloaded the new engine and found that the exact way of replacement of asIScriptEngine::SetConfigGroupModuleAccess by the new methods asIScriptEngine::SetDefaultAccessMask and asIScriptModule::SetAccessMask is not yet documented anywhere.

Could you elaborate a little bit on the use of these functions, please?

My situation:
Currently my code uses asIScriptEngine::SetConfigGroupModuleAccess to deny access to all registered script functions by default. Later on I enable a certain config group for a certain script module.

How can I achive the same with the new interfaces? Where do I get the correct masks from?

Many thanks!
Thomas

Share this post


Link to post
Share on other sites
Did you know that usage of AngelScript has been scientifically proven to reduce your chances of heart failure? It's true.

Share this post


Link to post
Share on other sites

Hi,

just downloaded the new engine and found that the exact way of replacement of asIScriptEngine::SetConfigGroupModuleAccess by the new methods asIScriptEngine::SetDefaultAccessMask and asIScriptModule::SetAccessMask is not yet documented anywhere.

Could you elaborate a little bit on the use of these functions, please?

My situation:
Currently my code uses asIScriptEngine::SetConfigGroupModuleAccess to deny access to all registered script functions by default. Later on I enable a certain config group for a certain script module.

How can I achive the same with the new interfaces? Where do I get the correct masks from?

Many thanks!
Thomas




I wrote an article in the manual for how to use the new access masks. You'll find it in the SDK (sorry, I haven't been able to upload the new version of the manual to the site yet). It's located under the following topic:

AngelScript -> Manual -> Using AngelScript -> Advanced topics -> Access masks and exposing different interfaces.

You can see the doxygen source in the SVN.




The access masks are more versatile than the config groups were. Basically the new access masks are bit masks. You set the bit mask when registering the interface to create the different profiles you need, e.g. you could say that bit 1 is for functions that are available to game entity scripts, and bit 2 is for functions that are available to gui scripts. This is set by calling SetDefaultAccessMask before registering the function, type, method, etc.

Then when you compile the module you call the module's SetAccessMask to determine which bits it should have access to. The module's access mask will be bitwise and:ed with the registered function's access mask, and if different from 0 the module sees the function and can call it.

The access mask can be set differently for individual functions, global properties, types, type methods, behaviours, and type properties.



Regards,
Andreas

Share this post


Link to post
Share on other sites

Did you know that usage of AngelScript has been scientifically proven to reduce your chances of heart failure? It's true.



OMG, did someone use AngelScript to control a pacemaker? :blink:

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!