🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AngelScript 2.1.0 WIP 3 (2005/02/13)

Started by
3 comments, last by WitchLord 19 years, 4 months ago
The first WIP of 2.1.0 is now available. The following changes were made:
  • Implemented a C wrapper for the library. Compile the library with AS_C_INTERFACE to use it.
  • Added a dummy array in asUPtr to make the size equal on all compilers (even when the C++ interface is disabled)
  • Added SetLineCallback()/ClearLineCallback() to the context interface. These should be used instead of ExecuteStep() to control how much is executed each frame.
  • Added SetExceptionCallback()/ClearExceptionCallback() to the context interface. These methods can be used for debugging purposes and allow the application to examine the callstack when an exception is raised.
  • Added GetCallstackSize() and GetCallstackFunction() to the context interface.
  • Added the possibility to turn off support for registering class methods. Compile the library with AS_NO_CLASS_METHODS. This can be used on compilers where class methods don't currently work.
  • Added GetFunctionSection() to the engine interface.
  • ExecuteStep() is now a deprecated method. Use the line callback method instead, which is much more flexible.
  • Added GetCallstackLineNumber() to the context interface.
This means that you now have more resources for debugging the scripts. Callback functions can be registered to track the progress through the scripts, or to examine the callstack when an exception occurs. The ExecuteStep() method has become deprecated, and the line callback function should be used instead. This will give you a lot more flexibility in the way the execution is controlled, you can for example set a time out for the execution, or let the execution run until the next statement in the top level function, allowing function calls to complete before suspending the execution. I've also added a flat C interface to the library (compile with AS_C_INTERFACE) so that languages such as ANSI C, PASCAL, or D, can use the library as well. It is now possible to disable support for method pointers, which can make the library workable on C++ compilers whose method pointers aren't supported yet, e.g. Borland C++ Builder. Compile the library with AS_NO_CLASS_METHODS to do that. Before the final release of 2.1.0 I will also add a new generic calling convention, which will make the library even more portable for systems whose calling conventions aren't known or prepared yet, e.g. the PS2 and GC. Also with the differences from compiler to compiler in calling conventions this will prove very useful. Regards, Andreas [Edited by - WitchLord on February 13, 2005 11:50:10 AM]

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

Advertisement
Great stuff.

one thing that would be great is if you created a tiny little help app that can generate all the stubs needed for registering your own classes and hooking into functions from the AS scripts.

I know there are few simple apps for this but it would be excellent to have a good tested app from the application writer so we know that this app will generate exactly the code needed and will follow the versions of the Angelscript.

Yes, that would obviously be a great help. Though I don't think I will have the time to do that.

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

Just uploaded WIP 2 with the following changes:


  • Bug fixes

    • The line numbers reported by the VM were incorrect.
    • GetGlobalVarPointer() was returning a pointer to a pointer for registered object types. (Thanks Rain Dog)

  • Library interface

    • All methods that return line numbers can now optionally return column number as well.
    • Added the asCALL_GENERIC flag for functions using the generic calling convention.
    • Added GetObject() to the context interface, that will return the object pointer when a method function using the generic calling convention is called.
    • Added GetArgDWord(), GetArgQWord(), GetArgFloat(), GetArgDouble(), and GetArgObject() to the context interface.
    • Added SetReturnDWord(), SetReturnQWord(), SetReturnFloat(), SetReturnDouble(), and SetReturnObject() to the context interface.

  • Script language

    • The script language now allows statements like: func(expr), where the function don't take any arguments and
      the expression evaluates to a void type. This is especially useful when dynamically generating scripts where
      the expression type isn't known before hand.



I'll add the bug fixes to version 2.0.0 as well, when I get the time.

You can check out how the generic calling convention works by looking at the unit test in test_feature/test_generic.cpp.

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

WIP 3 is here with the following changes:


  • Bug fixes

    • Fixed a possible crash when calling AddScriptSection() with 0 for section name.

  • Library interface

    • Added a new asIScriptGeneric interface for handling generic functions.
    • Moved the GetObject(), GetArgXXX(), and SetReturnXXX() functions to the asIScriptGeneric interface.
    • The function signature for the generic functions now takes a pointer to asIScriptGeneric instead of asIScriptContext.
    • The generic calling convention is now supported for behaviour functions as well.
    • Added two new behaviours asBEHAVE_ALLOC and asBEHAVE_FREE, that can be used to register custom memory allocation functions for an object type.

  • Project

    • Added as_generic.cpp and as_generic.h with the interface for generic functions.


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

This topic is closed to new replies.

Advertisement