Runs the specified LUA script from the specified function. Values returned from the script can be stored.

int DXScript::runScriptFunction(std::string _filePath, std::string _functionName, int _argc, float * _argv, int _expectedResults, double * _resultStorage)


Type Name Description
std::string _filePath Path to the script file, without the file extension.
std::string _functionName Name of the function to be executed.
int _argc The number of arguments to pass to the function.
float* _argv Pointer to a list of arguments to pass to the script.
int _expectedResults The number of results expected to be returned from the script.
double* _resultStorage Storage space used for return values. This data is initialised in this function.


Zero for success, nonzero for failure. For more detail of a failure, this function returns a member of the eScriptReturns enumeration.


DXScript *dxscr = new DXScript();
dxscr->runScriptFunction("scripts/callToMainByFunc", "main", 0);