Skip to content

Commit

Permalink
fix: get rid of restart variables to stop all related crashes (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
OH296 authored Jan 13, 2025
1 parent 5e529d7 commit 44055ec
Show file tree
Hide file tree
Showing 11 changed files with 255 additions and 492 deletions.
8 changes: 4 additions & 4 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon9.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy10.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
Expand All @@ -183,7 +184,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy6.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"instructions.txt","CopyToMask":9223372036854775807,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol1.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol2.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",},
Expand Down Expand Up @@ -396,10 +396,10 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"genestealercult.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"hulk.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"sector.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"space_marine.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"star.json","CopyToMask":-1,"filePath":"datafiles/main/names",},
Expand Down Expand Up @@ -1447,6 +1447,6 @@
],
"templateType": null,
"TextureGroups": [
{"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,},
{"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,},
],
}
Binary file modified fonts/fnt_menu/fnt_menu.old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fonts/fnt_menu/fnt_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions objects/obj_controller/Alarm_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ instance_activate_object(obj_star);
if (instance_exists(obj_ini)) and (global.load==0){
alarm[1]=2;
instance_activate_object(obj_star);
instance_activate_object(obj_restart_vars);
instance_activate_all();
}
instance_activate_object(obj_restart_vars);
3 changes: 0 additions & 3 deletions objects/obj_controller/Alarm_1.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Sets up the sector spawn and assigns spawned enemies to the sector
instance_activate_object(obj_star);
instance_activate_object(obj_restart_vars);
instance_activate_all();

// Should determine here, randomly what sort of enemy planets there are
Expand Down Expand Up @@ -627,8 +626,6 @@ for(var i=0; i<100; i++){
}
// End craftworld

scr_restart_variables(2);

if (!instance_exists(obj_saveload)) and (instance_exists(obj_creation)) and (global.load=0){
for(var i=1; i<=10; i++){
if (obj_creation.world[i]!=""){
Expand Down
4 changes: 2 additions & 2 deletions objects/obj_creation/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,8 @@ if (global.restart>0){
slide=2;
slide_show=2;

scr_restart_variables(4);
with(obj_restart_vars){instance_destroy();}
reset_creation_variables();
//with(obj_restart_vars){instance_destroy();}
global.restart=0;
}

Expand Down
2 changes: 0 additions & 2 deletions objects/obj_saveload/Alarm_1.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ obj_cursor.image_alpha=1;obj_controller.cooldown=20;


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

with(obj_ini){instance_destroy();}
room_goto(Creation);
Expand Down
4 changes: 0 additions & 4 deletions scripts/scr_initialize_custom/scr_initialize_custom.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3141,10 +3141,6 @@ function scr_initialize_custom() {
// obj_controller.marines-=commands;


instance_create(0, 0, obj_restart_vars);
scr_restart_variables(1);


scr_add_item("Bolter", 20);
scr_add_item("Chainsword", 20);
scr_add_item("Bolt Pistol", 5);
Expand Down
147 changes: 1 addition & 146 deletions scripts/scr_load/scr_load.gml
Original file line number Diff line number Diff line change
Expand Up @@ -565,27 +565,6 @@ function scr_load(save_part, save_id) {
ini_open("tsave.ini");
// file_delete("tsave.ini");

var i=0;
obj_controller.restart_name=ini_read_string("Res","nm","");
obj_controller.restart_founding=ini_read_real("Res","found",0);
obj_controller.restart_secret=ini_read_string("Res","secre","");
obj_controller.restart_title[0]=ini_read_string("Res","tit0","");
var i;i=0;repeat(11){i+=1;obj_controller.restart_title[i]=ini_read_string("Res","tit"+string(i),"");}
obj_controller.restart_icon=ini_read_real("Res","ico",0);
obj_controller.restart_icon_name=ini_read_string("Res","icn","");
obj_controller.restart_powers=ini_read_string("Res","power","");
var ad;ad=-1;repeat(5){ad+=1;obj_controller.restart_adv[ad]=ini_read_string("Res","adv"+string(ad),"");obj_controller.restart_dis[ad]=ini_read_string("Res","dis"+string(ad),"");}
obj_controller.restart_recruiting_type=ini_read_string("Res","rcrtyp","");
obj_controller.restart_trial=ini_read_string("Res","trial","");
obj_controller.restart_recruiting_name=ini_read_string("Res","rcrnam","");
obj_controller.restart_home_type=ini_read_string("Res","homtyp","");
obj_controller.restart_home_name=ini_read_string("Res","homnam","");
obj_controller.restart_flagship_name=ini_read_string("Res","flagship","");
obj_controller.restart_fleet_type=ini_read_real("Res","flit",0);
obj_controller.restart_recruiting_exists=ini_read_real("Res","recr_e",0);
obj_controller.restart_homeworld_exists=ini_read_real("Res","home_e",0);
obj_controller.restart_homeworld_rule=ini_read_real("Res","home_r",0);
obj_controller.restart_battle_cry=ini_read_string("Res","cry","");


with(obj_controller){
Expand All @@ -596,131 +575,7 @@ function scr_load(save_part, save_id) {
// star_ui_name_node();
}

var tempa,tempa2,q,good;tempa="";tempa2=0;q=0;good=0;

tempa = ini_read_string("Res", "maincol", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_main_color = tempa2;

tempa = ini_read_string("Res", "seccol", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_secondary_color = tempa2;

tempa = ini_read_string("Res", "tricol", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_trim_color = tempa2;

tempa = ini_read_string("Res", "paul2col", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_pauldron2_color = tempa2;

tempa = ini_read_string("Res", "paul1col", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_pauldron_color = tempa2;

tempa = ini_read_string("Res", "lenscol", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_lens_color = tempa2;

tempa = ini_read_string("Res", "wepcol", "");
tempa2 = 0;
q = 0;
good = 0;
for(var q=0; q<global.colors_count; q++){
if (tempa = obj_controller.col[q]) and(good = 0) {
good = q;
tempa2 = q;
}
}
obj_controller.restart_weapon_color = tempa2;

//

obj_controller.restart_col_special=ini_read_real("Res","speccol",0);
obj_controller.restart_trim=ini_read_real("Res","trim",0);
obj_controller.restart_skin_color=ini_read_real("Res","skin",0);
obj_controller.restart_hapothecary=ini_read_string("Res","hapo","");
obj_controller.restart_hchaplain=ini_read_string("Res","hcha","");
obj_controller.restart_clibrarian=ini_read_string("Res","clib","");
obj_controller.restart_fmaster=ini_read_string("Res","fmas","");
obj_controller.restart_recruiter=ini_read_string("Res","recruiter","");
obj_controller.restart_admiral=ini_read_string("Res","admir","");
obj_controller.restart_equal_specialists=ini_read_real("Res","eqspec",0);
if (ini_read_string("Res","load2",0)!= 0){
obj_controller.restart_load_to_ships = json_parse(base64_decode(ini_read_string("Res","load2",0)));
} else { obj_controller.restart_load_to_ships=[0,0,0]}
obj_controller.restart_successors=ini_read_string("Res","successors",0);

obj_controller.restart_mutations=ini_read_real("Res","muta",0);
obj_controller.restart_preomnor=ini_read_real("Res","preo",0);
obj_controller.restart_voice=ini_read_real("Res","voic",0);
obj_controller.restart_doomed=ini_read_real("Res","doom",0);
obj_controller.restart_lyman=ini_read_real("Res","lyma",0);
obj_controller.restart_omophagea=ini_read_real("Res","omop",0);
obj_controller.restart_ossmodula=ini_read_real("Res","ossm",0);
obj_controller.restart_membrane=ini_read_real("Res","memb",0);
obj_controller.restart_zygote=ini_read_real("Res","zygo",0);
obj_controller.restart_betchers=ini_read_real("Res","betc",0);
obj_controller.restart_catalepsean=ini_read_real("Res","catal",0);
obj_controller.restart_secretions=ini_read_real("Res","secr",0);
obj_controller.restart_occulobe=ini_read_real("Res","occu",0);
obj_controller.restart_mucranoid=ini_read_real("Res","mucra",0);
obj_controller.restart_master_name=ini_read_string("Res","master_name","");
obj_controller.restart_master_melee=ini_read_real("Res","master_melee",0);
obj_controller.restart_master_ranged=ini_read_real("Res","master_ranged",0);
obj_controller.restart_master_specialty=ini_read_real("Res","master_specialty",0);
obj_controller.restart_strength=ini_read_real("Res","strength",0);
obj_controller.restart_cooperation=ini_read_real("Res","cooperation",0);
obj_controller.restart_purity=ini_read_real("Res","purity",0);
obj_controller.restart_stability=ini_read_real("Res","stability",0);

obj_controller.squads = false;

i=99;
Expand Down
Loading

0 comments on commit 44055ec

Please sign in to comment.