Legacy GM Issue with Room Transition

M

MANGOSENTINEL

Guest
Hi GMC, I've been struggling with a weird problem for the last few days with Room Transitions. Fundamentally, my code is fine, it moves my game to it's next room after going to various cutscene rooms.

My issue is that the previous level is visible for the first frame of the next level and I'm not really sure why? I would assume it's objects doing some kind of action in their step event from the previous room that are finishing before the next level starts? I've been looking around for anyone having a similar error but I can't just put my finger on what is causing this 100%

What I expect to happen:

Level victory event triggers when an object collides w/ another object
"VICTORY" cutscene
"LEVEL TO LEVEL" transition cutscene
NEXT LEVEL STARTS

This basic structure of this is working, but that split second frame flash of the last level is super unprofessional looking and driving me crazy . It's not a coding issue so I think it's a fundamental misunderstanding I have?

Any help would be great, thanks in advance!
 
M

MANGOSENTINEL

Guest
I wouldn't even know where to start posting code honestly, it seems like every object in the room could be causing it so that's why I was asking if there was like a overarching concept I was missing.

Here is the actual transition code though:

///Game WIN event
if global.level1VICTORY = true && global.textboxspawn1 = false
{
room_speed = 10000
global.resourcemenu = false
global.spawn_menu = false
global.obj_cursor_x = obj_KING.x
global.obj_cursor_y = obj_KING.y

with obj_class_minion
{
instance_destroy()
}
with obj_camera
{
instance_destroy()
}
with obj_wavespawner_top_1
{
instance_destroy()
}
with obj_wavespawner_mid_1
{
instance_destroy()
}
with obj_wavespawner_bot_1
{
instance_destroy()
}
instance_create(view_xview[0] +64 , view_yview[0] + 960,obj_textbox_1)
global.textboxspawn1 = true
}

if !instance_exists(obj_textbox_1) && global.textboxspawn1 = true && global.Level1VICTORY = true && keyboard_check(vk_space)
{
room_goto(LEVEL1_VICTORY)
}

What this code is looking to achieve:

Destroy the camera object so the screen locks in place

Destroy all unit spawning entities so that new units aren't created

Destroy all units so none of their step events could be happening

Set all GUI elements invisible

Move the game's view to where the level victory event is happening

Spawn a textbox with some level ending dialogue

I'm attempting to recreate something akin to the Advance Wars series victory scenario:

The camera snaps to where the victory event happens (Where the obj_KING collides with the trigger object)
A textbox appears and has some dialogue between characters
When the dialogue box ends, it destroys itself and the level advances to the next room
 
M

MANGOSENTINEL

Guest
Still been mulling this problem over without any real solution, and I can't seem to find any tutorials that present this as an issue. My theory is that it's either global varibles or a step event issue but I'm not sure what is actually causing it.
 
T

The Green Dev

Guest
??? why dont you use draw and stuff for the text box and things? also you dont need to destroy everything.
 
M

MANGOSENTINEL

Guest
The textbox object is a script that I'm calling

The reason I'm destroying everything is my assumption that things with step events are causing that frame blip of the previous level before I advance to the next level
 

TheouAegis

Member
Well if you destroy everything and it is still causing the issue, then those instances weren't the source of the problem. The frame flash suggests a surface isn't getting flushed.
 
M

MANGOSENTINEL

Guest
My textbox script does call a surface, so maybe that would be causing the issue. I will look into making sure the surface is freed? It should be but that seems like a strong possibility at this point
 
M

MANGOSENTINEL

Guest
After removing every object that creates a surface in my transition sequence, I'm still seeing the frame flash, so I guess it could be as global variable? Is that possible outcome? Otherwise I'm totally stumped.
 
M

MANGOSENTINEL

Guest
Even after tweaking with my global variables I'm still having some issues. Will post an update for other people having this issue if I can figure something out
 
Top