Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework/save load system #209

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 419 additions & 0 deletions objects/obj_controller/Create_0.gml

Large diffs are not rendered by default.

391 changes: 374 additions & 17 deletions objects/obj_ini/Create_0.gml

Large diffs are not rendered by default.

147 changes: 113 additions & 34 deletions objects/obj_saveload/Alarm_0.gml
Original file line number Diff line number Diff line change
@@ -1,57 +1,136 @@
// SAVE

if (save_part=6){txt="Praise to the Machine God";with(obj_controller){scr_save(5,obj_saveload.save_number);}trickle=50;}

if (save_part=5){txt="Astartes Registry";with(obj_controller){scr_save(4,obj_saveload.save_number);}trickle=40;save_part=6;}
if(save_part = 1){
txt = "Praise to the Machine God";
with(obj_controller) {
scr_save(1, obj_saveload.save_number, obj_saveload.save_file);
}
obj_saveload.save[save_number] = 1;
trickle = 5;
}

if (save_part=4){txt="Sacred Anointing of Oil";with(obj_controller){scr_save(3,obj_saveload.save_number);}trickle=10;save_part=5;}
/*

if (save_part=3){txt="Charting Sector";with(obj_controller){scr_save(2,obj_saveload.save_number);}trickle=10;save_part=4;}
if (save_part = 6) {
txt = "Praise to the Machine God";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll re-add these last

with(obj_controller) {
scr_save(5, obj_saveload.save_number, _save_file);
}
trickle = 50;
}

if (save_part=2){txt="Finding Servo Skulls";with(obj_controller){scr_save(1,obj_saveload.save_number);}trickle=10;save_part=3;}
if (save_part = 5) {
txt = "Astartes Registry";
with(obj_controller) {
scr_save(4, obj_saveload.save_number, _save_file);
}
trickle = 40;
save_part = 6;
}

if (save_part=1){
if (file_exists("save"+string(save_number)+".ini")) then file_delete("save"+string(save_number)+".ini");
if (file_exists("screen"+string(save_number)+".png")) then file_delete("screen"+string(save_number)+".png");
ini_open("saves.ini");ini_section_delete(string(save_number));ini_close();
obj_saveload.save[save_number]=0;
save_part+=1;trickle=10;
txt="Preparing";
if (save_part = 4) {
txt = "Sacred Anointing of Oil";
with(obj_controller) {
scr_save(3, obj_saveload.save_number, _save_file);
}
trickle = 10;
save_part = 5;
}

if (save_part = 3) {
txt = "Charting Sector";
with(obj_controller) {
scr_save(2, obj_saveload.save_number, _save_file);
}
trickle = 10;
save_part = 4;
}

if (save_part = 2) {
txt = "Finding Servo Skulls";
with(obj_controller) {
scr_save(1, obj_saveload.save_number, _save_file);
}
trickle = 10;
save_part = 3;
}

if (save_part = 1) {
if (file_exists(_save_file)) then file_delete(_save_file);
if (file_exists("screen" + string(save_number) + ".png")) then file_delete("screen" + string(save_number) + ".png");
ini_open("saves.ini");
ini_section_delete(string(save_number));
ini_close();
obj_saveload.save[save_number] = 0;
save_part += 1;
trickle = 10;
txt = "Preparing";
}
*/

// LOAD

if (load_part = 6) {
txt = "Praise to the Machine God";
if (global.restart > 0) then txt = "Praise be to the Emperor";
with(obj_controller) {
scr_load(5, global.load);
}
trickle = 50;

if (instance_exists(obj_cuicons)) {
obj_cuicons.alarm[1] = 30;
}

}

