Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_ch3_BTB02_Create_0

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

function
scr_debug()
{ if (global.debug == 1) return 1; }
() && global.tempflag[90] == 1)
2
{
3
    with (obj_mainchara)
4
        setxy(1220, 380);
5
    with (obj_caterpillarchara)
6
    {
7
        if (name == "susie")
8
            setxy(1220, 300);
9
        if (name == "ralsei")
10
            setxy(1220, 220);
11
        
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate()
{ _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y)));
remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
12
    }
13
}
14
con = -1;
15
customcon = 0;
16
var staff_x_pos = 0;
17
var staff_y_pos = -10;
18
var x_offset = -1340;
19
shadowman_marker_a = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(2950 + x_offset, staff_y_pos + 125, spr_shadowman_sad);
20
with (shadowman_marker_a)
21
{
22
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
23
    image_speed = 0;
24
}
25
shadowman_marker_b = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(2790 + x_offset, staff_y_pos + 166, spr_shadowman_sad);
26
with (shadowman_marker_b)
27
{
28
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
29
    image_speed = 0;
30
}
31
shadowman_marker_c = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(2900 + x_offset, staff_y_pos + 170, spr_shadowman_sad);
32
with (shadowman_marker_c)
33
{
34
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
35
    image_speed = 0;
36
}
37
saxman_marker_a = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(3020 + x_offset, staff_y_pos + 162, spr_shadowman_sad);
38
with (saxman_marker_a)
39
{
40
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
41
    image_speed = 0;
42
}
43
saxman_marker_b = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(2820 + x_offset, staff_y_pos + 120, spr_shadowman_sad);
44
with (saxman_marker_b)
45
{
46
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
47
    image_speed = 0;
48
}
49
zapper_marker_a = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(3180 + x_offset, staff_y_pos + 150, spr_zapper_jump);
50
with (zapper_marker_a)
51
{
52
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
53
    image_speed = 0;
54
    image_xscale = -2;
55
}
56
zapper_marker_b = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(2888 + x_offset, staff_y_pos + 133, spr_zapper_jump);
57
with (zapper_marker_b)
58
{
59
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
60
    image_speed = 0;
61
    image_xscale = -2;
62
}
63
staff_markers = [shadowman_marker_a, saxman_marker_a, zapper_marker_a, zapper_marker_b, saxman_marker_b, shadowman_marker_b, shadowman_marker_c];
64
staff_leave = false;
65
staff_leave_timer = 0;
66
staff_index = 0;
67
staff_leave_loop = false;
68
staff_cleanup = false;
69
for (var i = 0; i < array_length(staff_markers); i++)
70
{
71
    with (staff_markers[i])
72
    {
73
        x = round(x / 2) * 2;
74
        y = round(y / 2) * 2;
75
        var amt = (bbox_bottom - 230) / 55;
76
        amt = clamp(amt, 0, 1);
77
        
scr_depth_alt
scr_depth_alt

function
scr_depth_alt()
{ depth = 100000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); }
();
78
    }
79
}
80
dustpile = instance_create(1280, 185, obj_ch3_BTB_dustpile);
81
with (dustpile)
82
{
83
    max_plot = 270;
84
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
85
}
86
dustpile.target_cutscene = id;
87
dustpile_block = instance_create(dustpile.x + 30, dustpile.y, obj_solidblocksized);
88
dustpile_readable = instance_create(dustpile.x, dustpile.y, obj_readable_room1);
89
with (dustpile_readable)
90
{
91
    extflag = "dustpile_01";
92
    image_xscale = 2;
93
    image_yscale = 2;
94
}
95
if (global.plot >= 270)
96
{
97
    staff_cleanup = true;
98
    with (dustpile_block)
99
        instance_destroy();
100
    with (dustpile_readable)
101
        instance_destroy();
102
}