script_execute_ext

This function works similarly to the function script_execute() only you can supply an array that contains the arguments required for the function/script being called. You may also supply two optional arguments to the function to specify an offset into the array to get the arguments from, as well as the number of arguments to use from the array (this must be a maximum of array_length - offset). 

 

Syntax:

script_execute(scr, array_args, [offset], [num_args]);

Argument Description
scr The name of the function/script that you want to call
array_args The array containing the arguments for the function/script
[offset] OPTIONAL! The offset into the argument array
[num_args] OPTIONAL! The number of arguments to (from the offset onwards)

 

Returns:

Will depend on the return value from the function/script being called

 

Example:

script_execute_ext(move_inst, move_array, floor(random(4)), 1);

The above example code will use script_execute_ext to call the given function, supplying an array of four arguments, but only using one of them at random.