Advertisement

Getting the script context in a (generic) function call

Started by February 23, 2025 06:52 AM
1 comment, last by WitchLord 1 day, 20 hours ago

Is there a way to get the asIScriptContext while handling a generic function call?

The asIScriptGeneric argument only gives me access to the asIScriptEngine. However, I want to get to the user data of the script context in which the function is executed.

Currently the only way that I see to achieve this, is to set a thread local variable before I call into AS.

The global function asGetActiveContext will give you the context that is calling the application function. It works in multithreaded environments as well.

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