Advertisement

AngelScript 2.22.0 is released

Started by November 06, 2011 04:10 PM
5 comments, last by Friggle 13 years ago


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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

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
Advertisement
Did you know that usage of AngelScript has been scientifically proven to reduce your chances of heart failure? It's true.
Rantings, ravings, and occasional insight from your typical code-monkey: http://angryprogrammingprimate.blogspot.com/

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

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game


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:

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I may have modified mine a bit... wacko.gif
Rantings, ravings, and occasional insight from your typical code-monkey: http://angryprogrammingprimate.blogspot.com/
Advertisement
Many thanks!

Regards,
Thomas

This topic is closed to new replies.

Advertisement