4 |
scr_savegamescr_savegamefunction 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)
... () |
7 |
scr_loadgamescr_loadgamefunction 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)
... () |