Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_cutscene_npc_walk

(view raw script w/o annotations or w/e)
1
function cutscene_npc_walk() //gml_Script_cutscene_npc_walk
2
{
3
    if (!instance_exists(argument[0]))
4
        return;
5
    with (argument[0])
6
    {
7
        can_walk = true
8
        if (x_dest[0] != argument[1] || y_dest[0] != argument[2])
9
        {
10
            x_dest = 0
11
            y_dest = 0
12
            x_dest[0] = argument[1]
13
            y_dest[0] = argument[2]
14
            axis_override = argument[4]
15
            end_direction = argument[5]
16
            if (argument_count > 6)
17
                walk_collider = argument[6]
18
            if (argument_count > 7)
19
                x_dest[1] = argument[7]
20
            if (argument_count > 8)
21
                y_dest[1] = argument[8]
22
            if (argument_count > 9)
23
                x_dest[2] = argument[9]
24
            if (argument_count > 10)
25
                y_dest[2] = argument[10]
26
            if (x != x_dest[(array_length_1d(x_dest) - 1)] || y != y_dest[(array_length_1d(y_dest) - 1)])
27
                npc_arrived = false
28
        }
29
        actor_speed = argument[3]
30
        if (npc_arrived == true)
31
        {
32
            can_walk = false
33
            npc_arrived = false
34
            with (other)
35
                cutscene_advance()
36
            return true;
37
        }
38
    }
39
    return false;
40
}