Extremely helpful as always... My original system for transitions is soooo much more needlessly complicated than this, and I'll be glad to be rid of that now!
To those people wanting to draw on the GUI layer, simply create a object with that sprite and create a sequence using that object instead of the sPixel. Then, change the object Draw event to a Draw GUI event where it draws itself :D
Hey, I'm having a weird issue where I can't see the transition when I have viewports enabled. If I disable it I see the Sequence for fading out fine, but when I enable it and my camera get's involved, no matter what position I put the layer in I just cant seem to see the transition sequence.
im having a small problem where everytime i die in a level i play the out transition, reset the room and then play an in transition which works fine but the origin of the in transition is where the camera was whenever i died instead of where the camera is when the room resets so the black bars are just not where they’re supposed to be. anyone know of a fix? i cant find many ways to effect transitions once theyve started playing
I dunno if it's a new thing or a problem with Gamemaker, but this method doesn't permanently delete the "fade in" sequence layer. If you have to reset the room you transitioned to or go back into it, the fade out animation plays again. The code deletes the sequence once, but it just gets put back into the room once the room is reloaded.
I'm having this same issue and I've gone through hours of debugging. I've proven that the same self.elementID is being created/destroyed and then, somehow, the same exact self.elementID is re-created/destroyed without the Transition functions being called. None of my rooms are persistent, and the instance initially calling TransitionStart() is not persistent either. I've even tried destroying the "Transition" layer at the end of TransitionFinished(), to no avail. I wonder if this is a bug within the engine.
@@MoltiSanti are you two drawing oPixel on a GUI layer? because that was the problem for me, and as soon as i made it draw itself normally it fixed itself
@@sinistar I don't believe I was. Anyway, I scrapped sequences for now and I'm using my own system with an object that just draws a fading rectangle in the Draw GUI End event when transitioning. I appreciate the info, though.
my seqence is not filling out the screen, instead it happens in the corner of my screen, my rooms and sequences are all set to 1280x720, not really sure why it does this ? Edit: 1:10 this part is what i skipped, didnt think it would be that important, but it was, so gonna leave this here in case some one else makes the same mistake i did.
In my project, the layer sequence is invisible or is not created, I'm not sure, the transition works, but the sequence itself does not appear, visually I mean, how can I solve this? * I hope I spelled correctly, English is not my language.
Anyone knows how to permanently remove this sequence from playing. I do code to place this sequence in the room only once. Then I leave the room and go back in (without doing code to place sequence in that room again) but sequence is playing again every time I enter the room. Looks like when I place this sequence in the specific room it is there permanently and even if sequence is destroying itself it's not helping :( you enter the room again and it's still there.
I'm having this same issue and I've gone through hours of debugging. I've proven that the same self.elementID is being created/destroyed and then, somehow, the same exact self.elementID is re-created/destroyed without the Transition functions being called. None of my rooms are persistent, and the instance initially calling TransitionStart() is not persistent either. I've even tried destroying the "Transition" layer at the end of TransitionFinished(), to no avail. I wonder if this is a bug within the engine.
I'm having a lot of trouble getting this to work with a moving camera. Code: layer_sequence_create(_lay,camera_get_view_x(CAM),camera_get_view_y(CAM),_type); (CAM is just view[0]) If I use this code, the fade out works great, but the fade in doesn't show up at all. I think that the fade in is still appearing in the same position as the fade out, so if I fade out in a spot other than (0,0) the fade in doesn't show up at all. Any help would be appreciated! Thanks!
@@SaraSpalding Thanks for your help! I'm assuming I should use similar code to parallax scrolling. If so, and if I use the function layer_sequence_exists(), how would I get the sequence_element_id in the camera object?
If anybody from the future is reading this, here is my solution: Code: //Last line of the TransitionPlaceSequence function global.sequenceLayer = layer_sequence_create(_lay,camera_get_view_x(CAM),camera_get_view_y(CAM),_type); and //In the camera object after it gets the camera's position if (layer_sequence_exists("transition",global.sequenceLayer)) { layer_sequence_x(global.sequenceLayer,_curX); layer_sequence_y(global.sequenceLayer,_curY); } (_curX and _curY is just the current x and y position of my camera)
@GamePerson Hey, I don't have a lot of information to go off of based on your video. As far as I can tell it seems like your fade in is spawning at the wrong (x,y) coordinate. So first, make sure you declared your global.seqeunceLayer variable with the rest of the global variables in the Transition script. Second, change that your fade out will spawn in the top left of the screen instead of the middle. Try messing around with the origin point of your fade in sequence for instance. Your game looks awesome by the way!
@GamePerson Hey, I'm experiencing the same issue as you and I think there's actually two problems going on. The first is that you're setting the transition to the camera's x and y, but you actually want to offset it. // In camera's step after calling camera_set_view_pos ... layer_sequence_x(global.sequenceLayer,x-view_w_half); layer_sequence_y(global.sequenceLayer,y-view_h_half); I define those halves as follows... view_w_half = camera_get_view_width(cam) * 0.5; view_h_half = camera_get_view_height(cam) * 0.5; There's also a second issue you should be experiencing, which is that the camera update code isn't actually running during the first transition. I'm not sure why it's correctly placed, but if you add some show_debug_message code to the camera update you'll see that it is only ever executed during the second sequence. I believe this is due to... TransitionPlaceSequence(_typeOut); // sets global.sequenceLayer layer_set_target_room(_roomTarget) TransitionPlaceSequence(_typeIn); // overwrites global.sequenceLayer layer_reset_target_room(); // Camera step should now be referencing that second global.sequenceLayer, which doesn't exist in the current room so the if check fails So what I did that seems to have ended up working, and this may take some unhackery for a production, was I put this code at the end of my camera step instead of the first snippet of code I mentioned in this comment ... if(layer_exists(layer_get_id("transition"))) { var _a = layer_get_all_elements(layer_get_id("transition")) if( array_length(_a) > 0 ) { // This code very clearly assumes that there will only be one sequence in this layer, it's the "hack" but works for 1 single sequence layer_sequence_x(_a[0],x-view_w_half); layer_sequence_y(_a[0],y-view_h_half); } } Hopefully this works for you, too! I'd love a more well thought out answer / solution but this seems to be doing the trick at the moment...
Sorry to reply to an old post, I just wanted to help anyone who might run into this problem in the future. If you're referring to the first line in the TransitionFinished script: layer_sequence_destroy(self.elementID); it doesn't work because "self" is broken in YYC. "Self" internally is -1, and in is easily taken out of context and can cause errors. You can simply replace it with layer_sequence_destroy(global.sequenceLayer); and it will work in YYC, but it becomes a little less modular, since it can only delete the one sequence stored in that variable. This shouldn't be a problem with the code used in the tutorial. Note: "other" = -2, "all" = -3, and "noone" = -4, but those seem to work properly in YYC as far as I've seen. Only "self" is broken, and functionally nearly identical to "id", but not in this specific case. I've heard it is best practice avoid "self" and use "id" instead.
@@myPlaceholderName Wow, first time hearing "self" is broken on YYC! Will look into it for sure. It must affect object instances only, because I use "self" all the time in my struct's methods, since 2.3. Thanks man!
@@S_Tadz I'm mostly citing information I've read elsewhere that has helped me, but it might be dated by now. At one point "self" was an abandoned function because it was too similar to "id" but there is a chance Yoyo games have tried to fix up "self" since then. If it works for you, then that's great, but it still seems a little buggy.
This seems to only work if you have a single-screen game, or if you start the room at the top-left corner. Otherwise, the fade out sequence isn't glued to the camera position, and it may only show up partially on the screen, or not at all. Or am I doing something wrong?
@@SaraSpalding Ah okay, I did miss that part. Unfortunately, for my game, that still doesn't work, because I have a camera object that automatically snaps the view to my player at the beginning of the room, wherever that player object happens to be, so the view that's set in the room properties changes immediately when the room starts, and the sequence, obviously, doesn't follow. Ah well. Thanks anyway! Maybe I'll try these snazzier sequence transitions in my next project!
@@SaraSpalding Huh. Okay, I'll give that a try. If I understand correctly, you mean to have my camera object always check if the transition layer exists and if it does, move it to the view position? Thanks, I really appreciate the help!
Hi Shaun :) Quick Question.. I have a 3 rooms. Between Room 2 and 3 I setup the transition. When I do a game_restart() during the the fade in transition in room 3 the transition not longer works and the game gets stuck at the end of room2 during the next time. Do you know why this happens? Probably sth. with memory right?
ahh.. reading the manual.. GAME_ RESTART: "However it should be noted that global variables will not be re-initialised unless explicitly coded as such" ... I think thats it :)
ok now i got it.. since the script that initializes the transition sequences is global, its not be reinitialized on game_start. Therefore I had to set the mid.transition variable to false at the create event of the first room.. now it works.. sorry for spamming :)
You sir are an amazing human, spent the last 3 hours trying to bug fix why this was happening on restart, as you said just had to put Room Start Event - midTransition = false, solved everything
For me this resulted in both the fade out and fade in happening before going to the next room. I watched the video a second time and all the code is right. Any ideas why this is?
Hello, I followed this tutorial exactly besides renaming a few variables, and the game refuses to spawn in the transition sequence when I call the transition function. Can someone please tell me what's going wrong here? ///Room transition functions global.transition = false; global.targetRoom = -1; //Place the sequence function TransitionPlaceSequence(seq) { if layer_exists("transition") {layer_destroy("transition")}; var l = layer_create(-9999,"transition"); global.test = layer_sequence_create(l,0,0,seq); } //Initiate a transition function Transition(targetRoom,seqOut,seqIn) { if !global.transition { //Make sure one's not already happening global.transition = true; global.targetRoom = targetRoom; TransitionPlaceSequence(seqOut);
//Place the transition in sequence in the target room layer_set_target_room(targetRoom); TransitionPlaceSequence(seqIn); layer_reset_target_room();
return true; //Success! } else return false; //Unable to execute } //Change rooms woo function TransitionChangeRoom() { room_goto(global.targetRoom); } //Wrap it up function TransitionFinished() { layer_sequence_destroy(self.elementID); global.transition = false; }
Question: I've gone through the tutorial and it works fantastically, however there is a problem where if the first room is tagged as persistent the first sequence loops upon returning to the first room. Do you possibly know why that might be? For context I'm making a jrpg style game and am using the screen transition when you run into a random encounter. However the overworld is persistent so that when you end a battle you can continue exploring from where you were. Thank you!
If the room is marked persistent then the room will be persistent so the sequence will remain on the layer after leaving the room. Persistent rooms cause a lot of issues. You can avoid this by instead using something like global variables to track your player's overworld position and using this to set the player's position when you start the room rather than making the entire room persistent.
@@burntshooter did you put the sequence destroy the line before room_goto? Inside the transitionchangeroom? It shouldnt be in any more statements besides the initial function
Very helpful! I had to change a few minor things but was able to figure out most of it. The one thing I have an issue with is how I do my room swaps, the character gets placed in a particular coordinate in the new room. Do you know a way to grab the player coordinates in the next room ahead of time?
If you're having trouble with the sequence not rendering over your camera I figured a solution. Create a global variable for your camera X and Y. In Obj_game, Global.cameraX = 0; Global.cameraY = 0; Then I had my transition object convert it before running the line to update the global room target. In Obj_roomEnd, If (instance_exists(obj_player)) && etc... Global.cameraX = obj_camera.camWidth * 1; Global.cameraY = obj_camera.camHeight * 1; Global.targetRoom = etc... Then in (function TransitionPlaceSequence) in place of the 0,0 one the create line I used my global X and Y. function TransitionPlaceSequence(_type) { If (etc...) Var (etc...) Layer_sequence_create(_lay,global.cameraX,global.cameraY,_type); } It was simple, only updates the globals when you need them, and it fills the screen.
I wanted to make a transition that is similar to WarioWare. This transition is fade to black. I wanted a transition that fade to the next room. Useless tutorial. :(
Things like this makes me wanna rework my game I've been working on for 1.5 years from scratch
Shaun, you deserve more views.
Wow! This changes everything! Looking forward to implementing this! Incredibly simple!
Extremely helpful as always... My original system for transitions is soooo much more needlessly complicated than this, and I'll be glad to be rid of that now!
This is incredible! You are helping me so much in my development work! Much thanks.
To those people wanting to draw on the GUI layer, simply create a object with that sprite and create a sequence using that object instead of the sPixel. Then, change the object Draw event to a Draw GUI event where it draws itself :D
how? in my case it's with a menu
nevermind I found out, but now it creates TWO transitions in the room
Thanks for the cool 2.3 tutorial man
Excellent video; I'll definitely be utilizing this going forward with my projects!
thanks so much you are a legend! also this was posted on my last birthday..........LOL
Hey, I'm having a weird issue where I can't see the transition when I have viewports enabled. If I disable it I see the Sequence for fading out fine, but when I enable it and my camera get's involved, no matter what position I put the layer in I just cant seem to see the transition sequence.
@ManChickenTurtle how do you do this?
@ManChickenTurtle this is the exact problem im having right now, did you happen to fix it?
im having a small problem where everytime i die in a level i play the out transition, reset the room and then play an in transition which works fine but the origin of the in transition is where the camera was whenever i died instead of where the camera is when the room resets so the black bars are just not where they’re supposed to be. anyone know of a fix? i cant find many ways to effect transitions once theyve started playing
Is there any way to draw the transition above the gui layer?
I dunno if it's a new thing or a problem with Gamemaker, but this method doesn't permanently delete the "fade in" sequence layer.
If you have to reset the room you transitioned to or go back into it, the fade out animation plays again. The code deletes the sequence once, but it just gets put back into the room once the room is reloaded.
I'm having this same issue and I've gone through hours of debugging. I've proven that the same self.elementID is being created/destroyed and then, somehow, the same exact self.elementID is re-created/destroyed without the Transition functions being called. None of my rooms are persistent, and the instance initially calling TransitionStart() is not persistent either.
I've even tried destroying the "Transition" layer at the end of TransitionFinished(), to no avail. I wonder if this is a bug within the engine.
@@MoltiSanti are you two drawing oPixel on a GUI layer? because that was the problem for me, and as soon as i made it draw itself normally it fixed itself
@@sinistar I don't believe I was. Anyway, I scrapped sequences for now and I'm using my own system with an object that just draws a fading rectangle in the Draw GUI End event when transitioning. I appreciate the info, though.
@@MoltiSanti ah alright, good luck with your project!
@@sinistar Thank you. Same to you!
If I draw a surface in the room the transition sequence is always behind the surface. Do you know how to fix that? Thx !! :)
is there a way to have it automaticly select the duplication? its pretty tedious that it doesnt
hey all, im having an issue with an odd flisker effect at the end of my fade in sequence? i'm doing the transition with an object on the gui layer
my seqence is not filling out the screen, instead it happens in the corner of my screen, my rooms and sequences are all set to 1280x720, not really sure why it does this ?
Edit: 1:10 this part is what i skipped, didnt think it would be that important, but it was, so gonna leave this here in case some one else makes the same mistake i did.
In my project, the layer sequence is invisible or is not created, I'm not sure, the transition works, but the sequence itself does not appear, visually I mean, how can I solve this? * I hope I spelled correctly, English is not my language.
Fantastic work!
Anyone knows how to permanently remove this sequence from playing. I do code to place this sequence in the room only once.
Then I leave the room and go back in (without doing code to place sequence in that room again) but sequence is playing again every time I enter the room.
Looks like when I place this sequence in the specific room it is there permanently and even if sequence is destroying itself it's not helping :( you enter the room again and it's still there.
Im having the same problem rn
If you move layer_reset_target_room() in the TransitionStart function to run after global.roomTarget = _roomTarget it fixes the problem
@@leo8748 thx :)
@@leo8748 I know this reply is 3 months old, but for anyone just passing through: Do not do this. It will just break this system
I'm having this same issue and I've gone through hours of debugging. I've proven that the same self.elementID is being created/destroyed and then, somehow, the same exact self.elementID is re-created/destroyed without the Transition functions being called. None of my rooms are persistent, and the instance initially calling TransitionStart() is not persistent either.
I've even tried destroying the "Transition" layer at the end of TransitionFinished(), to no avail. I wonder if this is a bug within the engine.
I'm having a lot of trouble getting this to work with a moving camera.
Code:
layer_sequence_create(_lay,camera_get_view_x(CAM),camera_get_view_y(CAM),_type);
(CAM is just view[0])
If I use this code, the fade out works great, but the fade in doesn't show up at all. I think that the fade in is still appearing in the same position as the fade out, so if I fade out in a spot other than (0,0) the fade in doesn't show up at all.
Any help would be appreciated! Thanks!
have your camera object (or some other object) update the position of the "transitions" layer whenever it exists.
@@SaraSpalding Thanks for your help! I'm assuming I should use similar code to parallax scrolling. If so, and if I use the function layer_sequence_exists(), how would I get the sequence_element_id in the camera object?
If anybody from the future is reading this, here is my solution:
Code:
//Last line of the TransitionPlaceSequence function
global.sequenceLayer = layer_sequence_create(_lay,camera_get_view_x(CAM),camera_get_view_y(CAM),_type);
and
//In the camera object after it gets the camera's position
if (layer_sequence_exists("transition",global.sequenceLayer)) {
layer_sequence_x(global.sequenceLayer,_curX);
layer_sequence_y(global.sequenceLayer,_curY);
}
(_curX and _curY is just the current x and y position of my camera)
@GamePerson Hey, I don't have a lot of information to go off of based on your video. As far as I can tell it seems like your fade in is spawning at the wrong (x,y) coordinate.
So first, make sure you declared your global.seqeunceLayer variable with the rest of the global variables in the Transition script.
Second, change that your fade out will spawn in the top left of the screen instead of the middle. Try messing around with the origin point of your fade in sequence for instance.
Your game looks awesome by the way!
@GamePerson Hey, I'm experiencing the same issue as you and I think there's actually two problems going on. The first is that you're setting the transition to the camera's x and y, but you actually want to offset it.
// In camera's step after calling camera_set_view_pos
...
layer_sequence_x(global.sequenceLayer,x-view_w_half);
layer_sequence_y(global.sequenceLayer,y-view_h_half);
I define those halves as follows...
view_w_half = camera_get_view_width(cam) * 0.5;
view_h_half = camera_get_view_height(cam) * 0.5;
There's also a second issue you should be experiencing, which is that the camera update code isn't actually running during the first transition. I'm not sure why it's correctly placed, but if you add some show_debug_message code to the camera update you'll see that it is only ever executed during the second sequence. I believe this is due to...
TransitionPlaceSequence(_typeOut);
// sets global.sequenceLayer
layer_set_target_room(_roomTarget)
TransitionPlaceSequence(_typeIn);
// overwrites global.sequenceLayer
layer_reset_target_room(); // Camera step should now be referencing that second global.sequenceLayer, which doesn't exist in the current room so the if check fails
So what I did that seems to have ended up working, and this may take some unhackery for a production, was I put this code at the end of my camera step instead of the first snippet of code I mentioned in this comment ...
if(layer_exists(layer_get_id("transition")))
{
var _a = layer_get_all_elements(layer_get_id("transition"))
if( array_length(_a) > 0 )
{
// This code very clearly assumes that there will only be one sequence in this layer, it's the "hack" but works for 1 single sequence
layer_sequence_x(_a[0],x-view_w_half);
layer_sequence_y(_a[0],y-view_h_half);
}
}
Hopefully this works for you, too! I'd love a more well thought out answer / solution but this seems to be doing the trick at the moment...
Can you also play the sequence in the gui layer? Because the currenty implementation will be overlayed by the UI.
Thank you so much! Really needed this
Thank you this was so helpful!
Ooooooooo! Great use of sequences!
how do i implement this when i have more than 2 rooms?
Is there any way to do this using visual studio? I made the sequence but can't get it to show up.
How do we get this working with YYC? other.element_id won't pass a valid value
Sorry to reply to an old post, I just wanted to help anyone who might run into this problem in the future. If you're referring to the first line in the TransitionFinished script:
layer_sequence_destroy(self.elementID);
it doesn't work because "self" is broken in YYC. "Self" internally is -1, and in is easily taken out of context and can cause errors. You can simply replace it with
layer_sequence_destroy(global.sequenceLayer);
and it will work in YYC, but it becomes a little less modular, since it can only delete the one sequence stored in that variable. This shouldn't be a problem with the code used in the tutorial.
Note: "other" = -2, "all" = -3, and "noone" = -4, but those seem to work properly in YYC as far as I've seen. Only "self" is broken, and functionally nearly identical to "id", but not in this specific case. I've heard it is best practice avoid "self" and use "id" instead.
@@myPlaceholderName Wow, first time hearing "self" is broken on YYC! Will look into it for sure. It must affect object instances only, because I use "self" all the time in my struct's methods, since 2.3.
Thanks man!
@@S_Tadz I'm mostly citing information I've read elsewhere that has helped me, but it might be dated by now. At one point "self" was an abandoned function because it was too similar to "id" but there is a chance Yoyo games have tried to fix up "self" since then. If it works for you, then that's great, but it still seems a little buggy.
@@myPlaceholderName Thanks a lot! Did not know "self" is broken in yyc.
This seems to only work if you have a single-screen game, or if you start the room at the top-left corner. Otherwise, the fade out sequence isn't glued to the camera position, and it may only show up partially on the screen, or not at all. Or am I doing something wrong?
see 5:55
@@SaraSpalding Ah okay, I did miss that part. Unfortunately, for my game, that still doesn't work, because I have a camera object that automatically snaps the view to my player at the beginning of the room, wherever that player object happens to be, so the view that's set in the room properties changes immediately when the room starts, and the sequence, obviously, doesn't follow. Ah well. Thanks anyway! Maybe I'll try these snazzier sequence transitions in my next project!
@@BiohazardEXTREME You can just move the "transitions" layer if it exists so it's always at the camera position.
@@SaraSpalding Huh. Okay, I'll give that a try. If I understand correctly, you mean to have my camera object always check if the transition layer exists and if it does, move it to the view position? Thanks, I really appreciate the help!
I'm having this issue too but I still cant see the transition even when I move it's position if I have my camera enabled...
I would love to see how to implement this in the drawui layer
I think a solution may be create a sequence of an object instead of a sprite! You can then do the object draw itself on the drawGUI layer :)
Amazing tutorial
This is so interesting! In terms of performance, do you think it's better using sequences rather than having and object that handles everything?
The difference either way would be likely trivial
Hi Shaun :) Quick Question.. I have a 3 rooms. Between Room 2 and 3 I setup the transition. When I do a game_restart() during the the fade in transition in room 3 the transition not longer works and the game gets stuck at the end of room2 during the next time. Do you know why this happens? Probably sth. with memory right?
ahh.. reading the manual.. GAME_ RESTART: "However it should be noted that global variables will not be re-initialised unless explicitly coded as such" ... I think thats it :)
but since the transition script should run again on room_restart i guess it could be a sequence bug
ok now i got it.. since the script that initializes the transition sequences is global, its not be reinitialized on game_start. Therefore I had to set the mid.transition variable to false at the create event of the first room.. now it works.. sorry for spamming :)
You sir are an amazing human, spent the last 3 hours trying to bug fix why this was happening on restart, as you said just had to put Room Start Event - midTransition = false, solved everything
For me this resulted in both the fade out and fade in happening before going to the next room. I watched the video a second time and all the code is right. Any ideas why this is?
YES
THIS IS SO USEFUL
Hello, I followed this tutorial exactly besides renaming a few variables, and the game refuses to spawn in the transition sequence when I call the transition function. Can someone please tell me what's going wrong here?
///Room transition functions
global.transition = false;
global.targetRoom = -1;
//Place the sequence
function TransitionPlaceSequence(seq) {
if layer_exists("transition") {layer_destroy("transition")};
var l = layer_create(-9999,"transition");
global.test = layer_sequence_create(l,0,0,seq);
}
//Initiate a transition
function Transition(targetRoom,seqOut,seqIn) {
if !global.transition { //Make sure one's not already happening
global.transition = true;
global.targetRoom = targetRoom;
TransitionPlaceSequence(seqOut);
//Place the transition in sequence in the target room
layer_set_target_room(targetRoom);
TransitionPlaceSequence(seqIn);
layer_reset_target_room();
return true; //Success!
} else return false; //Unable to execute
}
//Change rooms woo
function TransitionChangeRoom() {
room_goto(global.targetRoom);
}
//Wrap it up
function TransitionFinished() {
layer_sequence_destroy(self.elementID);
global.transition = false;
}
Question:
I've gone through the tutorial and it works fantastically, however there is a problem where if the first room is tagged as persistent the first sequence loops upon returning to the first room. Do you possibly know why that might be?
For context I'm making a jrpg style game and am using the screen transition when you run into a random encounter. However the overworld is persistent so that when you end a battle you can continue exploring from where you were.
Thank you!
If the room is marked persistent then the room will be persistent so the sequence will remain on the layer after leaving the room. Persistent rooms cause a lot of issues. You can avoid this by instead using something like global variables to track your player's overworld position and using this to set the player's position when you start the room rather than making the entire room persistent.
@@SaraSpalding I had a feeling that might be the case. Thank you so much!
Add a layer_sequence_destroy(self.elementID) to the change room function BEFORE you change rooms. This destroys it on your way out
@@MrTHEHANSFORD I had this same issue but the solution I posted helped me keep the persistence
@@burntshooter did you put the sequence destroy the line before room_goto? Inside the transitionchangeroom? It shouldnt be in any more statements besides the initial function
Very helpful! I had to change a few minor things but was able to figure out most of it. The one thing I have an issue with is how I do my room swaps, the character gets placed in a particular coordinate in the new room. Do you know a way to grab the player coordinates in the next room ahead of time?
If you're having trouble with the sequence not rendering over your camera I figured a solution.
Create a global variable for your camera X and Y.
In Obj_game,
Global.cameraX = 0;
Global.cameraY = 0;
Then I had my transition object convert it before running the line to update the global room target.
In Obj_roomEnd,
If (instance_exists(obj_player)) && etc...
Global.cameraX = obj_camera.camWidth * 1;
Global.cameraY = obj_camera.camHeight * 1;
Global.targetRoom = etc...
Then in (function TransitionPlaceSequence) in place of the 0,0 one the create line I used my global X and Y.
function TransitionPlaceSequence(_type)
{
If (etc...)
Var (etc...)
Layer_sequence_create(_lay,global.cameraX,global.cameraY,_type);
}
It was simple, only updates the globals when you need them, and it fills the screen.
if someone having problem with room transition try this code
var target = noone;
if (room == rm_room1)
{
target = rm_room2;
TransitionStart(target,seq_FadeOut,seq_FadeIn);
}
how do i make it so when i get to a point in the level that it transitions to the next room
For whatever reason, this breaks when using HTML5. No idea why, though it works great otherwise!
(specifically, the first transition works fine, the the fadein doesn't happen at all, and then it stops working entirely)
@@musicjre Having the same issue, but two years later lmao
It's good, but doesn't work in HTML5.
big this is big ... you know what else is big ?`... yes my student loan ....
First!! And I don't know how I got too many likes!!
I wanted to make a transition that is similar to WarioWare. This transition is fade to black. I wanted a transition that fade to the next room. Useless tutorial. :(
That would be complicated with the way gamemaker uses rooms. These are just basic transitions to get you started. Useless comment :(
@@kewdii what useless comment? A comment is just a comment, a.k.a. feedback, *It's not useless!* >:/
@@buizelmeme6288 By your logic the video is just a video, aka information, not useless.
@@kewdii ...
Still waiting for a game engine that will make wario transition cutscenes. >:(
@@buizelmeme6288 what a useless comment