if (load_part=6){
txt="Praise to the Machine God";if (global.restart>0) then txt="Praise be to the Emperor";with(obj_controller){scr_load(5,global.load);}trickle=50;

if (instance_exists(obj_cuicons)){
obj_cuicons.alarm[1]=30;
if (load_part = 5) {
txt = "Sacred Anointing of Oil";
if (global.restart > 0) then txt = "Speed Dialing Howling Banshee";
with(obj_controller) {
scr_load(4, global.load);
}

trickle = 10;
load_part = 6;
}

if (load_part=5){txt="Sacred Anointing of Oil";if (global.restart>0) then txt="Speed Dialing Howling Banshee";with(obj_controller){scr_load(4,global.load);}trickle=10;load_part=6;}

if (load_part=4){
with(obj_star){if (x2>5) and (y2>5) then buddy=instance_nearest(x2,y2,obj_star);}
txt="Astartes Registry";if (global.restart>0) then txt="Donning Power Armour";with(obj_controller){scr_load(3,global.load);}trickle=40;load_part=5;
if (load_part = 4) {
with(obj_star) {
if (x2 > 5) and(y2 > 5) then buddy = instance_nearest(x2, y2, obj_star);
}
txt = "Astartes Registry";
if (global.restart > 0) then txt = "Donning Power Armour";
with(obj_controller) {
scr_load(3, global.load);
}
trickle = 40;
load_part = 5;
}

if (load_part=3){txt="Charting Sector";if (global.restart>0) then txt="Rousing the Machine Spirit";with(obj_controller){scr_load(2,global.load);}trickle=10;load_part=4;}

if (load_part=2){txt="Finding Servo Skulls";if (global.restart>0) then txt="Turtle Waxing Scalp";with(obj_controller){scr_load(1,global.load);}trickle=10;load_part=3;}

if (load_part=1){
if (file_exists("save"+string(global.load)+".ini")){
load_part+=1;
trickle=10;
txt="Preparing";
if (load_part = 3) {
txt = "Charting Sector";
if (global.restart > 0) then txt = "Rousing the Machine Spirit";
with(obj_controller) {
scr_load(2, global.load);
}
trickle = 10;
load_part = 4;
}

if (load_part = 2) {
txt = "Finding Servo Skulls";
if (global.restart > 0) then txt = "Turtle Waxing Scalp";
with(obj_controller) {
scr_load(1, global.load);
}
trickle = 10;
load_part = 3;
}


if (load_part = 1) {
if (file_exists("save" + string(global.load) + ".ini")) {
load_part += 1;
trickle = 10;
txt = "Preparing";
}
}
23 changes: 12 additions & 11 deletions objects/obj_saveload/Alarm_1.gml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
obj_controller.menu = 0;
obj_controller.zui = 0;
obj_controller.invis = false;
obj_cursor.image_alpha = 1;
obj_controller.cooldown = 20;

obj_controller.menu=0;obj_controller.zui=0;obj_controller.invis=false;
obj_cursor.image_alpha=1;obj_controller.cooldown=20;


if (global.restart>0){
instance_create(0,0,obj_restart_vars);
if (global.restart > 0) {
instance_create(0, 0, obj_restart_vars);
scr_restart_variables(3);

with(obj_ini){instance_destroy();}

with(obj_ini) {
instance_destroy();
}
room_goto(Creation);
}

instance_destroy();


instance_destroy();
6 changes: 2 additions & 4 deletions objects/obj_saveload/Alarm_2.gml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
screen_save("screen" + string(save_number) + ".png");

screen_save("screen"+string(save_number)+".png");

alarm[3]=1;

alarm[3] = 1;
7 changes: 3 additions & 4 deletions objects/obj_saveload/Alarm_3.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
hide=0;
obj_controller.invis=false;
obj_controller.zui=1;

hide = 0;
obj_controller.invis = false;
obj_controller.zui = 1;
28 changes: 16 additions & 12 deletions objects/obj_saveload/Alarm_4.gml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@


if (sprite_exists(img1)){sprite_delete(img1);}
if (sprite_exists(img2)){sprite_delete(img2);}
if (sprite_exists(img3)){sprite_delete(img3);}
if (sprite_exists(img4)){sprite_delete(img4);}
if (file_exists(working_directory + "\\screen"+string(save[top])+".png")) then img1=sprite_add(working_directory + "\\screen"+string(save[top])+".png",1,0,0,0,0);
if (file_exists(working_directory + "\\screen"+string(save[top+1])+".png")) then img2=sprite_add(working_directory + "\\screen"+string(save[top+1])+".png",1,0,0,0,0);
if (file_exists(working_directory + "\\screen"+string(save[top+2])+".png")) then img3=sprite_add(working_directory + "\\screen"+string(save[top+2])+".png",1,0,0,0,0);
if (file_exists(working_directory + "\\screen"+string(save[top+3])+".png")) then img4=sprite_add(working_directory + "\\screen"+string(save[top+3])+".png",1,0,0,0,0);


if (sprite_exists(img1)) {
sprite_delete(img1);
}
if (sprite_exists(img2)) {
sprite_delete(img2);
}
if (sprite_exists(img3)) {
sprite_delete(img3);
}
if (sprite_exists(img4)) {
sprite_delete(img4);
}
if (file_exists(working_directory + "\\screen" + string(save[top]) + ".png")) then img1 = sprite_add(working_directory + "\\screen" + string(save[top]) + ".png", 1, 0, 0, 0, 0);
if (file_exists(working_directory + "\\screen" + string(save[top + 1]) + ".png")) then img2 = sprite_add(working_directory + "\\screen" + string(save[top + 1]) + ".png", 1, 0, 0, 0, 0);
if (file_exists(working_directory + "\\screen" + string(save[top + 2]) + ".png")) then img3 = sprite_add(working_directory + "\\screen" + string(save[top + 2]) + ".png", 1, 0, 0, 0, 0);
if (file_exists(working_directory + "\\screen" + string(save[top + 3]) + ".png")) then img4 = sprite_add(working_directory + "\\screen" + string(save[top + 3]) + ".png", 1, 0, 0, 0, 0);
Loading