Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_debugmode

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

function scr_debugmode() //gml_Script_scr_debugmode { if (keyboard_check_pressed(vk_f5) && keyboard_check(vk_shift)) scr_savegame() if (keyboard_check_pressed(vk_f6) && keyboard_check(vk_shift)) { scr_loadgame() obj_pl.image_alpha = 1 if (global.party_member != noone) global.party_member.image_alpha = 1 scr_cutscene_end() } if (keyboard_check_pressed(vk_f2) && keyboard_check(vk_shift)) { if (global.debugmove == false) { global.debugmove = true return; } else global.debugmove = false } if (keyboard_check_pressed(ord("E")) && keyboard_check(vk_shift) && (!instance_exists(obj_dev_console))) { if (!instance_exists(obj_debugger)) instance_create(0, 0, obj_debugger) } if (keyboard_check(vk_shift) && keyboard_check_pressed(vk_f1)) url_open("https://docs.google.com/spreadsheets/d/1cRs7AnopU1EJ1mWnX3Qv-Xnf2vntGXbXcIyiLfnQHpo/edit?usp=sharing") if (!variable_global_exists("gold_tracked")) global.gold_tracked = global.player_gold if variable_global_exists("gold_amount_total") { if (global.player_gold > global.gold_tracked) global.gold_amount_total += (global.player_gold - global.gold_tracked) else if (global.player_gold < global.gold_tracked) global.gold_spent += (global.gold_tracked - global.player_gold) global.gold_tracked = global.player_gold } else { global.gold_amount_total = 0 global.gold_spent = 0 } if variable_global_exists("hit_self") { if (!variable_global_exists("hp_tracked")) global.hp_tracked = global.current_hp_self if variable_global_exists("hit_tracker") { if (global.hp_tracked > global.current_hp_self) global.hit_tracker += 1 global.hp_tracked = global.current_hp_self } else global.hit_tracker = 0 } }
() //gml_Script_scr_debugmode
2
{
3
    if (keyboard_check_pressed(vk_f5) && keyboard_check(vk_shift))
4
        scr_savegame
scr_savegame

function scr_savegame() //gml_Script_scr_savegame { if file_exists("Save.sav") file_delete("Save.sav") ini_open("Save.sav") var SavedRoom = room_get_name(room) ini_write_string("Save1", "room", SavedRoom) ini_write_real("Save1", "pX", obj_pl.x) ini_write_real("Save1", "pY", obj_pl.y) ini_write_real("Save1", "dir", obj_pl.direction) SavedRoom = room ini_write_real("Save1", "HP", global.current_hp_self) ini_write_real("Save1", "MAXHP", global.max_hp_self) ini_write_real("Save1", "PP", global.current_pp_self) ini_write_real("Save1", "MAXPP", global.max_pp_self) ini_write_real("Save1", "SP", global.current_sp_self) ini_write_real("Save1", "MAXSP", global.max_sp_self) ini_write_real("Save1", "RP", global.current_rp_self) ini_write_real("Save1", "MAXRP", global.max_rp_self) ini_write_real("Save1", "AT - Primary", global.player_attack) ini_write_real("Save1", "AT - Secondary", global.player_weapon_modifier_attack) ini_write_real("Save1", "DFP", global.player_defense) ini_write_real("Save1", "DFS", global.player_armor_modifier_defense) ini_write_real("Save1", "LV", global.player_level) ini_write_real("Save1", "EXP", global.player_exp) ini_write_real("Save1", "Gold", global.player_gold) ini_write_string("Save1", "Armor", global.player_armor) ini_write_string("Save1", "Weapon", global.player_weapon) ini_write_string("Save1", "Ammo", global.player_weapon_modifier) ini_write_string("Save1", "Accessory", global.player_armor_modifier) ini_write_string("Save1", "rmName", global.saveroom) ini_write_string("Save1", "playerSprite", global.player_sprites) ini_write_real("Save1", "playerCanRun", global.player_can_run) if (global.party_member == noone) ini_write_string("Save1", "Follower", "noone") else ini_write_string("Save1", "Follower", object_get_name(global.party_member)) ini_write_real("Save1", "Satchel", global.player_has_satchel) ini_write_real("Save1", "FTravel", global.player_can_travel) scr_determine_playtime() ini_write_real("Playtime", "Seconds", global.elapsed_seconds) var ds_list_encounters = ds_list_write(global.encounter_list) ini_write_string("Encounters", "0", ds_list_encounters) var ds_list_steal = ds_list_write(global.steal_list) ini_write_string("Steal", "0", ds_list_steal) var ds_list_fasttravel = ds_list_write(global.fast_travel_list) ini_write_string("FastTravel", "0", ds_list_fasttravel) var inv1 = global.item_slot[1] ini_write_string("Items", "00", global.item_slot[1]) ini_write_string("Items", "01", global.item_slot[2]) ini_write_string("Items", "02", global.item_slot[3]) ini_write_string("Items", "03", global.item_slot[4]) ini_write_string("Items", "04", global.item_slot[5]) ini_write_string("Items", "05", global.item_slot[6]) ini_write_string("Items", "06", global.item_slot[7]) ini_write_string("Items", "07", global.item_slot[8]) var ds_list_string = ds_list_write(global.box_slot_list) ini_write_string("DBox", "0", ds_list_string) ini_write_real("Misc", "01", global.tinypuzzle) for (var i = 0; i < array_length_1d(global.ruins_flag); i++) ini_write_real("RuinsFlags", string(i), global.ruins_flag[i]) for (i = 0; i < array_length_1d(global.flag); i++) ini_write_real("Flags", string(i), global.flag[i]) for (i = 0; i < array_length_1d(global.snowdin_flag); i++) ini_write_real("SnowdinFlags", string(i), global.snowdin_flag[i]) for (i = 0; i < array_length_1d(global.dunes_flag); i++) ini_write_real("DunesFlags", string(i), global.dunes_flag[i]) for (i = 0; i < array_length_1d(global.dunes_flag_ext); i++) ini_write_real("DunesFlagsExt", string(i), global.dunes_flag_ext[i]) for (i = 0; i < array_length_1d(global.sworks_flag); i++) ini_write_real("SworksFlags", string(i), global.sworks_flag[i]) ini_write_string("SworksFlags", "code", global.factory_code) ds_list_string = ds_list_write(global.factory_code_2) ini_write_string("SworksFlags", "code2", ds_list_string) ini_write_string("SworksFlags", "code3", global.factory_code_3) ini_write_real("SworksFlags", "RbCount", global.sworks_robot_count) for (i = 0; i < global.sworks_robot_count; i++) { ini_write_real("RbSprite", string(i), global.sworks_robot_sprite[i]) ini_write_real("RbX", string(i), global.sworks_robot_x[i]) ini_write_real("RbY", string(i), global.sworks_robot_y[i]) ini_write_real("RbD", string(i), global.sworks_robot_depth[i]) ini_write_real("RbS", string(i), global.sworks_robot_scale[i]) ini_write_real("RbA", string(i), global.sworks_robot_angle[i]) } ini_write_string("SworksFlags", "sworks_id", ds_grid_write(global.sworks_id_grid)) for (i = 0; i < array_length_1d(global.item_stock); i++) ini_write_real("ItemStock", string(i), global.item_stock[i]) for (i = 0; i < array_length_1d(global.hotland_flag); i++) ini_write_real("HotlandFlags", string(i), global.hotland_flag[i]) for (i = 0; i < array_length_1d(global.flowey_flag); i++) ini_write_real("FloweyFlags", string(i), global.flowey_flag[i]) ini_write_real("FloweyFlags", "savenumber", global.flowey_save_number) ini_write_real("FloweyFlags", "savecount", global.save_count) for (i = 0; i < array_length_1d(global.extra_flag); i++) ini_write_real("ExtraFlags", string(i), global.extra_flag[i]) for (i = 0; i < array_length_1d(global.mail_flag); i++) ini_write_real("MailFlags", string(i), global.mail_flag[i]) ds_list_string = ds_list_write(global.mail_list) ini_write_string("Mail", "0", ds_list_string) ds_list_string = ds_list_write(global.mail_unclaimed_list) ...
()
5
    if (keyboard_check_pressed(vk_f6) && keyboard_check(vk_shift))
6
    {
7
        scr_loadgame
scr_loadgame

function scr_loadgame() //gml_Script_scr_loadgame { if file_exists("Save.sav") { scr_initialize() ini_open("Save.sav") var LoadedRoom = ini_read_string("Save1", "room", "rm_ruins00") obj_pl.x = ini_read_real("Save1", "pX", 320) obj_pl.y = ini_read_real("Save1", "pY", 320) obj_pl.direction = ini_read_real("Save1", "dir", 0) obj_controller.steps = ini_read_real("Save1", "SP", 0) global.player_attack = ini_read_real("Save1", "AT - Primary", 0) global.player_weapon_modifier_attack = ini_read_real("Save1", "AT - Secondary", 0) global.player_defense = ini_read_real("Save1", "DFP", 0) global.player_armor_modifier_defense = ini_read_real("Save1", "DFS", 0) global.player_level = ini_read_real("Save1", "LV", 1) global.player_exp = ini_read_real("Save1", "EXP", 0) global.player_weapon_modifier = ini_read_string("Save1", "Ammo", "Rubber Ammo") global.player_armor = ini_read_string("Save1", "Armor", "Worn Hat") global.player_armor_modifier = ini_read_string("Save1", "Accessory", "Patch") global.player_gold = ini_read_real("Save1", "Gold", 0) global.current_hp_self = ini_read_real("Save1", "HP", 1) global.max_hp_self = ini_read_real("Save1", "MAXHP", 20) global.player_weapon = ini_read_string("Save1", "Weapon", "Toy Gun") global.fun_value = ini_read_real("Save1", "FUN", 0) global.current_pp_self = ini_read_real("Save1", "PP", 0) global.max_pp_self = ini_read_real("Save1", "MAXPP", 20) global.current_sp_self = ini_read_real("Save1", "SP", 0) global.max_sp_self = ini_read_real("Save1", "MAXSP", 99) global.player_sprites = ini_read_string("Save1", "playerSprite", "normal") global.current_rp_self = ini_read_real("Save1", "RP", 0) global.max_rp_self = ini_read_real("Save1", "MAXRP", 0) global.player_can_run = ini_read_real("Save1", "playerCanRun", 1) global.saved_datetime = date_current_datetime() global.elapsed_seconds = ini_read_real("Playtime", "Seconds", 0) var _party_member = ini_read_string("Save1", "Follower", "noone") if (_party_member == "noone") global.party_member = noone else global.party_member = asset_get_index(_party_member) global.player_has_satchel = ini_read_real("Save1", "Satchel", 0) global.player_can_travel = ini_read_real("Save1", "FTravel", 0) for (var i = 0; i < array_length_1d(global.ruins_flag); i++) global.ruins_flag[i] = ini_read_real("RuinsFlags", string(i), false) for (i = 0; i < array_length_1d(global.flag); i++) global.flag[i] = ini_read_real("Flags", string(i), false) for (i = 0; i < array_length_1d(global.snowdin_flag); i++) global.snowdin_flag[i] = ini_read_real("SnowdinFlags", string(i), false) for (i = 0; i < array_length_1d(global.dunes_flag); i++) global.dunes_flag[i] = ini_read_real("DunesFlags", string(i), false) for (i = 0; i < array_length_1d(global.dunes_flag_ext); i++) global.dunes_flag_ext[i] = ini_read_real("DunesFlagsExt", string(i), false) for (i = 0; i < array_length_1d(global.sworks_flag); i++) global.sworks_flag[i] = ini_read_real("SworksFlags", string(i), false) global.factory_code = ini_read_string("SworksFlags", "code", "0000") global.factory_code_3 = ini_read_string("SworksFlags", "code3", "0000") var ds_factory_code_2 = ini_read_string("SworksFlags", "code2", "") ds_list_read(global.factory_code_2, ds_factory_code_2) global.sworks_robot_count = ini_read_real("SworksFlags", "RbCount", 0) for (i = 0; i < global.sworks_robot_count; i++) { global.sworks_robot_sprite[i] = ini_read_real("RbSprite", string(i), 0) global.sworks_robot_x[i] = ini_read_real("RbX", string(i), 0) global.sworks_robot_y[i] = ini_read_real("RbY", string(i), 0) global.sworks_robot_depth[i] = ini_read_real("RbD", string(i), 0) global.sworks_robot_scale[i] = ini_read_real("RbS", string(i), 0) global.sworks_robot_angle[i] = ini_read_real("RbA", string(i), 0) } ds_grid_read(global.sworks_id_grid, ini_read_string("SworksFlags", "sworks_id", "")) for (i = 0; i < array_length_1d(global.item_stock); i++) global.item_stock[i] = ini_read_real("ItemStock", string(i), false) for (i = 0; i < array_length_1d(global.hotland_flag); i++) global.hotland_flag[i] = ini_read_real("HotlandFlags", string(i), false) for (i = 0; i < array_length_1d(global.flowey_flag); i++) global.flowey_flag[i] = ini_read_real("FloweyFlags", string(i), false) global.flowey_save_number = ini_read_real("FloweyFlags", "savenumber", 0) global.save_count = ini_read_real("FloweyFlags", "savecount", 1) for (i = 0; i < array_length_1d(global.extra_flag); i++) global.extra_flag[i] = ini_read_real("ExtraFlags", string(i), false) for (i = 0; i < array_length_1d(global.mail_flag); i++) global.mail_flag[i] = ini_read_real("MailFlags", string(i), false) for (i = 0; i < array_length_1d(global.mail_flag); i++) global.mail_flag[i] = ini_read_real("MailFlags", string(i), false) global.mail_count = ini_read_real("Mail", "1", 0) global.mail_pinned = ini_read_real("Mail", "2", 0) global.tinypuzzle = ini_read_real("Misc", "01", 5) deaths = ini_read_real("Misc", "Deaths", false) for (i = 0; i < array_length(global.fun_event); i++) global.fun_event[i] = ini_read_real("Fun Events", string(i), 0) for (i = 1; i <= 8; i++) global.item_slot[i] = ini_read_string("Items", ("0" + (string(i - 1))), "Nothing") var ds_list_string = ini_read_string("DBox", 0, "0") ds_list_read(global.box_slot_list, ds_list_string) ds_list_string = ini_read_string("Mail", 0, "0") ds_list_read(global.mail_list, ds_list_string) ds_list_string = ini_read_string("Mail", "3", "0") ds_list_read(global.mail_list_read, ds_list_string) ds_list_string = ini_read_string("MailUnclaimed", 0, "0") ds_list_read(global.mail_unclaimed_list, ds_list_string) var ds_list_encounters = ini_read_string("Encounters", 0, "0") ds_list_read(global.encounter_list, ds_list_encounters) ...
()
8
        obj_pl.image_alpha = 1
9
        if (global.party_member != noone)
10
            global.party_member.image_alpha = 1
11
        scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
12
    }
13
    if (keyboard_check_pressed(vk_f2) && keyboard_check(vk_shift))
14
    {
15
        if (global.debugmove == false)
16
        {
17
            global.debugmove = true
18
            return;
19
        }
20
        else
21
            global.debugmove = false
22
    }
23
    if (keyboard_check_pressed(ord("E")) && keyboard_check(vk_shift) && (!instance_exists(obj_dev_console)))
24
    {
25
        if (!instance_exists(obj_debugger))
26
            instance_create(0, 0, obj_debugger)
27
    }
28
    if (keyboard_check(vk_shift) && keyboard_check_pressed(vk_f1))
29
        url_open("https://docs.google.com/spreadsheets/d/1cRs7AnopU1EJ1mWnX3Qv-Xnf2vntGXbXcIyiLfnQHpo/edit?usp=sharing")
30
    if (!variable_global_exists("gold_tracked"))
31
        global.gold_tracked = global.player_gold
32
    if variable_global_exists("gold_amount_total")
33
    {
34
        if (global.player_gold > global.gold_tracked)
35
            global.gold_amount_total += (global.player_gold - global.gold_tracked)
36
        else if (global.player_gold < global.gold_tracked)
37
            global.gold_spent += (global.gold_tracked - global.player_gold)
38
        global.gold_tracked = global.player_gold
39
    }
40
    else
41
    {
42
        global.gold_amount_total = 0
43
        global.gold_spent = 0
44
    }
45
    if variable_global_exists("hit_self")
46
    {
47
        if (!variable_global_exists("hp_tracked"))
48
            global.hp_tracked = global.current_hp_self
49
        if variable_global_exists("hit_tracker")
50
        {
51
            if (global.hp_tracked > global.current_hp_self)
52
                global.hit_tracker += 1
53
            global.hp_tracked = global.current_hp_self
54
        }
55
        else
56
            global.hit_tracker = 0
57
    }
58
}