Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ch4_DCC03_Create_0

(view raw script w/o annotations or w/e)
1
create_npc = function(arg0, arg1)
2
{
3
    npc_marker = 
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; }
(arg0.x, arg0.y, arg0.sprite_index);
4
    npc_marker.image_index = arg0.image_index;
5
    with (npc_marker)
6
        
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
7
    npc_readable = instance_create(npc_marker.x, npc_marker.y + 40, obj_readable_room1);
8
    with (npc_readable)
9
    {
10
        image_xscale = 2;
11
        image_yscale = 2;
12
        extflag = arg1;
13
    }
14
    npc_solid = instance_create(npc_marker.x, npc_marker.y + 40, obj_solidblockDark);
15
    with (obj_roomglow)
16
        create_highlight(other.npc_marker);
17
    with (obj_floorshadow)
18
    {
19
        if (target == other.npc_marker)
20
        {
21
            ignorepreset = true;
22
            yoff = -8;
23
        }
24
    }
25
};
26
27
remove_npc = function()
28
{
29
    with (npc_marker)
30
        instance_destroy();
31
    with (npc_readable)
32
        instance_destroy();
33
    with (npc_solid)
34
        instance_destroy();
35
};
36
37
progress_scene = function()
38
{
39
    con = 10;
40
};
41
42
answer_choice = function(arg0)
43
{
44
    if (arg0 == 0)
45
        con = 15;
46
    else
47
        con = 20;
48
};
49
50
regain_control = function()
51
{
52
    global.interact = 0;
53
    global.facing = 0;
54
    var kr_x = kr_actor.x;
55
    var kr_y = kr_actor.y;
56
    obj_mainchara.x = kr_x;
57
    obj_mainchara.y = kr_y;
58
    obj_mainchara.visible = 1;
59
    obj_mainchara.cutscene = 0;
60
    with (kr_actor)
61
        visible = 0;
62
};
63
64
lose_control = function()
65
{
66
    global.interact = 1;
67
    kr_actor.x = obj_mainchara.x;
68
    kr_actor.y = obj_mainchara.y;
69
    kr_actor.sprite_index = obj_mainchara.sprite_index;
70
    with (kr_actor)
71
        visible = 1;
72
    with (obj_caterpillarchara)
73
        visible = 0;
74
    with (obj_mainchara)
75
        visible = 0;
76
};
77
78
con = -1;
79
customcon = 0;
80
if (global.plot >= 260 && global.plot < 270)
81
{
82
    con = 0;
83
    
scr_setparty
scr_setparty

function
scr_setparty(arg0 = false, arg1 = false, arg2 = false)
{ var kris = obj_mainchara; var slot = 0; var __make = true; if (!i_ex(kris)) __make = false;
scr_losechar();
safe_delete(obj_caterpillarchara); if (arg0 == true) {
scr_getchar(2);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 2, slot))
{ halign = (global.darkzone == 0) ? 3 : 6; valign = (global.darkzone == 0) ? 6 : 16; x -= halign; y -= valign; } } slot++; } if (arg1 == true) {
scr_getchar(3);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 3, slot))
{ halign = 2; valign = 12; x -= halign; y -= valign; } } slot++; } if (arg2 == true) {
scr_getchar(4);
if (__make) { with (
scr_makecaterpillar(kris.x, kris.y, 4, slot))
{ halign = (global.darkzone == 0) ? 2 : 4; valign = (global.darkzone == 0) ? 9 : 18; x -= halign; y -= valign; } } slot++; } }
(0, 0, 0);
84
    blackall = 
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; }
(-10, -10, spr_pixel_white);
85
    blackall.image_xscale = 999;
86
    blackall.image_yscale = 999;
87
    blackall.depth = 100;
88
    blackall.image_blend = c_black;
89
    npc_marker = -4;
90
    npc_readable = -4;
91
    exit_block = instance_create(280, 480, obj_solidblockDark);
92
    exit_block.visible = 1;
93
    exit_block.image_xscale = 2;
94
    final_prophecy = instance_create(3860, 320, obj_dw_church_prophecy);
95
    final_prophecy.extflag = "final";
96
    final_prophecy.active = true;
97
    final_prophecy.destroykind = 3;
98
    final_prophecy.textonly = true;
99
    kris_head_marker = 
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; }
(0, 0, spr_kris_kneel_head);
100
    kris_head_marker.visible = 0;
101
    if (global.tempflag[90] == 1)
102
    {
103
        con = 5;
104
        blackall.image_alpha = 0;
105
        with (obj_mainchara)
106
        {
107
            x = 855;
108
            y = 191;
109
        }
110
        var _target_actor = -4;
111
        with (obj_caterpillarchara)
112
        {
113
            fun = 1;
114
            follow = 0;
115
            if (name == "ralsei")
116
            {
117
                _target_actor = id;
118
                sprite_index = spr_ralsei_walk_right_sad_subtle;
119
                x = 906;
120
                y = 179;
121
            }
122
            visible = 0;
123
        }
124
        create_npc(_target_actor, "ralsei");
125
    }
126
}
127
else
128
{
129
    instance_destroy();
130
}