Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3intro_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 == 1)
4
{
5
    if (con == 0 && !init)
6
    {
7
        
scr_resetgameshowcharacter
scr_resetgameshowcharacter

function
scr_resetgameshowcharacter(arg0)
{ if (room == room_dw_puzzlecloset_3) exit; var _name = arg0; var _smooth = 0; var __found = 0; if (argument_count == 2) _smooth = argument1; if (_name == "kris" || _name == "kr" || _name == "k" || _name == "Kris" || _name == "Kr" || _name == "K" || _name == "all") { var _krx = 248; var _kry = 400; if (
scr_swordroom())
{ _krx = 300; _kry = 298; } with (obj_mainchara) { if (_smooth == 0) { setxy(_krx, _kry); } else {
scr_lerpvar("x", x, _krx, _smooth);
scr_lerpvar("y", y, _kry, _smooth);
} fun = true; ignoredepth = true; depth = 95240; sprite_index = spr_krisu_dark; image_speed = 0; image_index = 0; if (
scr_swordroom())
{ sprite_index = spr_krisu_holdcontroller; depth = 96260; }
scr_darksize();
__found = 1; } } if (_name == "susie" || _name == "su" || _name == "Susie" || _name == "Su" || _name == "S" || _name == "s" || _name == "all") { with (obj_caterpillarchara) { if (name == "susie") { fun = true; ignoredepth = true; depth = 95165; var _sux = 140; var _suy = 392; if (_smooth == 0) { setxy(_sux, _suy); } else {
scr_lerpvar("x", x, _sux, _smooth);
scr_lerpvar("y", y, _suy, _smooth);
} sprite_index = spr_susie_walk_up_dw; image_speed = 0; image_index = 0;
scr_darksize();
__found = 1; } } } if (_name == "ralsei" || _name == "ra" || _name == "Ralsei" || _name == "Ra" || _name == "R" || _name == "r" || _name == "all") { with (obj_caterpillarchara) { if (name == "ralsei") { fun = true; ignoredepth = true; depth = 95145; var _rax = 342; var _ray = 396; if (_smooth == 0) { setxy(_rax, _ray); } else {
scr_lerpvar("x", x, _rax, _smooth);
scr_lerpvar("y", y, _ray, _smooth);
} sprite_index = spr_ralsei_walk_up; image_speed = 0; image_index = 0;
scr_darksize();
__found = 1; } } } if (_name == "tenna" || _name == "Tenna" || _name == "te" || _name == "t" || _name == "Te" || _name == "T" || _name == "all") ...
("all");
8
        kris.visible = 0;
9
        susie.visible = 0;
10
        ralsei.visible = 0;
11
        kris.canfreemove = 0;
12
        ralsei.follow = 0;
13
        ralsei.x = kris.x - 32;
14
        susie.x = kris.x + 32;
15
        init = 1;
16
    }
17
    if (con == 0 && obj_board_camera.con == 0 && !i_ex(obj_board_transition))
18
    {
19
        con = 1;
20
        suwalk = 1;
21
    }
22
    if (con == 1)
23
    {
24
        var startsnd = 492;
25
        var endsnd = 493;
26
        var timespread = 15;
27
        timer++;
28
        if (timer == (1 + (timespread * 0)))
29
        {
30
            star1 = instance_create(320, 192, obj_board_startransition);
31
            star1.image_index = 0;
32
            star1.targx = kris.x;
33
            star1.targy = kris.y;
34
            with (kris)
35
                scr_delay_var("visible", true, other.star1.transitiontime);
36
            snd_play_delay(endsnd, star1.transitiontime);
37
            snd_stop(startsnd);
38
            snd_play(startsnd);
39
        }
40
        if (timer == (1 + (timespread * 1)))
41
        {
42
            star1 = instance_create(320, 192, obj_board_startransition);
43
            star1.image_index = 1;
44
            star1.targx = susie.x;
45
            star1.targy = susie.y;
46
            snd_stop(startsnd);
47
            snd_play(startsnd);
48
            with (susie)
49
                scr_delay_var("visible", true, other.star1.transitiontime);
50
            snd_play_delay(endsnd, star1.transitiontime);
51
            firstvisitcon = -1;
52
        }
53
        if (timer == (1 + (timespread * 2)))
54
        {
55
            snd_free_all();
56
            star1 = instance_create(320, 192, obj_board_startransition);
57
            star1.image_index = 2;
58
            star1.targx = ralsei.x;
59
            star1.targy = ralsei.y;
60
            snd_stop(startsnd);
61
            snd_play(startsnd);
62
            with (ralsei)
63
                scr_delay_var("visible", true, other.star1.transitiontime);
64
            snd_play_delay(endsnd, star1.transitiontime);
65
            timer = 0;
66
            con = 2;
67
        }
68
    }
69
    if (con == 2 && !i_ex(obj_board_startransition))
70
    {
71
        ralsei.follow = true;
72
        
scr_board_caterpillar_interpolate_ralsei
scr_board_caterpillar_interpolate_ralsei

function
scr_board_caterpillar_interpolate_ralsei()
{ var _ralsei = obj_board_controller.ralsei_object; if (_ralsei != -1) { with (_ralsei) { for (i = 0; i < 75; i += 1) { remx[i] = x; remy[i] = y; facing[i] = 0; } } var _a = 0; var _dir = point_direction(_ralsei.x, _ralsei.y, x, y); repeat (_ralsei.ralsei_target) { _ralsei.remx[_a] = lerp(obj_board_controller.kris_object.x, _ralsei.x, _a / _ralsei.ralsei_target); _ralsei.remy[_a] = lerp(obj_board_controller.kris_object.y, _ralsei.y, _a / _ralsei.ralsei_target); if (_dir >= 45 && _dir < 135) _ralsei.facingdir[_a] = 2; else if (_dir >= 135 && _dir < 225) _ralsei.facingdir[_a] = 3; else if (_dir >= 225 && _dir < 315) _ralsei.facingdir[_a] = 0; else if (_dir >= 315 || _dir < 45) _ralsei.facingdir[_a] = 1; _a++; } } }
();
73
        with (ralsei)
74
        {
75
            for (i = 0; i < 10; i += 1)
76
                facingdir[i] = 1;
77
            facingdir[10] = 0;
78
        }
79
        suwalk = 0;
80
        with (obj_mainchara_board)
81
            canfreemove = true;
82
        ralsei.follow = true;
83
        mus_initloop(obj_ch3_gameshow.boardmusic);
84
        con = 3;
85
        timer = 0;
86
    }
87
    if (suwalk == 0 && obj_board_camera.con == 0)
88
    {
89
        suwalktimer++;
90
        if (suwalktimer == 1)
91
            ralsei.follow = true;
92
        if (suwalktimer == 15)
93
        {
94
            
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", choose(4, 5, 6, 7), choose(5, 6), 0);
95
            suwalk = 1;
96
        }
97
    }
98
}
99
else
100
{
101
    suwalk = 0;
102
    suwalktimer = 0;
103
}
104
if (con == 3)
105
{
106
    timer++;
107
    if (timer == 1)
108
    {
109
        tenna.bounce = 1;
110
        var tetalk = stringsetloc(
Welcome to TV-tropolis!!!
"Welcome to TV-tropolis!!!", "obj_b3intro_slash_Step_0_gml_140_0"
);
111
        
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, 60);
112
    }
113
    if (timer == 60)
114
    {
115
        su_real.sprite_index = spr_susie_walk_right_dw_unhappy;
116
        var sutalk = stringsetloc(
Alright, let's just get this over with.
"Alright, let's just get this over with.", "obj_b3intro_slash_Step_0_gml_146_0"
);
117
        
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, 60);
118
    }
119
    if (timer == 120)
120
    {
121
        su_real.sprite_index = su_real.usprite;
122
        timer = 0;
123
        con = 4;
124
    }
125
}
126
if (qcounttalk == 0)
127
{
128
    if (obj_board_inventory.qcount == 2)
129
        qcounttalk = 1;
130
}
131
if (qcounttalk == 1 && !i_ex(obj_quizsequence) && !bw_ex())
132
{
133
    qtime++;
134
    if (qtime == 15)
135
    {
136
        tenna.bounce = 1;
137
        var tetalk = stringsetloc(
Both Q's! Head for TV tower!!!
"Both Q's! Head for TV tower!!!", "obj_b3intro_slash_Step_0_gml_177_0"
);
138
        
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);
139
        qcounttalk++;
140
    }
141
}