user-defined functions are just called Scripts in GML. Just as a simple example if you wanted to create a simple addition script that adds 2 arguments together you would:
Create a script resource and name it something like "scr_add"
open the script resource you created and then put something like:
(in GMStudio 1.x)
(in GMStudio 2.x)
Then you can call it from an object
Create a script resource and name it something like "scr_add"
open the script resource you created and then put something like:
(in GMStudio 1.x)
Code:
///scr_add(first value, second value)
return argument0 + argument1;
(in GMStudio 2.x)
Code:
///@function scr_add(first value, second value)
///@arg first value
///@arg second value
return argument0 + argument1;
Then you can call it from an object