Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_event_intro2_Step_0

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

function
scr_board_populatevars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (kris == 0) { with (obj_mainchara_board) { if (name == "kris") other.kris = id; } } if (ralsei == 0) { with (obj_mainchara_board) { if (name == "ralsei") other.ralsei = id; } } if (susie == 0) { with (obj_mainchara_board) { if (name == "susie") other.susie = id; } } }
();
2
scr_gameshow_populatevars
scr_gameshow_populatevars

function
scr_gameshow_populatevars()
{ if (!variable_instance_exists(id, "kr_real")) kr_real = 0; if (!variable_instance_exists(id, "su_real")) su_real = 0; if (!variable_instance_exists(id, "ra_real")) ra_real = 0; if (!variable_instance_exists(id, "tenna")) tenna = 0; if (kr_real == 0) { with (obj_mainchara) other.kr_real = id; } if (su_real == 0) { with (obj_caterpillarchara) { if (name == "susie") other.su_real = id; } } if (ra_real == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ra_real = id; } } if (tenna == 0) { with (obj_actor_tenna) other.tenna = id; } }
();
3
if (active)
4
{
5
    if (blocker == 0)
6
    {
7
        blocker = 1;
8
        with (instance_create(288, 800, obj_board_solid))
9
        {
10
            
scr_size
scr_size

function
scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{ with (arg2) { image_xscale = arg0; image_yscale = arg1; } }
(2, 1);
11
            setxy_board();
12
        }
13
    }
14
    if (suwalk == 0)
15
    {
16
        suwalktimer++;
17
        if (suwalktimer == 1)
18
            ralsei.follow = false;
19
        if (suwalktimer == 15)
20
        {
21
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", board_tilex(6.5), 184, 0);
22
            with (obj_mainchara_board)
23
            {
24
                if (name == "susie")
25
                    sleepy = true;
26
            }
27
        }
28
        if (suwalktimer == 30)
29
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("ralsei", board_tilex(4.5), 184, 0);
30
    }
31
    if (con == 0 && obj_board_camera.con == 0)
32
    {
33
        kris.cantleave = true;
34
        con = 1;
35
        contimer = 0;
36
        tenna.bounce = 1;
37
        var tetalk = stringsetloc(
Just down that hole!!!
"Just down that hole!!!", "obj_board_event_intro2_slash_Step_0_gml_17_0"
);
38
        
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(tetalk, "tenna", 2, 80);
39
    }
40
    if (con == 1)
41
    {
42
        contimer++;
43
        if (contimer == 80)
44
        {
45
            var sutalk = stringsetloc(
A hole, huh? That's original.
"A hole, huh? That's original.", "obj_board_event_intro2_slash_Step_0_gml_31_0"
);
46
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(sutalk, "susie", 2, 80);
47
        }
48
    }
49
    if (jumpcon == 0)
50
    {
51
        var trig = 0;
52
        with (kris)
53
        {
54
            if (place_meeting(x, y, obj_board_trigger))
55
                trig = 1;
56
        }
57
        if (trig == 1)
58
        {
59
            with (obj_mainchara_board)
60
            {
61
                if (name == "susie")
62
                    sleepy = false;
63
            }
64
            con = 99;
65
            jumpcon = 1;
66
            kris.canfreemove = false;
67
            timer = 0;
68
        }
69
    }
70
    if (jumpcon == 1)
71
    {
72
        if (
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("ralsei", board_tilex(4.5), 184, 4) &&
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("susie", board_tilex(6.5), 184, 4))
73
        {
74
            timer++;
75
            if (timer == 15)
76
            {
77
                timer = 0;
78
                jumpcon = 2;
79
                snd_play_x(snd_jump, 0.8, 1);
80
                snd_play_x(snd_jump, 0.5, 1.2);
81
                with (obj_mainchara_board)
82
                    
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{ var ___jump =
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump) { trackalpha = arg4; trackblend = arg4; trackindex = arg4; tracksprite = arg4; } return ___jump; }
(304, board_tiley(5.5), 12, 30);
83
            }
84
        }
85
    }
86
    if (jumpcon == 2)
87
    {
88
        timer++;
89
        if (timer == 10)
90
            transition = instance_create(0, 0, obj_board_transition);
91
        if (timer > 15)
92
        {
93
            if (transition.con == 3)
94
                room_goto(room_board_1);
95
        }
96
    }
97
}
98
else
99
{
100
    suwalk = 0;
101
    suwalktimer = 0;
102
}