Undertale script viewer

← back to main script listing

gml_Object_obj_mainchara_Create_0

(view raw script w/o annotations or w/e)
1
scr_depth
scr_depth

depth = 50000 - ((y * 10) + (sprite_height * 10));
(0, 0, 0, 0, 0);
2
if (global.flag[7 true_pacifist] == 1)
3
{
4
    if (global.flag[287 sms_parameters] <= global.flag[286 conversation_toriel_sms])
5
        global.flag[287 sms_parameters] = global.flag[286 conversation_toriel_sms] + 1;
6
}
7
if (global.flag[6 hardmode] == 1 && !scr_hardmodename
scr_hardmodename

return string_lower(argument0) == "frisk" || string_to_hiragana(argument0) == "ふりすく";
(global.charname))
8
    global.flag[6 hardmode] = 0;
9
global.flag[462 called_already] = 0;
10
if ((x % 3) == 2)
11
    x += 1;
12
if ((x % 3) == 1)
13
    x -= 1;
14
if ((y % 3) == 2)
15
    y += 1;
16
if ((y % 3) == 1)
17
    y -= 1;
18
lastfacing = 0;
19
nnn = 0;
20
cutscene = 0;
21
oldx = x;
22
oldy = y;
23
image_speed = 0;
24
global.phasing = 0;
25
facing = global.facing;
26
moving = 0;
27
movement = 1;
28
global.currentroom = room;
29
if (global.interact == 3)
30
{
31
    if (global.entrance > 0)
32
    {
33
        global.interact = 0;
34
        if (global.entrance == 1)
35
        {
36
            x = obj_markerA.x;
37
            y = obj_markerA.y;
38
        }
39
        if (global.entrance == 2)
40
        {
41
            x = obj_markerB.x;
42
            y = obj_markerB.y;
43
        }
44
        if (global.entrance == 4)
45
        {
46
            x = obj_markerC.x;
47
            y = obj_markerC.y;
48
        }
49
        if (global.entrance == 5)
50
        {
51
            x = obj_markerD.x;
52
            y = obj_markerD.y;
53
        }
54
        if (global.entrance == 18)
55
        {
56
            x = obj_markerr.x;
57
            y = obj_markerr.y;
58
        }
59
        if (global.entrance == 19)
60
        {
61
            x = obj_markers.x;
62
            y = obj_markers.y;
63
        }
64
        if (global.entrance == 20)
65
        {
66
            x = obj_markert.x;
67
            y = obj_markert.y;
68
        }
69
        if (global.entrance == 21)
70
        {
71
            x = obj_markeru.x;
72
            y = obj_markeru.y;
73
        }
74
        if (global.entrance == 22)
75
        {
76
            x = obj_markerv.x;
77
            y = obj_markerv.y;
78
        }
79
        if (global.entrance == 23)
80
        {
81
            x = obj_markerw.x;
82
            y = obj_markerw.y;
83
        }
84
        if (global.entrance == 24)
85
        {
86
            x = obj_markerX.x;
87
            y = obj_markerX.y;
88
        }
89
    }
90
}
91
dsprite = spr_maincharad;
92
rsprite = spr_maincharar;
93
usprite = spr_maincharau;
94
lsprite = spr_maincharal;
95
if (global.flag[85 have_umbrella] == 1)
96
{
97
    dsprite = spr_maincharad_umbrella;
98
    rsprite = spr_maincharar_umbrella;
99
    usprite = spr_maincharau_umbrella;
100
    lsprite = spr_maincharal_umbrella;
101
}
102
if (global.facing == 0)
103
    sprite_index = dsprite;
104
if (global.facing == 1)
105
    sprite_index = rsprite;
106
if (global.facing == 2)
107
    sprite_index = usprite;
108
if (global.facing == 3)
109
    sprite_index = lsprite;
110
if (global.flag[480 inside_truelab] == 1)
111
    image_blend = merge_color(c_gray, c_white, 0.3);
112
inwater = 0;
113
h_skip = 0;
114
uncan = 0;
115
m_override = 0;