Nixxi
Member
This is a brand new bug I'm running into and I have no idea how I got it, been over the code several times and I probably just need fresh eyes to look at it. Here's what I have:
rm_Start is the first room to load. It creates one instance of obj_SYS and this object initializes all globals/enums/macros/etc. The object also creates an instance called "obj_StartLogos" that rolls through some images for my collaborators. When it is done it should destroy itself and flag a variable "obj_SYS.b_LogosPlayed" to true. The obj_SYS instance should then create four (4) instances for the player UIs, and go to the next room (rm_HomeScreen) - except, it doesn't get that far. The UI objects are never created and the room never transitions; the game is frozen and unresponsive.
Here's my obj_SYS 'step' code:
... This is the obj_StartLegal 'step' code:
... And here is my obj_StartLogos 'step' code:
I also have one instance of obj_DEBUG which monitors and draws all the data changes in obj_StartLogos - just before the game freezes the i_Slide variable ticks up to 4, but b_ShouldHaveFinished never gets set to true and the game locks up. Can anyone figure this out?
rm_Start is the first room to load. It creates one instance of obj_SYS and this object initializes all globals/enums/macros/etc. The object also creates an instance called "obj_StartLogos" that rolls through some images for my collaborators. When it is done it should destroy itself and flag a variable "obj_SYS.b_LogosPlayed" to true. The obj_SYS instance should then create four (4) instances for the player UIs, and go to the next room (rm_HomeScreen) - except, it doesn't get that far. The UI objects are never created and the room never transitions; the game is frozen and unresponsive.
Here's my obj_SYS 'step' code:
Code:
/// @description Start Slides
if !instance_exists(obj_StartLegal) && !b_LegalPlayed {
// Start Legal Slide
instance_create_layer(0,0,global.l_HUD_01,obj_StartLegal);
}
if !instance_exists(obj_StartLogos) && !b_LogosPlayed && b_LegalPlayed {
// Start Logos Rolling
instance_create_layer(0,0,global.l_HUD_01,obj_StartLogos);
}
if b_LegalPlayed && b_LogosPlayed {
// Spawn Player Cards
for (var pc = 0; pc < 4; pc += 1) {
var TEMP = instance_create_layer(240*pc,0,global.l_HUD_00,obj_PlayerCard_UI);
with(TEMP) {
p_PlayerController = pc;
}
}
// Go to the Home Screen
i_GameStatus = enum_GameState.menu_HomeScreen
room_goto(rm_HomeScreen);
}
Code:
/// @description Timing for Legal Screen
if !b_Fade {
if f_Alpha < 1.00 {
f_Alpha += 0.02;
} else if i_Time >= 0 {
i_Time -= 1;
} else {
b_Fade = true;
}
} else {
if f_Alpha > 0.00 {
f_Alpha -= 0.02;
} else {
obj_SYS.b_LegalPlayed = true;
instance_destroy();
}
}
Code:
/// @description Count Slides, Timing, and Alpha
switch i_Slide {
case 0:
// NIM Logo
if !b_Fade {
if f_Alpha < 1.00 {
f_Alpha += 0.02;
} else {
if i_Time > 0 {
i_Time -= 1;
} else {
b_Fade = true;
}
}
} else {
if f_Alpha > 0.00 {
f_Alpha -= 0.02;
} else {
i_Slide += 1;
i_Time = 180;
b_Fade = false;
}
}
break;
case 1:
// GMS2 Logo
if !b_Fade {
if f_Alpha < 1.00 {
f_Alpha += 0.02;
} else {
if i_Time > 0 {
i_Time -= 1;
} else {
b_Fade = true;
}
}
} else {
if f_Alpha > 0.00 {
f_Alpha -= 0.02;
} else {
i_Slide += 1;
i_Time = 300;
b_Fade = false;
}
}
break;
case 2:
// "Help Wanted"
if !b_Fade {
if f_Alpha < 1.00 {
f_Alpha += 0.02;
} else {
if i_Time > 0 {
i_Time -= 1;
} else {
b_Fade = true;
}
}
} else {
if f_Alpha > 0.00 {
f_Alpha -= 0.02;
} else {
i_Slide += 1;
i_Time = 60;
b_Fade = false;
}
}
break;
case 3:
// Blackout Room
if f_Alpha < 1.00 {
f_Alpha += 0.01;
} else {
if i_Time > 0 {
i_Time -= 1;
} else {
i_Slide += 1;
}
}
break;
case 4:
// For debug purposes
b_ShouldHaveFinished = true;
// Set flag to true
obj_SYS.b_LogosPlayed = true;
// Destroy
instance_destroy();
break;
default:
// For debug purposes
b_ShouldHaveFinished = true;
// Set flag to true
obj_SYS.b_LogosPlayed = true;
// Destroy
instance_destroy();
break;
}