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(snd_footstep1, snd_footstep2), 1, 0); |
20 |
footstep_timer = 11; |
21 |
} |
22 |
} |
23 |
else if (footstep_timer == 0) |
24 |
{ |
25 |
audio_play_sound(choose(snd_footstep1, snd_footstep2), 1, 0); |
26 |
footstep_timer = 10; |
27 |
} |
28 |
if (footstep_timer > 0) |
29 |
footstep_timer--; |
30 |
} |
31 |
} |
32 |
else |
33 |
{ |
34 |
footstep_timer = 0; |
35 |
} |
36 |
if (instance_exists(obj_npc_parent)) |
37 |
{ |
38 |
with (obj_npc_parent) |
39 |
{ |
40 |
if (!variable_instance_exists(id, "footstep_timer_npc")) |
41 |
footstep_timer_npc = 0; |
42 |
var footsteps_enabled = true; |
43 |
if (instance_exists(obj_steamworks_footsteps_collider)) |
44 |
{ |
45 |
footsteps_enabled = false; |
46 |
if (place_meeting(x, y, obj_steamworks_footsteps_collider)) |
47 |
footsteps_enabled = true; |
48 |
} |
49 |
if (object_index == obj_axis_npc) |
50 |
footsteps_enabled = false; |
51 |
if (footsteps_enabled == true) |
52 |
{ |
53 |
if (x != xprevious || y != yprevious) |
54 |
{ |
55 |
if (footstep_timer_npc == 0) |
56 |
{ |
57 |
audio_play_sound(choose(snd_footstep1, snd_footstep2), 1, 0); |
58 |
footstep_timer_npc = 11; |
59 |
} |
60 |
if (footstep_timer_npc > 0) |
61 |
footstep_timer_npc--; |
62 |
} |
63 |
else |
64 |
{ |
65 |
footstep_timer_npc = 0; |
66 |
} |
67 |
} |
68 |
} |
69 |
} |
70 |
if (global.party_member != -4 && instance_exists(global.party_member)) |
71 |
{ |
72 |
with (global.party_member) |
73 |
{ |
74 |
var footsteps_enabled = true; |
75 |
if (instance_exists(obj_steamworks_footsteps_collider)) |
76 |
{ |
77 |
footsteps_enabled = false; |
78 |
if (place_meeting(x, y, obj_steamworks_footsteps_collider)) |
79 |
footsteps_enabled = true; |
80 |
} |
81 |
if (!variable_instance_exists(id, "footstep_timer_follower")) |
82 |
footstep_timer_follower = 0; |
83 |
if (x != xprevious || y != yprevious) |
84 |
{ |
85 |
if (footstep_timer_follower == 0) |
86 |
{ |
87 |
audio_play_sound(choose(snd_footstep1, snd_footstep2), 1, 0); |
88 |
footstep_timer_follower = 11; |
89 |
} |
90 |
if (footstep_timer_follower > 0) |
91 |
footstep_timer_follower--; |
92 |
} |
93 |
else |
94 |
{ |
95 |
footstep_timer_follower = 0; |
96 |
} |
97 |
} |
98 |
} |