Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_returnwait_instance

(view raw script w/o annotations or w/e)
1
function 
scr_returnwait_instance
scr_returnwait_instance

function
scr_returnwait_instance(arg0, arg1, arg2)
{ if (!instance_exists(arg0)) { debug_print("Argument 1 does not exist"); return 1; } if (!instance_exists(arg1)) { debug_print("Argument 2 does not exist"); return 1; } var dist = max(1, round(point_distance(arg0.x, arg0.y, arg1.x, arg1.y) / arg2)); return dist; }
(arg0, arg1, arg2)
2
{
3
    if (!instance_exists(arg0))
4
    {
5
        debug_print("Argument 1 does not exist");
6
        return 1;
7
    }
8
    if (!instance_exists(arg1))
9
    {
10
        debug_print("Argument 2 does not exist");
11
        return 1;
12
    }
13
    var dist = max(1, round(point_distance(arg0.x, arg0.y, arg1.x, arg1.y) / arg2));
14
    return dist;
15
}