Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_pl_Step_0

(view raw script w/o annotations or w/e)
1
var _temp_local_var_1, _temp_local_var_17, _temp_local_var_18;
2
if (autowalk_direction_no_loop == false)
3
{
4
    switch global.flag[28 Spoken to Dalv in his house]
5
    {
6
        case 1:
7
            switch room
8
            {
9
                case rm_dalvshouse:
10
                    switch global.lastroom
11
                    {
12
                        case "rm_dalvroomhall":
13
                            with (obj_dalv2)
14
                                instance_destroy()
15
                            autowalk_direction = "left"
16
                            state = gml_Script_scr_autowalk_state
17
                            alarm[1] = 30
alarm[1]

if (instance_exists(obj_postgame_walk_blocker) || instance_exists(obj_steam_walk_blocker) || instance_exists(obj_dunes_29_geno_blocker)) { autowalk_direction = "nothing" state = gml_Script_scr_normal_state return; } switch global.flag[28 Spoken to Dalv in his house] { case 1: if instance_exists(obj_dalv2) { if (obj_dalv2.dalv_talk_waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } if instance_exists(obj_doorway_blocker_dalvshouse) { if (obj_doorway_blocker_dalvshouse.waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } if instance_exists(obj_doorway_blocker_dalvsroom) { if (obj_doorway_blocker_dalvsroom.waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } switch room { case rm_dalvshouse: switch global.lastroom { case "rm_dalvroomhall": instance_create(335, 110, obj_dalv2) with (obj_dalv2) { image_alpha = 1 direction = 180 path_speed = 3 } autowalk_direction = "nothing" state = gml_Script_scr_frozen_state obj_dalv2.alarm[0] = 30 break case "rm_dalvhallway": autowalk_direction = "nothing" state = gml_Script_scr_normal_state break default: autowalk_direction = "nothing" } break case 39: switch global.lastroom { case "rm_dalvshouse": instance_create(-20, 140, obj_dalv2) with (obj_dalv2) { image_alpha = 1 direction = 0 path_speed = 3 } autowalk_direction = "nothing" state = gml_Script_scr_frozen_state obj_dalv2.alarm[0] = 30 break case "rm_dalvsroom": autowalk_direction = "nothing" state = gml_Script_scr_normal_state break } break case 41: if (autowalk_direction == "left") { clover_walk_backwards = false direction = 0 } else if (autowalk_direction == "right") direction = 90 autowalk_direction = "nothing" state = gml_Script_scr_normal_state break ...
18
                            break
19
                        default:
20
                            autowalk_direction = "nothing"
21
                    }
22
23
                    break
24
                case 39:
25
                    switch global.lastroom
26
                    {
27
                        case "rm_dalvshouse":
28
                            autowalk_direction = "right"
29
                            state = gml_Script_scr_autowalk_state
30
                            alarm[1] = 15
alarm[1]

if (instance_exists(obj_postgame_walk_blocker) || instance_exists(obj_steam_walk_blocker) || instance_exists(obj_dunes_29_geno_blocker)) { autowalk_direction = "nothing" state = gml_Script_scr_normal_state return; } switch global.flag[28 Spoken to Dalv in his house] { case 1: if instance_exists(obj_dalv2) { if (obj_dalv2.dalv_talk_waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } if instance_exists(obj_doorway_blocker_dalvshouse) { if (obj_doorway_blocker_dalvshouse.waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } if instance_exists(obj_doorway_blocker_dalvsroom) { if (obj_doorway_blocker_dalvsroom.waiter > 0) { clover_walk_backwards = false autowalk_direction = "nothing" state = gml_Script_scr_frozen_state direction = 90 return; } } switch room { case rm_dalvshouse: switch global.lastroom { case "rm_dalvroomhall": instance_create(335, 110, obj_dalv2) with (obj_dalv2) { image_alpha = 1 direction = 180 path_speed = 3 } autowalk_direction = "nothing" state = gml_Script_scr_frozen_state obj_dalv2.alarm[0] = 30 break case "rm_dalvhallway": autowalk_direction = "nothing" state = gml_Script_scr_normal_state break default: autowalk_direction = "nothing" } break case 39: switch global.lastroom { case "rm_dalvshouse": instance_create(-20, 140, obj_dalv2) with (obj_dalv2) { image_alpha = 1 direction = 0 path_speed = 3 } autowalk_direction = "nothing" state = gml_Script_scr_frozen_state obj_dalv2.alarm[0] = 30 break case "rm_dalvsroom": autowalk_direction = "nothing" state = gml_Script_scr_normal_state break } break case 41: if (autowalk_direction == "left") { clover_walk_backwards = false direction = 0 } else if (autowalk_direction == "right") direction = 90 autowalk_direction = "nothing" state = gml_Script_scr_normal_state break ...
31
                            break
32
                        default:
33
                            autowalk_direction = "nothing"
34
                    }
35
36
                    break
37
                case 36:
38
                    var _temp_local_var_17 = global.lastroom
39
                    autowalk_direction = "nothing"
40
                    break
41
                case 40:
42
                    var _temp_local_var_18 = global.lastroom
43
                    autowalk_direction = "nothing"
44
                    break
45
                default:
46
                    autowalk_direction = "nothing"
47
            }
48
49
            break
50
        default:
51
            autowalk_direction = "nothing"
52
    }
53
54
    autowalk_direction_no_loop = true
55
    get_last_room_no_loop = false
56
}
57
depth = (-y)
58
script_execute(state)
59
if (global.cutscene == true && is_sprinting == true)
60
    is_sprinting = false
61
if (clover_walk_backwards == true)
62
{
63
    if ((autowalk_direction == "right" && direction == 0) || (autowalk_direction == "up" && direction == 90) || (autowalk_direction == "left" && direction == 180) || (autowalk_direction == "down" && direction == 270))
64
        direction += 180
65
}
66
scr_determine_player_sprites
scr_determine_player_sprites

function scr_determine_player_sprites() //gml_Script_scr_determine_player_sprites { if (global.route != 3) { usprite_walk = spr_pl_up dsprite_walk = spr_pl_down lsprite_walk = spr_pl_left rsprite_walk = spr_pl_right usprite_run = spr_pl_run_up dsprite_run = spr_pl_run_down lsprite_run = spr_pl_run_left rsprite_run = spr_pl_run_right } else { usprite_walk = spr_pl_up dsprite_walk = spr_pl_down_geno lsprite_walk = spr_pl_left_geno rsprite_walk = spr_pl_right_geno usprite_run = spr_pl_run_up_geno dsprite_run = spr_pl_run_down_geno lsprite_run = spr_pl_run_left_geno rsprite_run = spr_pl_run_right_geno } switch global.player_sprites { case "kanako": usprite_walk = spr_kanako_up_walk dsprite_walk = spr_kanako_down_walk lsprite_walk = spr_kanako_left_walk rsprite_walk = spr_kanako_right_walk usprite_run = spr_kanako_up_walk dsprite_run = spr_kanako_down_walk lsprite_run = spr_kanako_left_walk rsprite_run = spr_kanako_right_walk break case "normal": shader_on = false palette_index = 0 break case "snowdin": shader_on = true palette_index = 0 break case "dunescave": shader_on = true palette_index = 1 break case "steamworkslava": shader_on = true palette_index = 2 break case "water": if (room == rm_dunes_01) { shader_on = true palette_index = 1 } if (global.route != 3) { usprite_walk = 54 dsprite_walk = 55 lsprite_walk = 52 rsprite_walk = 53 usprite_run = spr_pl_run_up_water dsprite_run = spr_pl_run_down_water lsprite_run = spr_pl_run_left_water rsprite_run = spr_pl_run_right_water } else { usprite_walk = 54 dsprite_walk = 1571 lsprite_walk = 2594 rsprite_walk = 3094 usprite_run = spr_pl_run_up_water_geno dsprite_run = spr_pl_run_down_water_geno lsprite_run = spr_pl_run_left_water_geno rsprite_run = spr_pl_run_right_water_geno } break } usprite = usprite_walk dsprite = dsprite_walk lsprite = lsprite_walk rsprite = rsprite_walk if (is_sprinting == true) { usprite = usprite_run dsprite = dsprite_run lsprite = lsprite_run rsprite = rsprite_run } if (palette_index != 0) shader_on = true }
()
67
if DEBUG_DANCE
68
{
69
    image_speed = 1
70
    sprite_index = spr_pl_dance
71
    return;
72
}
73
switch direction
74
{
75
    case 0:
76
        sprite_index = rsprite
77
        break
78
    case 90:
79
        sprite_index = usprite
80
        break
81
    case 180:
82
        sprite_index = lsprite
83
        break
84
    case 270:
85
        sprite_index = dsprite
86
        break
87
}
88
89
if (sliding == true)
90
    image_index = 1
91
if (room == rm_dalvhallway)
92
{
93
    if (player_mode == "DalvExit")
94
    {
95
        image_alpha = 0
96
        if (!instance_exists(obj_pl_follow))
97
            instance_create(x, y, obj_pl_follow)
98
    }
99
    if (player_mode == "Normal")
100
    {
101
        if (room != rm_darkruins_01)
102
            image_alpha = 1
103
    }
104
}