Mine Cart *woosh*
Mine Cart Challenge
Tutorial and Puzzle by Zylos Edited by Leventhan
This tutorial will teach you how to create a fast-paced mine cart challenge event system, a not-so-simple and complicated event system. It is advised to have at the very least the basics of eventing before attempting to create such system. This step-by-step guide also includes screenshots and a demo of the puzzle.
This mine cart event system is a barrel-avoiding sort of mini game, where the player uses the up and down arrow keys to switch between tracks, avoiding incoming barrels of explosives. A powerful and customizable event system indeed.
1. Create a 24×13 map with horizontal loop and no random encounters.
2. Design the map however you like and add at least 3 straight tracks to the middle.
3. Make a Parallel Process event and have it set the player’s speed to Speed 6 and have him Move Right (repeat action). Additionally, you might want to disable the menu, but that’s optional.
4. At the end of the Parallel Process event, turn on a new switch (which will be referred to from now on as “Mine Cart”), turn on Self Switch A, and create a new event page (also Parallel Process) with this self switch as its condition. The event should look something like this:
5. In the database, create a new Parallel Process common event with the condition switch set with the switch “Mine Cart”.
6. In this common event, make 2 conditional branches, one for when the Up Button is being pressed, and one for when the Down Button is being pressed.
7. Inside both of the conditional branches that you just made, make another conditional branch with the script condition “$game_player.y”. For the Up Button conditional branch, write the code as “$game_player.y>#”, where “#” is the Y coordinate of the topmost track. For the Down Button conditional branch, write the code as “$game_player.y<#”, where “#” is the Y coordinate of the bottommost track.
8. Inside each of the new conditional branches that you just made, set the player’s move route so that he jumps ahead 3 X and either 1 Y or -1 Y (depending on whether you are jumping up or down) and add a Wait for Move Completion.
9. Following each jump, set the player’s move route with Move Right (repeat action). At this time, the common event should look something like this:
Note: As you can see, steps 6 and 7 can be interchangeable. Also, if you tested the game at this point of time, you should be cruising down an endless loop able to jump in-between the tracks.
10. Now it’s time to set up some obstacles. Somewhere off the tracks, create 4 Player Touch events that do at least two things: turn off “Mine Cart”, Stop the Timer, and bring up a Game Over screen. You can add some other niceties here if you want, like an explosion animation and turning the player invisible.
Note: DO NOT USE A TILESET PIECE AS THE OBSTACLE GRAPHIC!!! It causes passibility issues. If you wish to use a tileset piece as the graphic, you’ll have to manually make it into a sprite and use that.
11. In page one of the Parallel Process event from step 3 and 4, right before the player’s move route, set all of the obstacles opacity to 0 and turn on the Timer for 1 minute.
12. And now for the confusing part: randomly placing the obstacles on the tracks while they are just off screen (so that you can’t see them get moved around). In the second page of the Parallel Process event, make a conditional branch with the script condition “$game_player.x==12”.
13. Inside the conditional branch, set 2 variables (which will be referred to from now on as Obstacle X and Obstacle Y. Set Obstacle X as 23, and set Obstacle Y as a random number from the topmost track’s Y coordinate to the bottommost track’s Y coordinate.
14. Use Set Event Location and set the coordinates of the first obstacle to Obstacle X and Obstacle Y. Then set the obstacle’s opacity to 255 (no wait). It should look something like this:
If you were to test it now, the game would place one obstacle randomly on the tracks and have a countdown that doesn’t do anything yet. And yes, I called the variables “Player X” and “Player Y” as opposed to “Obstacle X” and “Obstacle Y”. It makes little difference what they are called as long as you remember to use the right variables.
15. After step 14, create another conditional branch with Timer Condition of less than 40 seconds. Repeat steps 12, 13, and 14 inside of this conditional branch for the second obstacle, using script condition “$game_player.x==1” for the inside conditional branch and setting Obstacle X to 11 instead of 23.
16. Rinse, lather, and repeat step 15 for the third obstacle, but with a Timer Condition of less than 20 seconds this time. Use script condition “$game_player.x==6” for the inside conditional branch, and set Obstacle X to 17.
17. Repeat step 15 one more time for the fourth obstacle with a Timer Condition of less than 20 seconds. Use script condition “$game_player.x==18” for the inside conditional branch, and set Obstacle X to 5.
The second part of the page after the first conditional branch should look something like this:
If you were to test now, you would find that the obstacles would multiply x2 when 40 seconds are left, and that they would multiply x4 when 20 seconds are left. However, the obstacles will not stop when the timer reaches 0 seconds, so that will be the next thing to do.
18. Add one more conditional branch to the end of the page with a Timer Condition of less than 0 seconds. Inside the conditional branch, add a Wait command for about 30-45 frames, and turn on Self Switch B.
19. Make a new event page (again Parallel Process), and set it’s condition to Self Switch B.
20. In this new Event Page, make 4 conditional branches with script conditions “$game_player.x==12”, “$game_player.x==1”, “$game_player.x==6”, “$game_player.x==18” accordingly.
21. In each of those conditional branches, set their respective obstacle’s opacity to 0 (no wait), and set their event locations to somewhere off the tracks.
22. At the end of the page, add in a Control Timer: Stop.
This will clear the tracks after the timer has reached zero, but you will still be going in an endless loop until you bring the mini-game to a stop. And that is what we will do now.
23. Create an entirely new Parallel Process event with no conditions.
24. In this new event, make a conditional branch with Timer Condition of less than 0 seconds.
25. Add a Wait command for about 120-180 frames, and then turn off the switch “Mine Cart”.
26. You can add all sorts of niceties here if you want, such as slowing the player down and fading out the BGM and BGS. The important thing is that you fadeout the screen and transfer the player to another map (or return him to the Title Screen or whatever).
And that’s the end of the tutorial!
You can find all sorts of ways to add or improve this if you wanted, but you now have a working mine cart mini-game! If you want to first try out the event system, there is a demo link at the end of this post. However it is recommended to craft the whole system yourself with the aid of this tutorial.
Demo Link : http://www.mediafire.com/?8numknt7ixg