Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2bridgepuzzle2_alt_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 && obj_board_camera.con == 0)
6
    {
7
        var krcont = 0;
8
        if (global.flag[1190 control_unjumble] == 1 || obj_b2bombfun.visited == 1)
9
            krcont = 1;
10
        if (krcont == 0)
11
        {
12
            with (obj_mainchara_board)
13
                controlled = false;
14
            susie.controlled = true;
15
            ralsei.follow = false;
16
            kris.camera = true;
17
            con = 1;
18
            timer = 0;
19
        }
20
        else if (obj_board_camera.con == 0)
21
        {
22
            suwalktimer++;
23
            if (susolve == 0)
24
            {
25
                if (suwalktimer == 15)
26
                {
27
                    with (obj_board_resettile)
28
                    {
29
                        if (puzzleid == 2)
30
                            pressed = 2;
31
                    }
32
                    
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", 8, 2, 2);
33
                }
34
                if (suwalktimer > 15)
35
                {
36
                    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; }
("susie", 8, 2, 4))
37
                    {
38
                        kris.cantleave = true;
39
                        suwalktimer = 0;
40
                        con = 0.1;
41
                        timer = 0;
42
                        susolve = 1;
43
                    }
44
                }
45
            }
46
            else
47
            {
48
                suwalktimer++;
49
                if (suwalktimer == 16)
50
                {
51
                    var rand = choose(0, 1, 2);
52
                    rand = 0;
53
                    switch (rand)
54
                    {
55
                        case 0:
56
                            
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(2, 3, 4), 2, 0);
57
                            break;
58
                        case 1:
59
                            
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(8, 9, 10), 5, 0);
60
                            break;
61
                        case 2:
62
                            
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(8, 9, 10), 1, 0);
63
                            break;
64
                    }
65
                    susie.sleepy = true;
66
                }
67
            }
68
        }
69
    }
70
    if (con == 0.1)
71
    {
72
        timer++;
73
        if (timer == 1)
74
        {
75
            var sutalk = stringsetloc(
Can't believe I have to do this.
"Can't believe I have to do this.", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_82_0"
);
76
            
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, 70);
77
            
scr_play_recording
scr_play_recording

function
scr_play_recording(arg0, arg1)
{ with (obj_mainchara_board) { if (name == arg0) { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg1; susierecordsave = false; } } }
("susie", "0W010W0W0W0W0W0W0W0W0W0D0D0D0D0D0D0L0L0L0W0W0W0W0W0W0W010W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0R0R0R0R0R0R0R0R0R0R0R0R0R0R0R0R0W0U0U0U0U0U0U0U0U010W0W0W0W0W0D0D0D0D0D0D0D0D0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0L0W0W0W0W0W0W0W0W0W010W0W");
78
        }
79
        if (timer > 1)
80
        {
81
            var trig = 0;
82
            with (obj_board_event_bridgepuzzle)
83
            {
84
                if (puzzleid == 2 && solved)
85
                    trig = 1;
86
            }
87
            if (trig == 1)
88
            {
89
                kris.cantleave = false;
90
                
scr_board_gridreset
scr_board_gridreset

function
scr_board_gridreset()
{ with (obj_board_controller) grid_reset = true; }
();
91
                timer = 0;
92
                con = 0;
93
                suwalktimer = 0;
94
                susie.sleepy = true;
95
                var ratalk = stringsetloc(
Nice solve, Susie!
"Nice solve, Susie!", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_100_0"
);
96
                
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_couchtalk, 15, ratalk, "ralsei", 2, 70);
97
            }
98
        }
99
    }
100
    if (con == 1)
101
    {
102
        timer++;
103
        if (timer == 5)
104
            
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; } } } }
("kris", 9, 4, 0);
105
        if (timer == 15)
106
            
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", 10, 4, 0);
107
        if (timer == 45)
108
        {
109
            su_real.sprite_index = spr_susie_walk_right_dw_unhappy;
110
            var sutalk = stringsetloc(
Hey, why don't we just stay as these characters?
"Hey, why don't we just stay as these characters?", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_35_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; }
(sutalk, "susie", 2, 100);
112
        }
113
        if (timer == 140)
114
        {
115
            ra_real.sprite_index = spr_ralsei_walk_left_unhappy;
116
            su_real.sprite_index = spr_susie_walk_right_dw;
117
            var sutalk = stringsetloc(
Until I find something cool I wanna throw.
"Until I find something cool I wanna throw.", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_40_0"
);
118
            
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, 90);
119
        }
120
        if (timer == 230)
121
        {
122
            ra_real.sprite_index = spr_ralsei_walk_left;
123
            
scr_pathfind_end
scr_pathfind_end

function
scr_pathfind_end(arg0)
{ with (obj_mainchara_board) { if (name == arg0) { path_end(); path_target_x = -1; path_target_y = -1; is_moving_timer = 0; is_moving = false; } } }
("ralsei");
124
            ralsei.susierecordcon = 0;
125
            ralsei.sleepy = true;
126
            var ratalk = stringsetloc(
... if it's okay! Haha.
"... if it's okay! Haha.", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_45_0"
);
127
            
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; }
(ratalk, "ralsei", 2, 90);
128
        }
129
        if (timer == 320)
130
        {
131
            
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") ...
("susie");
132
            
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") ...
("ralsei");
133
            con++;
134
        }
135
    }
136
    if (con == 2)
137
    {
138
        var proceed = false;
139
        with (obj_board_event_bridgepuzzle)
140
        {
141
            if (puzzleid == 2 && solved)
142
                proceed = true;
143
        }
144
        if (proceed)
145
        {
146
            timer = 0;
147
            con = 3;
148
            
scr_board_gridreset
scr_board_gridreset

function
scr_board_gridreset()
{ with (obj_board_controller) grid_reset = true; }
();
149
        }
150
    }
151
    if (con == 3)
152
    {
153
        timer++;
154
        if (timer == 15)
155
        {
156
            var ratalk = stringsetloc(
Oh! Nice solve, Kris!
"Oh! Nice solve, Kris!", "obj_b2bridgepuzzle2_alt_slash_Step_0_gml_88_0"
);
157
            
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; }
(ratalk, "ralsei", 2, 60);
158
            
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; } } } }
("kris", 2, 6, 0);
159
            con = 4;
160
            timer = 0;
161
        }
162
    }
163
    if (con == 100 && obj_board_camera.con == 0)
164
    {
165
        if (suwalk == 0)
166
        {
167
            suwalktimer++;
168
            if (suwalktimer == 15)
169
            {
170
                suwalk = 1;
171
                
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(2, 3, 4), choose(2, 3), 0);
172
            }
173
        }
174
    }
175
}
176
else
177
{
178
    if (con == 4)
179
        con = 100;
180
    if (con == 100 || global.flag[1190 control_unjumble] == 1)
181
    {
182
        suwalk = 0;
183
        suwalktimer = 0;
184
    }
185
}
186
if (con == 99)
187
    con = 100;