Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_controller_keyboard_puzzle_1_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    with (obj_mainchara)
4
    {
5
        if (place_meeting(x, y, obj_traffic_road_trigger))
6
            other.con = 1;
7
    }
8
}
9
if (con == 1)
10
{
11
    global.interact = 1;
12
    cutscene_master = 
scr_cutscene_make
scr_cutscene_make

function
scr_cutscene_make()
{ _cutscene_master = instance_create(0, 0, obj_cutscene_master); _cutscene_master.master_object = id; return _cutscene_master; }
();
13
    
scr_maincharacters_actors
scr_maincharacters_actors

function
scr_maincharacters_actors()
{ actor_count = 0; kr = 0; kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor);
scr_actor_setup(kr, kr_actor, "kris");
kr_actor.sprite_index = obj_mainchara.sprite_index; kr_actor.depth = obj_mainchara.depth; with (obj_mainchara) visible = 0; for (__jj = 0; __jj < array_length_1d(global.cinstance); __jj++) { if (i_ex(global.cinstance[__jj])) { if (global.cinstance[__jj].name == "susie") { actor_count++; su = __jj + 1; su_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(su, su_actor, "susie");
su_actor.sprite_index = global.cinstance[__jj].sprite_index; su_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "ralsei") { actor_count++; ra = __jj + 1; ra_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(ra, ra_actor, "ralsei");
ra_actor.sprite_index = global.cinstance[__jj].sprite_index; ra_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "noelle") { actor_count++; no = __jj + 1; no_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(no, no_actor, "noelle");
no_actor.sprite_index = global.cinstance[__jj].sprite_index; no_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } } } }
();
14
    con++;
15
}
16
if (con == 2)
17
{
18
    con = -999;
19
    
c_speaker
c_speaker

function
c_speaker(arg0)
{
c_cmd("speaker", arg0, 0, 0, 0);
}
("ralsei");
20
    
c_msgsetloc
c_msgsetloc

function
c_msgsetloc(arg0, arg1, arg2)
{ var msg_index = arg0; var english = arg1; var localized_string_id = arg2; var str = english; if (!is_english()) str =
scr_84_get_lang_string(localized_string_id);
c_msgset(msg_index, str);
}
(0,
Face 2* Kris, I think you should handle this puzzle!Wait for inputClose Message
"\\E2* Kris, I think you should handle this puzzle!/%", "obj_controller_keyboard_puzzle_1_slash_Step_0_gml_18_0"
);
21
    
c_talk_wait
c_talk_wait

function
c_talk_wait()
{
c_talk();
c_waittalk();
}
();
22
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
23
    
c_walkdirect
c_walkdirect

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(50, 114, 12);
24
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
25
    
c_walkdirect
c_walkdirect

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(102, 110, 12);
26
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(13);
27
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("d");
28
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
29
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("d");
30
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(4);
31
    
c_actortokris
c_actortokris

function
c_actortokris()
{
c_cmd("actortokris", 0, 0, 0, 0);
}
();
32
    
c_actortocaterpillar
c_actortocaterpillar

function
c_actortocaterpillar()
{
c_cmd("actortocaterpillar", 0, 0, 0, 0);
}
();
33
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "con", 3);
34
    
c_terminatekillactors
c_terminatekillactors

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
35
}
36
if (con == 3 && !i_ex(cutscene_master))
37
{
38
    npcral = instance_create(realral.x, realral.y, obj_npc_sign);
39
    npcral.sprite_index = spr_ralsei_walk_down;
40
    realral.visible = false;
41
    npcsus = instance_create(realsus.x, realsus.y, obj_npc_sign);
42
    npcsus.sprite_index = spr_susie_walk_down_dw;
43
    realsus.visible = false;
44
    global.interact = 0;
45
    con++;
46
}
47
if (con == 4)
48
{
49
    if (global.flag[390 solved_apple_puzzle] == 1 && obj_mainchara.x <= 160)
50
    {
51
        realral.x = npcral.x;
52
        realral.y = npcral.y;
53
        with (realral)
54
            
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; } }
();
55
        realral.visible = true;
56
        realsus.x = npcsus.x;
57
        realsus.y = npcsus.y;
58
        with (realsus)
59
            
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; } }
();
60
        realsus.visible = true;
61
        with (npcral)
62
            instance_destroy();
63
        with (npcsus)
64
            instance_destroy();
65
        con++;
66
    }
67
}