Undertale script viewer

← back to main script listing

gml_Object_obj_toroverworld1_Step_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 (instance_exists(obj_torface))
3
{
4
    myinteract = 1;
5
    if (instance_exists(OBJ_WRITER))
6
    {
7
        if (OBJ_WRITER.halt != 0)
8
            image_speed = 0.2;
9
    }
10
}
11
else
12
{
13
    myinteract = 0;
14
    if (speed == 0)
15
    {
16
        image_index = 0;
17
        image_speed = 0;
18
    }
19
    if (speed > 0)
20
        image_speed = 0.2;
21
}
22
scr_npcdir
scr_npcdir

if (myinteract == 0) { if (direction >= 225 && direction < 315) { facing = 0; sprite_index = dsprite; } if (direction >= 315 || direction < 45) { facing = 1; sprite_index = rsprite; } if (direction >= 45 && direction < 135) { facing = 2; sprite_index = usprite; } if (direction >= 135 && direction < 225) { facing = 3; sprite_index = lsprite; } } if (myinteract == (1 + argument0)) { if (facing == 0) sprite_index = dtsprite; if (facing == 1) sprite_index = rtsprite; if (facing == 2) sprite_index = utsprite; if (facing == 3) sprite_index = ltsprite; }
(0);
23
if (room == room_area1_2 && y < 140)
24
    fader = 1;
25
if (fader == 1)
26
{
27
    image_alpha -= 0.2;
28
    if (image_alpha <= 0.2)
29
        instance_destroy();
30
}