To use a global function, open up the main script header (the "Edit script header" option on the Game menu), and add a line similar to the following:
import function my_function_name (parameters);Where my_function_name is the name of the global script function, and parameters is a list of the TYPES ONLY of the parameters it takes. For example, if you had in your global script:
function do_animation (int anim_number) {then you would write:
import function do_animation (int);To use the function, you just call it normally in your script, eg:
do_animation (3);You can also return a value to the caller by using the "return" statement, and the local script picks this up the same way it does with built-in functions. For example, the end of your global script function could be:
return 51;then the local script just does:
int value = do_animation(3);
Browser Based Help. Published by chm2web software. |