-
Notifications
You must be signed in to change notification settings - Fork 29
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
GalacticChimp
wants to merge
14
commits into
Adeptus-Dominus:main
Choose a base branch
from
GalacticChimp:rework/save-load-system
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,351
−2,748
Draft
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
485fdef
Initial code cleanup and beautification
GalacticChimp 915f39c
small cleanup
GalacticChimp 7734709
Prepared basic setup for new save system
GalacticChimp 73a4dd2
good progress on serialization
GalacticChimp 6260b1f
about 33% of save part of the save system rework is done
GalacticChimp c7b9bfe
only saving non-empty entities now + storing indexes
GalacticChimp e19f6d8
obj_controller now gets serialized to json (finished about 66% of sav…
GalacticChimp 91ff3f4
Merge branch 'main' into rework/save-load-system
GalacticChimp 4fdc99e
Merge branch 'main' into rework/save-load-system
GalacticChimp 9abf44e
Serialized remaining global stuff
GalacticChimp 1aa577a
everything should be serialized now
GalacticChimp 67974b5
simplified serialization in obj_controller and obj_ini
GalacticChimp 5b71dc1
Merge branch 'main' into rework/save-load-system
GalacticChimp 9751429
small faction enum tweaks
GalacticChimp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
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"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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