Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_cutscene_maker_Step_0

(view raw script w/o annotations or w/e)
1
newstep = 0;
2
hover_x = mouse_x;
3
hover_y = mouse_y;
4
_asx = actor_startx[actor_selected][step_current];
5
_asy = actor_starty[actor_selected][step_current];
6
dir_from_actor = point_direction(hover_x, hover_y, _asx, _asy);
7
thiscardinal = scr_get_cardinal_direction
scr_get_cardinal_direction

function scr_get_cardinal_direction(arg0) { _mycardinal = "n"; _mydegree = arg0; while (_mydegree > 360 || _mydegree < 0) { if (_mydegree > 360) _mydegree -= 360; if (_mydegree < 0) _mydegree += 360; } if (_mydegree >= 315 || _mydegree <= 45) _mycardinal = "r"; if (_mydegree >= 45 && _mydegree <= 135) _mycardinal = "u"; if (_mydegree >= 135 && _mydegree <= 225) _mycardinal = "l"; if (_mydegree >= 225 && _mydegree <= 315) _mycardinal = "d"; return _mycardinal; }
(dir_from_actor);
8
if (move_mode == 1)
9
{
10
    actor_move_style[actor_selected][step_current] = "cardinal";
11
    if (thiscardinal == "d" || thiscardinal == "u")
12
        hover_x = _asx;
13
    if (thiscardinal == "r" || thiscardinal == "l")
14
        hover_y = _asy;
15
    actor_cardinal[actor_selected][step_current] = thiscardinal;
16
}
17
else
18
{
19
    actor_move_style[actor_selected][step_current] = "direct";
20
}
21
if (grid_mode == 1)
22
{
23
    hover_x = round(hover_x / 20) * 20;
24
    hover_y = round(hover_y / 20) * 20;
25
}
26
if (keyboard_check_pressed(ord("1")))
27
{
28
    if (actor_selected > 0)
29
        actor_selected--;
30
}
31
if (keyboard_check_pressed(ord("2")))
32
{
33
    if (actor_selected < 8)
34
        actor_selected++;
35
}
36
if (keyboard_check_pressed(ord("M")))
37
{
38
    actor_startx[actor_selected][step_current] = mouse_x;
39
    actor_starty[actor_selected][step_current] = mouse_y;
40
}
41
if (keyboard_check_pressed(ord("I")))
42
    actor_endsprite[actor_selected][step_current] = spr_susied_dark;
43
if (mouse_check_button_pressed(mb_left))
44
{
45
    actor_endx[actor_selected][step_current] = hover_x;
46
    actor_endy[actor_selected][step_current] = hover_y;
47
}
48
if (keyboard_check_pressed(ord("N")))
49
    newstep = 1;
50
if (newstep == 1)
51
{
52
    step_max += 1;
53
    step_current = step_max;
54
    for (i = 0; i < 10; i++)
55
    {
56
        actor_startx[i][step_max] = actor_endx[i][step_max - 1];
57
        actor_starty[i][step_max] = actor_endy[i][step_max - 1];
58
        actor_endx[i][step_max] = actor_endx[i][step_max - 1];
59
        actor_endy[i][step_max] = actor_endy[i][step_max - 1];
60
        actor_startfacing[i][step_max] = actor_endfacing[i][step_max - 1];
61
        actor_endfacing[i][step_max] = actor_endfacing[i][step_max - 1];
62
        actor_startsprite[i][step_max] = actor_endsprite[i][step_max - 1];
63
        actor_endsprite[i][step_max] = actor_endsprite[i][step_max - 1];
64
        actor_image[i][step_max] = 0;
65
        actor_animation_speed[i][step_max] = 0;
66
        actor_time[i][step_max] = 30;
67
        actor_visible[i][step_max] = actor_visible[i][step_max - 1];
68
        actor_move_style[i][step_max] = "cardinal";
69
        actor_cardinal[i][step_max] = actor_cardinal[i][step_max - 1];
70
        actor_cardinal_speed[i][step_max] = actor_cardinal_speed[i][step_max - 1];
71
    }
72
    newstep = 0;
73
}
74
if (keyboard_check_pressed(vk_space))
75
{
76
    totalstring = "";
77
    for (j = 0; j < step_max; j++)
78
    {
79
        for (i = 0; i < 10; i++)
80
        {
81
            this_actor_name = "\"" + string(actor_name[i]) + "\"";
82
            this_action_string_head = "c_sel
c_sel

function c_sel(arg0) { c_cmd("select", arg0, 0, 0, 0); }
(" + this_actor_name + ")#";
83
            this_action_string_foot = "";
84
            action = 0;
85
            actor_moved = 0;
86
            if (actor_startx[i][j] != actor_endx[i][j])
87
                actor_moved = 1;
88
            if (actor_starty[i][j] != actor_endy[i][j])
89
                actor_moved = 1;
90
            if (actor_moved == 1)
91
            {
92
                action = 1;
93
                if (actor_move_style[i][j] == "cardinal")
94
                    this_action_string_foot += ("c_walk
c_walk

function c_walk(arg0, arg1, arg2) { c_cmd("walk", arg0, arg1, arg2, 0); }
(" + this_actor_name + "," + actor_cardinal[i][j] + "," + string(actor_cardinal_speed[i][j]) + "," + string(actor_time[i][j]) + ")#");
95
                if (actor_move_style[i][j] == "direct")
96
                    this_action_string_foot += ("c_walktopoint(" + string(actor_endx[i][j]) + "," + string(actor_endy[i][j]) + "," + string(actor_time[i][j]) + ")#");
97
            }
98
            actor_faced = 0;
99
            if (actor_startfacing[i][j] != actor_endfacing[i][j])
100
                actor_faced = 1;
101
            if (actor_faced == 1)
102
            {
103
                action = 1;
104
                this_action_string_foot += ("c_face(\"" + actor_endfacing[i][j] + "\"" + ")#");
105
            }
106
            if (action == 1)
107
                totalstring += (this_action_string_head + this_action_string_foot);
108
        }
109
    }
110
    clipboard_set_text(totalstring);
111
}