GMS 2.3: Sequences (Pt. 1) - Editor & GML Usage

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
kailia in this video we'll be looking at sequences in game maker studio 2.3 sequencers are a new tool that allow you to create animations in game maker so they can be used to create complex animations with sprites objects and even sounds so from small and quick animations to full cutscenes you can do a lot with sequencers in this video we'll be looking at how sequences can be created and how they can be used in game here are the time stamps for all the different sections in this video let's begin with the first one so I'm gonna go into game maker studio 2.3 which is in beta as of this video I have a few assets here already which are a few sprites and a room I've deleted all of the other groups if you want to learn more about the new asset browser to check out my video on the IDE changes now in the sequences folder here I'm gonna create a new sequence assets I'm gonna keep the name sequence 1 and now we have a new sequence a sequence editor has opened here so this is a completely new part of the IDE where we can edit our sequence the sequence editor has three main parts the canvas the track panel and the top sheet the canvas is where you're gonna be placing and moving around all the elements of your sequence now everything you place in the sequence will be listed in the track panel so each item in the sequence will be a separate track now the animation for all the tracks and all the frames and key frames will be handled in the top sheet so in a sequence you can place an animated sprites objects and sounds and you can also place a sequence inside a sequence now as an example I'm gonna go into the asset browser take the sprite of the bird and drop it in to our sequence so we have added our first track in the sequence we can move it around in the canvas and see the track listed in the track panel the track is called as bird says that is the name of the sprite but you can simply rename it by pressing f2 now you can also see the track in the dope sheet here this is the lifetime of the track in the animation so the track starts here and ends here but as you can see the sequence actually ends all the way here not the duration of the sequence can be changed here currently it's set to 60 frames which is one second so I'm gonna change this to 180 which is three seconds so now the sequence will be three seconds long we can actually see the number of seconds by going here and changing it from frames to time and now it shows us the number of seconds instead of frames now I'm gonna go back into that menu and change it back to frames now here we have the speed of the sequence which is set to 60 frames per second and now in the dopesheet we can move our track around we can also move the playhead to any frame now if I take the playhead and move it here we can no longer see the bird so at this point the track has ended now you can simply extend the track and make it as long as a sequence so now the bird will always be here throughout the sequence now we can go into the drag panel and click here to see the tracks inside the bar track right now we have one track here for the position so this will be used to animate the position of the bird if you don't have the track you can add it from this menu you can see the track in the dope sheet and here we have a keyframe the current position of the bird is stored in this keyframe so now for a basic animation I'm gonna go to this frame and now in the canvas I'm gonna move the bird you can also use these arrows to move it so I'm gonna place it here and now you can see a line here that shows the movement of the bird if you go into the dope sheet you can see a new keyframe on this frame now if you move the playhead between the two keyframes then you can see the animation you can make the animation shorter by moving the keyframe and in the same way you can also make it longer I'm just gonna move it to this frame and now I'm gonna add another keyframe on this frame so I'll simply moved about and the change will be recorded so now we are omitting the position between three key frames so you can see how when I move the bird a new keyframe is created automatically and that happens because of this option when this is enabled all changes are recorded automatically I'm gonna disable it to show you how you can place keyframes manually so now on this frame I'm gonna make some changes by simply moving the bird and on the track panel you can see the track turns golden and a star appears next to it if you look in the dope sheet there's no new keyframe so the changes simply runs recorded automatically because this option is turned off we can now do that manually for a track by pressing this button and now if you look in the dope sheet a new keyframe is there so this is how you can manually place keyframes now I'm simply gonna enable auto keying and finish the animation now the animation can be played using a play button here now if you click here you can make the animation loop so I'm gonna play it again and now the animation should keep looping now we have only animated the position track but there are more tracks that you can add from this menu so I'm gonna add a rotation track now we see a new empty track in the dope sheet for rotation so now I'm gonna go to the first frame and here manually add a keyframe we have set the rotation value on this frame so now we can go ahead and add more keyframes I'm gonna come to this frame and rotate the board so now back in the dope sheet we have a new keyframe here between this keyframe and this keyframe the rotation will be animated so now I'm gonna add more keyframes and finish the animation now I'm gonna play the animation and we can see our board rotating now the rotation doesn't feel right because it doesn't feel like the bird is turning it's more obvious if you look at this part so to fix this I'm gonna come to this frame and here place a keyframe and on this frame I'm basically gonna make it less rotated so the board will actually start turning after this keyframe I'm gonna play the animation now and the turning feels much better in the spot so this way you can play around with your keyframes to make your animations more polished now I'm gonna go into this menu to add another track which will be scale so this track is for scaling the item now add the first frame I'm gonna add a keyframe on this track and I'm gonna go to the last frame and add a keyframe here and then finally at the middle of the whole track I'm gonna add another keyframe and on this frame I'm gonna scale the board up so I'm gonna go to the for him now and play the animation and you can see how the bird gets bigger and the middle of the animation now if we go back into this menu we have some more tracks here we have color multiply which is basically the image bland color then we have the imagined X so you can control which frame is being drawn from the sprite then we have the image speed so that's the speed of the sprite animation and then we have the origin of the sprite now we can add more tracks to make up our animation so I'm gonna go into the asset browser and from here take the S food sprite and drop it into the sequence I'm gonna scale it up now you can see the new track in the dog sheet and in the track panel the track is right small and only lasts like one frame so I'm gonna make it longer to fit the whole sequence I'm gonna play the animation to see where I should place the Apple okay so I'm gonna go to the fourth frame now to move the Apple we go to the fourth frame to set the initial position but see I went into this frame instead and moved the Apple here then this would create an animation so that's why we go to the first frame to set the initial position and I'm gonna move the Apple here now when the board comes here and that of the Apple we won't be able to disappear to give the idea that the board collected it so I want the Apple to disappear on this frame so I'm simply gonna reduce the length of the track to make it end on this frame now the Apple will disappear and it'll look like the board collected so we can play the animation and it looks pretty good now at this point I also want to play a sound so I have a sound asset here which I can simply drag and drop into the sequence and now we cut a new track for our sound so when I play the sequence you can hear the sound now I'm gonna move the track to this frame so it plays when the bird collects the Apple so now we have a nice sound effect in our sequence now audio tracks also have their own property tracks so we have position rotation fall-off pitch and volume so a lot of stuff to play around with I'm gonna add the volume track now I can go to the first frame of the track and here change the volume so the volume will now be lower for the sound you can also modify the page which can be really useful for fine-tuning the sound effect now we can apply their sequence in the game with GML so first of all I'm gonna go into the asset browser and here create in your group four objects now I'll create a new object and this will be all manager I'll put it in the group now I'll go into the room and place an instance of all manager here you're gonna use this object to play our sequence so I'm gonna go to add event go onto key press and add the space event I wanna play the sequence when I press space so let's add some code in this event now this is a sequence that we are gonna be playing so I'm storing it in a variable now we're gonna create another variable which will be the layer where the sequence will be played so I'm just gonna create it in the instances layer now to actually play the sequence we need to use the layer sequence create function this is the function that plays the sequence and the game there's also a sequence create function but this is used for creating a new sequence but for playing a sequence you need to use the layer sequence create function this function creates a sequence element in the layer that you give to it so the first argument for this function will be the layer the next two arguments will be the X and y position where the sequence will be created so I'm gonna set that to 0 and 0 which is the top left corner of the room then finally we need to pass in the sequence that will be played so with this function a sequence element will be created in the layer that will play the sequence so we can now run the game and play our sequence I can now press space to play the sequence so the sequence does play but it's mostly off-screen let's see why this is happening by going back into the sequence editor in the center we have the origin of the whole sequence everything is created relative to this point so when you create the sequence at 0 by 0 in the room and this is what you see and this is why the sequence was appearing to be off-screen now a solution for this could be to create the sequence say at the center of the room but you can also just move the origin inside the sequence so I'm gonna move it to this point and now we should be able to see the animation and now I'll run the game if i press space we now see our sequence but it does keep looping so I should probably go into the sequence and turn it off now when I click on this button it changes to a ping pong mode so this where the animation simply goes back and forth I'm gonna click on it again to simply turn off any kind of looping and now I'll go into the game when I press space the sequence plays once and then it stops so while the sequence does end the sequence element doesn't disappear so you can now destroy it with lair sequence destroy or play it again with lair sequence play just run these functions on the sequence element that you got from layer sequence create now in the next video we'll be looking at some more advanced functionality that comes with sequencers for example we'll be creating a controllable player object and applying the animation on that if the next power is up it will be here if it isn't you can subscribe here and turn on the notifications to get it any one box when I do upload it so I'll see you in the next video
Info
Channel: GameMakerStation - Matharoo
Views: 11,588
Rating: undefined out of 5
Keywords: usage, new, function, new version, sequence editor, version, gamemaker, changes, sequences, 2 3, animation, gms2, cutscenes, upgrade, play animation, gamemaker studio, play sequence, gms 2, gml, gms, gm2, sequence create, gm 2, 2.3, game maker 2, layer, update, tutorial, gamemaker studio 2, gamemaker 2, cutscene, animations, ide, updates
Id: -k-tE44Qocg
Channel Id: undefined
Length: 13min 11sec (791 seconds)
Published: Mon May 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.