Archive 17/01/2023.

Return Value From Script Method

Bluemoon

Is there any possible way to retrieve the return value of an AngelScript method called through ScriptInstance::Execute() ?

( I kind of feel like someone might have asked this question before, if that is the case then a link to the post would be much appreciated )

cadaver

It should work by getting the AngelScript execution context from Script subsystem by calling Script::GetScriptFileContext() directly after the Execute call, then using the asIScriptContext’s functions: GetReturnByte(), GetReturnWord() etc. (you need to know the function’s return type)