Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_mainmenu_Step_0

(view raw script w/o annotations or w/e)
1
if (waiter == 1)
2
    return;
3
scr_get_input
scr_get_input

function scr_get_input() //gml_Script_scr_get_input { if live_call() return global.live_result; scr_stick_press() global.down_key = (keyboard_check(vk_down) || gamepad_button_check(0, gp_padd) || gamepad_axis_value(0, gp_axislv)) global.left_key = (keyboard_check(vk_left) || gamepad_button_check(0, gp_padl) || (-(gamepad_axis_value(0, gp_axislh)))) global.right_key = (keyboard_check(vk_right) || gamepad_button_check(0, gp_padr) || gamepad_axis_value(0, gp_axislh)) global.up_key = (keyboard_check(vk_up) || gamepad_button_check(0, gp_padu) || (-(gamepad_axis_value(0, gp_axislv)))) global.down_keyp = (keyboard_check_pressed(vk_down) || gamepad_button_check_pressed(0, gp_padd) || down_stick) global.left_keyp = (keyboard_check_pressed(vk_left) || gamepad_button_check_pressed(0, gp_padl) || left_stick) global.right_keyp = (keyboard_check_pressed(vk_right) || gamepad_button_check_pressed(0, gp_padr) || right_stick) global.up_keyp = (keyboard_check_pressed(vk_up) || gamepad_button_check_pressed(0, gp_padu) || up_stick) if ((gamepad_button_check_pressed(0, gp_padd)) + (gamepad_button_check_pressed(0, gp_padu)) + (gamepad_button_check_pressed(0, gp_padl)) + (gamepad_button_check_pressed(0, gp_padr)) + down_stick + left_stick + right_stick + up_stick + (gamepad_button_check_pressed(0, global.button1)) + (gamepad_button_check_pressed(0, global.button2)) + (gamepad_button_check_pressed(0, global.button3)) + instance_exists(obj_phone_controls)) global.using_gamepad = true else if keyboard_check(vk_anykey) global.using_gamepad = false if global.using_gamepad { if (global.button1 == gp_face1) global.action_key = "A" else if (global.button1 == gp_face2) global.action_key = "B" else if (global.button1 == gp_face3) global.action_key = "X" else if (global.button1 == gp_face4) global.action_key = "Y" if (global.button2 == gp_face1) global.cancel_key = "A" else if (global.button2 == gp_face2) global.cancel_key = "B" else if (global.button2 == gp_face3) global.cancel_key = "X" else if (global.button2 == gp_face4) global.cancel_key = "Y" if (global.button3 == 32769) global.pause_key = "A" else if (global.button3 == 32770) global.pause_key = "B" else if (global.button3 == 32771) global.pause_key = "X" else if (global.button3 == 32772) global.pause_key = "Y" } else { global.pause_key = "C" global.action_key = "Z" global.cancel_key = "X" } if instance_exists(obj_phone_controls) { global.down_key += obj_phone_controls.phn_down global.left_key += obj_phone_controls.phn_left global.right_key += obj_phone_controls.phn_right global.up_key += obj_phone_controls.phn_up global.down_keyp = sign(global.down_keyp + obj_phone_controls.phn_downp) global.left_keyp = sign(global.left_keyp + obj_phone_controls.phn_leftp) global.right_keyp = sign(global.right_keyp + obj_phone_controls.phn_rightp) global.up_keyp = sign(global.up_keyp + obj_phone_controls.phn_upp) } }
()
4
if (room == rm_mainmenu)
5
{
6
    if (global.left_keyp && p[2] == true)
7
    {
8
        p[2] = false
9
        p[1] = true
10
    }
11
    if (global.right_keyp && p[1] == true)
12
    {
13
        p[2] = true
14
        p[1] = false
15
    }
16
    if global.down_keyp
17
    {
18
        p[1] = false
19
        p[2] = false
20
        p[3] = true
21
    }
22
    if (global.up_keyp && p[3] == true)
23
    {
24
        p[3] = false
25
        p[1] = true
26
    }
27
}
28
else
29
{
30
    if global.down_keyp
31
    {
32
        p[1] = false
33
        p[2] = true
34
    }
35
    if global.up_keyp
36
    {
37
        p[1] = true
38
        p[2] = false
39
    }
40
}
41
if (keyboard_multicheck_pressed(0) == true)
42
{
43
    if (room == rm_mainmenu)
44
    {
45
        if (p[1] == true)
46
        {
47
            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) ...
()
48
            audio_stop_sound(mus)
49
        }
50
        if (p[2] == true)
51
        {
52
            audio_stop_sound(mus)
53
            audio_play_sound(mus_cymbal, 10, 0)
54
            alarm[1] = 1
alarm[1]

alarm[1] = 1 __view_set((0 << 0), 0, ((__view_get((0 << 0), 0)) + (random_range((-sh), sh)))) __view_set((1 << 0), 0, ((__view_get((1 << 0), 0)) + (random_range((-sh), sh)))) sh += 0.01
55
            instance_create(0, 0, obj_transition_white)
56
            waiter = 1
57
        }
58
        if (p[3] == true)
59
        {
60
            audio_stop_sound(mus)
61
            room_goto(rm_config Config screen)
62
        }
63
    }
64
    else
65
    {
66
        if (p[1] == true && (!instance_exists(obj_transition_white)))
67
        {
68
            audio_stop_sound(mus)
69
            audio_play_sound(mus_cymbal, 10, 0)
70
            alarm[1] = 1
alarm[1]

alarm[1] = 1 __view_set((0 << 0), 0, ((__view_get((0 << 0), 0)) + (random_range((-sh), sh)))) __view_set((1 << 0), 0, ((__view_get((1 << 0), 0)) + (random_range((-sh), sh)))) sh += 0.01
71
            instance_create(0, 0, obj_transition_white)
72
            waiter = 1
73
        }
74
        if (p[2] == true)
75
        {
76
            audio_stop_sound(mus)
77
            room = rm_config
78
        }
79
    }
80
}