Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_savegame_flowey

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

function scr_savegame_flowey() //gml_Script_scr_savegame_flowey { ini_open("Save.sav") ini_write_real("Save1", "pX", obj_pl.x) ini_write_real("Save1", "pY", obj_pl.y) ini_write_real("Save1", "dir", obj_pl.direction) var 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", "???") 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) 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) ini_write_string("MailUnclaimed", "0", ds_list_string) ini_write_real("Mail", "1", global.mail_count) for (i = 0; i <= 5; i++) ini_write_real("Misc", string(i + 2), global.sideNpc[i]) var ds_map_string = ds_map_write(global.npc_map) ...
() //gml_Script_scr_savegame_flowey
2
{
3
    ini_open("Save.sav")
4
    ini_write_real("Save1", "pX", obj_pl.x)
5
    ini_write_real("Save1", "pY", obj_pl.y)
6
    ini_write_real("Save1", "dir", obj_pl.direction)
7
    var SavedRoom = room
8
    ini_write_real("Save1", "HP", global.current_hp_self)
9
    ini_write_real("Save1", "MAXHP", global.max_hp_self)
10
    ini_write_real("Save1", "PP", global.current_pp_self)
11
    ini_write_real("Save1", "MAXPP", global.max_pp_self)
12
    ini_write_real("Save1", "SP", global.current_sp_self)
13
    ini_write_real("Save1", "MAXSP", global.max_sp_self)
14
    ini_write_real("Save1", "RP", global.current_rp_self)
15
    ini_write_real("Save1", "MAXRP", global.max_rp_self)
16
    ini_write_real("Save1", "AT - Primary", global.player_attack)
17
    ini_write_real("Save1", "AT - Secondary", global.player_weapon_modifier_attack)
18
    ini_write_real("Save1", "DFP", global.player_defense)
19
    ini_write_real("Save1", "DFS", global.player_armor_modifier_defense)
20
    ini_write_real("Save1", "LV", global.player_level)
21
    ini_write_real("Save1", "EXP", global.player_exp)
22
    ini_write_real("Save1", "Gold", global.player_gold)
23
    ini_write_string("Save1", "Armor", global.player_armor)
24
    ini_write_string("Save1", "Weapon", global.player_weapon)
25
    ini_write_string("Save1", "Ammo", global.player_weapon_modifier)
26
    ini_write_string("Save1", "Accessory", global.player_armor_modifier)
27
    ini_write_string("Save1", "rmName", "???")
28
    ini_write_string("Save1", "playerSprite", global.player_sprites)
29
    ini_write_real("Save1", "playerCanRun", global.player_can_run)
30
    if (global.party_member == noone)
31
        ini_write_string("Save1", "Follower", "noone")
32
    else
33
        ini_write_string("Save1", "Follower", object_get_name(global.party_member))
34
    ini_write_real("Save1", "Satchel", global.player_has_satchel)
35
    ini_write_real("Save1", "FTravel", global.player_can_travel)
36
    scr_determine_playtime
scr_determine_playtime

function scr_determine_playtime() //gml_Script_scr_determine_playtime { var time_new = date_current_datetime() var time_difference = floor(date_second_span(global.saved_datetime, time_new)) global.elapsed_seconds += time_difference global.saved_datetime = time_new }
()
37
    ini_write_real("Playtime", "Seconds", global.elapsed_seconds)
38
    var ds_list_encounters = ds_list_write(global.encounter_list)
39
    ini_write_string("Encounters", "0", ds_list_encounters)
40
    var ds_list_steal = ds_list_write(global.steal_list)
41
    ini_write_string("Steal", "0", ds_list_steal)
42
    var ds_list_fasttravel = ds_list_write(global.fast_travel_list)
43
    ini_write_string("FastTravel", "0", ds_list_fasttravel)
44
    var inv1 = global.item_slot[1]
45
    ini_write_string("Items", "00", global.item_slot[1])
46
    ini_write_string("Items", "01", global.item_slot[2])
47
    ini_write_string("Items", "02", global.item_slot[3])
48
    ini_write_string("Items", "03", global.item_slot[4])
49
    ini_write_string("Items", "04", global.item_slot[5])
50
    ini_write_string("Items", "05", global.item_slot[6])
51
    ini_write_string("Items", "06", global.item_slot[7])
52
    ini_write_string("Items", "07", global.item_slot[8])
53
    var ds_list_string = ds_list_write(global.box_slot_list)
54
    ini_write_string("DBox", "0", ds_list_string)
55
    ini_write_real("Misc", "01", global.tinypuzzle)
56
    for (var i = 0; i < array_length_1d(global.ruins_flag); i++)
57
        ini_write_real("RuinsFlags", string(i), global.ruins_flag[i])
58
    for (i = 0; i < array_length_1d(global.flag); i++)
59
        ini_write_real("Flags", string(i), global.flag[i])
60
    for (i = 0; i < array_length_1d(global.snowdin_flag); i++)
61
        ini_write_real("SnowdinFlags", string(i), global.snowdin_flag[i])
62
    for (i = 0; i < array_length_1d(global.dunes_flag); i++)
63
        ini_write_real("DunesFlags", string(i), global.dunes_flag[i])
64
    for (i = 0; i < array_length_1d(global.dunes_flag_ext); i++)
65
        ini_write_real("DunesFlagsExt", string(i), global.dunes_flag_ext[i])
66
    for (i = 0; i < array_length_1d(global.sworks_flag); i++)
67
        ini_write_real("SworksFlags", string(i), global.sworks_flag[i])
68
    ini_write_string("SworksFlags", "code", global.factory_code)
69
    ds_list_string = ds_list_write(global.factory_code_2)
70
    ini_write_string("SworksFlags", "code2", ds_list_string)
71
    ini_write_string("SworksFlags", "code3", global.factory_code_3)
72
    ini_write_real("SworksFlags", "RbCount", global.sworks_robot_count)
73
    for (i = 0; i < global.sworks_robot_count; i++)
74
    {
75
        ini_write_real("RbSprite", string(i), global.sworks_robot_sprite[i])
76
        ini_write_real("RbX", string(i), global.sworks_robot_x[i])
77
        ini_write_real("RbY", string(i), global.sworks_robot_y[i])
78
        ini_write_real("RbD", string(i), global.sworks_robot_depth[i])
79
        ini_write_real("RbS", string(i), global.sworks_robot_scale[i])
80
        ini_write_real("RbA", string(i), global.sworks_robot_angle[i])
81
    }
82
    ini_write_string("SworksFlags", "sworks_id", ds_grid_write(global.sworks_id_grid))
83
    for (i = 0; i < array_length_1d(global.item_stock); i++)
84
        ini_write_real("ItemStock", string(i), global.item_stock[i])
85
    for (i = 0; i < array_length_1d(global.hotland_flag); i++)
86
        ini_write_real("HotlandFlags", string(i), global.hotland_flag[i])
87
    for (i = 0; i < array_length_1d(global.flowey_flag); i++)
88
        ini_write_real("FloweyFlags", string(i), global.flowey_flag[i])
89
    ini_write_real("FloweyFlags", "savenumber", global.flowey_save_number)
90
    for (i = 0; i < array_length_1d(global.extra_flag); i++)
91
        ini_write_real("ExtraFlags", string(i), global.extra_flag[i])
92
    for (i = 0; i < array_length_1d(global.mail_flag); i++)
93
        ini_write_real("MailFlags", string(i), global.mail_flag[i])
94
    ds_list_string = ds_list_write(global.mail_list)
95
    ini_write_string("Mail", "0", ds_list_string)
96
    ds_list_string = ds_list_write(global.mail_unclaimed_list)
97
    ini_write_string("MailUnclaimed", "0", ds_list_string)
98
    ini_write_real("Mail", "1", global.mail_count)
99
    for (i = 0; i <= 5; i++)
100
        ini_write_real("Misc", string(i + 2), global.sideNpc[i])
101
    var ds_map_string = ds_map_write(global.npc_map)
102
    ini_write_string("NPCs", "0", ds_map_string)
103
    var ds_talk_map_string = ds_map_write(global.talk_map)
104
    ini_write_string("Talks", "0", ds_talk_map_string)
105
    ini_write_real("Misc2", "00", global.interaction_count_wardrobe)
106
    ini_write_real("Misc2", "01", global.interaction_count_broom)
107
    ini_write_real("Misc2", "02", global.interaction_count_mini_fridge)
108
    ini_write_real("Misc2", "03", global.interaction_count_painting)
109
    ini_write_real("Misc2", "04", global.interaction_count_dalvsroom_chest)
110
    ini_write_real("Misc2", "05", global.interaction_count_flower_pot)
111
    ini_write_real("Misc2", "06", global.interaction_count_doorway_dalvshouse)
112
    ini_write_real("Misc2", "07", global.interaction_count_dalvroomhall_door)
113
    ini_write_real("Misc2", "08", global.dalv_house_enter_count)
114
    ini_write_real("Misc2", "09", global.interaction_count_books)
115
    ini_write_real("Deaths", "00", global.death_count_total)
116
    ini_write_real("Deaths", "01", global.death_count[1])
117
    ini_write_real("Deaths", "02", global.death_count[2])
118
    ini_write_real("Route", "00", global.route)
119
    for (i = 1; i < array_length_1d(global.geno_complete); i++)
120
        ini_write_real("GenoComplete", i, global.geno_complete[i])
121
    for (i = 1; i < array_length_1d(global.kill_number); i++)
122
    {
123
        ini_write_real("Kills", i, global.kill_number[i])
124
        for (var j = 0; j < array_length_2d(global.kill_area, i); j++)
125
            ini_write_real("Kill Area", (string(i) + string(j)), global.kill_area[i][j])
126
    }
127
    ini_write_real("Save1", "FUN", global.fun_value)
128
    ini_write_string("Save1", "Menu", sprite_get_name(global.menu_sprite))
129
    if variable_global_exists("gold_amount_total")
130
        ini_write_real("Save1", "gldtrack", global.gold_amount_total)
131
    if variable_global_exists("gold_spent")
132
        ini_write_real("Save1", "gldspnttrack", global.gold_spent)
133
    if variable_global_exists("hit_tracker")
134
        ini_write_real("Save1", "httrack", global.hit_tracker)
135
    if (global.battle_enemy_name == "flowey")
136
    {
137
        global.fighting_flowey = 1
138
        ini_write_real("Misc2", "10", global.fighting_flowey)
139
    }
140
    else if (global.battle_enemy_name == "flowey2")
141
    {
142
        global.fighting_flowey = 2
143
        ini_write_real("Misc2", "10", global.fighting_flowey)
144
    }
145
    ini_close()
146
}