Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_steamworks_footsteps_Step_0

(view raw script w/o annotations or w/e)
1
if (obj_pl.x != obj_pl.xprevious || obj_pl.y != obj_pl.yprevious)
2
{
3
    var footsteps_enabled = true
4
    if instance_exists(obj_steamworks_footsteps_collider)
5
    {
6
        footsteps_enabled = false
7
        with (obj_pl)
8
        {
9
            if place_meeting(x, y, obj_steamworks_footsteps_collider)
10
                footsteps_enabled = true
11
        }
12
    }
13
    if footsteps_enabled
14
    {
15
        if (!obj_pl.is_sprinting)
16
        {
17
            if (footstep_timer == 0)
18
            {
19
                audio_play_sound(choose(316, 317), 1, 0)
20
                footstep_timer = 11
21
            }
22
        }
23
        else if (footstep_timer == 0)
24
        {
25
            audio_play_sound(choose(316, 317), 1, 0)
26
            footstep_timer = 10
27
        }
28
        if (footstep_timer > 0)
29
            footstep_timer--
30
    }
31
}
32
else
33
    footstep_timer = 0
34
if instance_exists(obj_npc_parent)
35
{
36
    with (obj_npc_parent)
37
    {
38
        if (!(variable_instance_exists(id, "footstep_timer_npc")))
39
            footstep_timer_npc = 0
40
        footsteps_enabled = true
41
        if instance_exists(obj_steamworks_footsteps_collider)
42
        {
43
            footsteps_enabled = false
44
            if place_meeting(x, y, obj_steamworks_footsteps_collider)
45
                footsteps_enabled = true
46
        }
47
        if (object_index == obj_axis_npc)
48
            footsteps_enabled = false
49
        if (footsteps_enabled == true)
50
        {
51
            if (x != xprevious || y != yprevious)
52
            {
53
                if (footstep_timer_npc == 0)
54
                {
55
                    audio_play_sound(choose(316, 317), 1, 0)
56
                    footstep_timer_npc = 11
57
                }
58
                if (footstep_timer_npc > 0)
59
                    footstep_timer_npc--
60
            }
61
            else
62
                footstep_timer_npc = 0
63
        }
64
    }
65
}
66
if (global.party_member != noone && instance_exists(global.party_member))
67
{
68
    with (global.party_member)
69
    {
70
        footsteps_enabled = true
71
        if instance_exists(obj_steamworks_footsteps_collider)
72
        {
73
            footsteps_enabled = false
74
            if place_meeting(x, y, obj_steamworks_footsteps_collider)
75
                footsteps_enabled = true
76
        }
77
        if (!(variable_instance_exists(id, "footstep_timer_follower")))
78
            footstep_timer_follower = 0
79
        if (x != xprevious || y != yprevious)
80
        {
81
            if (footstep_timer_follower == 0)
82
            {
83
                audio_play_sound(choose(316, 317), 1, 0)
84
                footstep_timer_follower = 11
85
            }
86
            if (footstep_timer_follower > 0)
87
                footstep_timer_follower--
88
        }
89
        else
90
            footstep_timer_follower = 0
91
    }
92
}