Hey everybody I'm sure everyone knows how to do something like this already so it's mostly directed towards newbies.
This article is going to tell you how to make some nifty in-game cutscenes using a method I've come up with that I call the Phantom Zone method. Yes, just like the Phantom Zone from Superman! In Superman, the Phantom Zone is an alternate dimensional prison in which escape is (mostly) impossible for prisoners. In my example you'll be able to escape but it's the best comparison I could come up with.
The Idea
The idea for this is to mainly save time and energy for making your player character not have a gazillion animations to him. When he (the hero) interracts with something that causes a cutscene to occur, he'll be temporarily replaced by a facsimile (clone) that will do the actual cutscene himself. Then the hero will be returned to the game screen after the cutscene is over. All of this happens seamlessly to the guy playing the game and will look to him as if everything was done by the hero himself.
The Phantom Zone
I make my Phantom Zone a small box with borders about 5 to 8 pixels wide. This is to lessen the chances of your hero somehow accidentally failing his collision check with the floor of the zone and falling out of it offscreen to his doom. The box itself I make an obstacled background and set it off of the frame area at the bottom like this picture shows:
The Cutscene
Okay, now for this simple cutscene all we're going to do is have this guy go into his house and be shown through the window, and then go back outside when he's done. For simplicity's sake, we'll say that the cutscene is triggered when the hero overlaps with the house and a flag is off.
When the hero overlaps with the house, turn that flag to ON first. This will stop him from constantly activating the cutscene by overlapping the house after he's already been inside it. Then what you need to do is set the hero's X and Y position so that he's put inside the Phantom Zone below the frame. Make sure you disable any groups of events that allow for player movement, otherwise you'll still be able to hear the hero jump around and stuff when the player presses the jump button.
The next thing you'll need to do is to change the house's animation to where it looks like the hero is behind the window and doing stuff:
The Escape!
Okay now you can make your house's cutscene do whatever you want and have it be as long as you want, but when it's finally over you need to do a couple of more things to return the player to the game again.
When the cutscene animation has finished, change it back into the normal house animation and then set the hero's X and Y position back to where he was previously, probably near the door or on the other side of it. Activate the hero's movement events to allow the player to resume control of the guy again and you're golden!
And so..
So that's it. A very easy way to make your game look better by throwing in lots of little cutscenes here and there. I've done this a lot with Hasslevania and although it's not exactly rocket science I thought I'd share this method with people just getting into MMF. Thanks!
Posted by
17th November, 2007
You can also use subapps (that's assuming you don't use particle effects, so you can't tell the difference) to fake stuff happening.
As a suggestion when building the animation clone: Use the Action Point as a hot spot. So for instance, if in the animation, the player takes a huge leap, make sure his action point follows him AS IF IT WERE HIS HOT SPOT.
When you come to replace the clone with the actual player, you can position him to the Action Point of the clone. Voila. Seamless.
I've just been keeping track of the X, Y values of where the hero is going to be and then sticking the clone as near to that spot as possible, but your way will yield no weird jumps like some bad editing project.
Cool. I'd also suggest making the character invisible, then keeping his position even with the fake character. I do this when the guy needs to have a short, predetermined motion occur. For example, some baddie comes and punches your guy in the face, and your guy sails across the room and does a back-flip in midair. Once he's stopped, he gets destroyed and the real guy comes back. That way you can also keep many of the clippers that you may have made around the main guy.
Nice article! That's pretty much how I do it, too. This method can also be applied to teleporters, entering doors, or any other idle animation that you want the player to not have control during.
I like to take my player way outside of the frame where any stray bullets or enemies can't possibly damage him by accident. And since I don't normally have "+player is visible" as one of the conditions to get hit, making him invisible and keeping him there would probably screw up for me somehow. (Or if you forget to disable all the enemy groups and stuff).