Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_cutscene_npc_walk_relative

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