Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_rouxls_laser_pointer_controller_Step_0

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
    instance_destroy();
3
if (con == 1)
4
{
5
    recordstring += ("x" + string(mouse_x) + "y" + string(mouse_y) + "o");
6
    recordcount++;
7
}
8
if (con == 2)
9
{
10
    if (recordcount < string_length(recordstring))
11
    {
12
        var setx = false;
13
        var sety = false;
14
        var _x = "0";
15
        var _y = "0";
16
        var _end = 0;
17
        while (_end == 0)
18
        {
19
            var _input = string_char_at(recordstring, recordcount);
20
            recordcount++;
21
            if (_input == "x")
22
            {
23
                setx = true;
24
            }
25
            else if (_input == "y")
26
            {
27
                setx = false;
28
                sety = true;
29
            }
30
            else if (_input == "o")
31
            {
32
                _end = 1;
33
            }
34
            else
35
            {
36
                if (setx == true)
37
                    _x += _input;
38
                if (sety == true)
39
                    _y += _input;
40
            }
41
            if (recordcount >= string_length(recordstring))
42
                _end = 1;
43
            _mouse_x = real(_x) + camerax();
44
            _mouse_y = real(_y) + cameray();
45
        }
46
    }
47
    else
48
    {
49
        if (recordsave == true && show_question("Do you want to save the recording?"))
50
        {
51
            _string_save = get_string("Input string file name:", "default");
52
            ini_open("laserpointerplayback.ini");
53
            ini_write_string("Laser Pointer Playback Info", _string_save, recordstring);
54
            ini_close();
55
            recordsave = false;
56
        }
57
        else
58
        {
59
        }
60
        recordstring = "";
61
        recordcount = 0;
62
        con = 0;
63
    }
64
}