Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_c_actortoparty

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

function
c_actortoparty()
{
c_cmd("actortoparty", 0, 0, 0, 0);
} function c_actortoparty_function() { var actor_count = array_length(actor_id); for (var jjj = 0; jjj < actor_count; jjj++) { if (actor_name[jjj] == "kris" && i_ex(actor_id[jjj])) { setxy(actor_id[jjj].x, actor_id[jjj].y, 1198); obj_mainchara.depth = actor_id[jjj].depth; switch (actor_id[jjj].facing) { case "d": global.facing = 0; break; case "r": global.facing = 1; break; case "u": global.facing = 2; break; case "l": global.facing = 3; break; } obj_mainchara.set_facing(); actor_id[jjj].visible = false; obj_mainchara.visible = true; } } for (var lll = 0; lll < 2; lll++) { if (i_ex(global.cinstance[lll])) { for (var jjj = 0; jjj < actor_count; jjj++) { if (actor_name[jjj] == global.cinstance[lll].name && i_ex(actor_id[jjj])) { var myactor = actor_id[jjj]; with (obj_caterpillarchara) { if (name == myactor.name) { setxy(myactor.x, myactor.y);
scr_caterpillar_interpolate(name);
scr_caterpillar_facing_single(name, myactor.facing);
depth = myactor.depth; } } global.cinstance[lll].visible = 1; actor_id[jjj].visible = 0; } } } } }
()
2
{
3
    
c_cmd
c_cmd

function
c_cmd(arg0, arg1, arg2, arg3, arg4)
{ if (instance_exists(obj_cutscene_master)) { __cs_i = obj_cutscene_master.maximum_command - 1; obj_cutscene_master.command[__cs_i] = arg0; obj_cutscene_master.command_arg1[__cs_i] = arg1; obj_cutscene_master.command_arg2[__cs_i] = arg2; obj_cutscene_master.command_arg3[__cs_i] = arg3; obj_cutscene_master.command_arg4[__cs_i] = arg4; with (obj_cutscene_master) maximum_command++; } }
("actortoparty", 0, 0, 0, 0);
4
}
5
6
function c_actortoparty_function()
7
{
8
    var actor_count = array_length(actor_id);
9
    for (var jjj = 0; jjj < actor_count; jjj++)
10
    {
11
        if (actor_name[jjj] == "kris" && i_ex(actor_id[jjj]))
12
        {
13
            setxy(actor_id[jjj].x, actor_id[jjj].y, 1198);
14
            obj_mainchara.depth = actor_id[jjj].depth;
15
            switch (actor_id[jjj].facing)
16
            {
17
                case "d":
18
                    global.facing = 0;
19
                    break;
20
                case "r":
21
                    global.facing = 1;
22
                    break;
23
                case "u":
24
                    global.facing = 2;
25
                    break;
26
                case "l":
27
                    global.facing = 3;
28
                    break;
29
            }
30
            obj_mainchara.set_facing();
31
            actor_id[jjj].visible = false;
32
            obj_mainchara.visible = true;
33
        }
34
    }
35
    for (var lll = 0; lll < 2; lll++)
36
    {
37
        if (i_ex(global.cinstance[lll]))
38
        {
39
            for (var jjj = 0; jjj < actor_count; jjj++)
40
            {
41
                if (actor_name[jjj] == global.cinstance[lll].name && i_ex(actor_id[jjj]))
42
                {
43
                    var myactor = actor_id[jjj];
44
                    with (obj_caterpillarchara)
45
                    {
46
                        if (name == myactor.name)
47
                        {
48
                            setxy(myactor.x, myactor.y);
49
                            
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate(arg0 = "none")
{ if (arg0 == "all") { with (obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else if (arg0 == "none") { if (object_index == obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else { with (obj_caterpillarchara) { if (name == arg0) scr_caterpillar_interpolate_old(); } } } function scr_caterinterp(arg0 = "none") {
scr_caterpillar_interpolate(arg0);
} function scr_caterpillar_interpolate_old() { var _newfacing = direction_to_object_bbox(id, 1198, true); remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (var _iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x + halign, _iaia / target); remy[_iaia] = lerp(obj_mainchara.y, y + valign, _iaia / target); facing[_iaia] = _newfacing; } }
(name);
50
                            
scr_caterpillar_facing_single
scr_caterpillar_facing_single

function
scr_caterpillar_facing_single(arg0, arg1)
{ with (obj_caterpillarchara) { if (name == arg0) { for (i = 0; i < 25; i += 1) facing[i] =
scr_facing_letter_to_number(arg1);
} } }
(name, myactor.facing);
51
                            depth = myactor.depth;
52
                        }
53
                    }
54
                    global.cinstance[lll].visible = 1;
55
                    actor_id[jjj].visible = 0;
56
                }
57
            }
58
        }
59
    }
60
}