aimodel.getFunctionScript
Get a handle to the script of a function.
Prototype
hResource = aimodel.getFunctionScript ( hAIModel, sName|nIndex )
Description
Get a handle to the script of a function, either by name or by index. Useful to extract further information, like function arguments.
Parameters
hAIModel - valid AIModel handle
sName|nIndex - function name (string) or index 1..nFunctionCount
Return values
hResource - handle to the script
Sample
for iIndex = 1, nFunctionsCount do local hItem = tItems[ iIndex ] if ( hItem ) then local sFunctionName = tSortedFunctions[ iIndex ] local hFunctionScript = aimodel.getFunctionScript ( hResource, sFunctionName ) local tFunctionArguments = hFunctionScript and script.findFunctionArguments ( hFunctionScript ) or { } -- etc.
Available since ShiVa 2.0