Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:AngelScript

From ReverseEngineering.wiki
Library
Developer Andreas Jonsson
License zlib
Website https://www.angelcode.com/angelscript/
On this wiki Facts · Code · Notes · Topics

AngelScript is Andreas Jonsson's statically typed C++-like scripting library (zlib license) embedded in game engines and mods; modules are compiled at run time and can be saved with SaveByteCode.

Identification

  • Version string from asGetLibraryVersion(): 2.38.0 (ANGELSCRIPT_VERSION 23800 = 0x5CF8, i.e. major10000+minor100+patch); debug builds append DEBUG. asGetLibraryOptions() returns build options such as AS_MAX_PORTABILITY, AS_NO_COMPILER.
  • Exports (AS_API, 25 functions in angelscript.h): asCreateScriptEngine (takes the header version as argument, so the immediate pushed to it is the header version the embedder compiled against), asGetLibraryVersion, asGetLibraryOptions, asGetActiveContext, asPrepareMultithread, asUnprepareMultithread, asGetThreadManager, asAcquireExclusiveLock, asSetGlobalMemoryFunctions, asAllocMem, asFreeMem, asCreateLockableSharedBool. Everything else is reached through interfaces (asIScriptEngine, asIScriptModule, asIScriptContext) by vtable; RTTI names such as asCScriptEngine, asCModule, asCContext identify the implementation classes.
  • With AS_NO_COMPILER the game ships no compiler and only loads bytecode (Format:AngelScript bytecode); otherwise the source (.as) is compiled at start-up and the game contains the script text.
  • The application registers its API with declaration strings (RegisterGlobalFunction, RegisterObjectType, RegisterObjectMethod) such as void Print(const string &in). Those strings sit in the game's data and list its whole script API: search for &in, &out, const string.

Code & repositories

  • https://github.com/codecat/angelscript-mirror @ c81df254037524b18cd41a57805cfec76acd05bf · license: Zlib (declared by the contributor; GitHub's detector did not recognize a license file)
    Mirror of the AngelScript SDK (zlib). Useful without running: sdk/angelscript/source/as_restore.cpp (bytecode writer/reader), include/angelscript.h (API, asBC_ opcode table), as_scriptengine.cpp (version/options strings).
    Tested on: source read, not run: source read, not run · checked 2026-10-18; archived; last activity 2025-08-14

Pitfalls

  • Add-ons scriptstdstring, scriptarray, scriptdictionary register string, array<T>, dictionary.
  • Saved bytecode is only valid for the same registered interface: types and functions are resolved by name and signature at load time.

See also

Library:Squirrel, Library:Lua.