Gw Temp

Menu

Tutorial - 'Bicylce Time Trial System' by ATARI

An item about RPGMaker 2000 posted on

Blurb

A tutorial on how to make a time trial system on a bicycle. Pedal up!

Body

Hi Folks! It’s ATARI again! This time I am here to talk about how to make a bicycle time trial system in your RPG!

Things that you will need to know to use this tutorial
1. Password Commands
2. Variables
3. Fork Options
4. Switches
5. Common Events
6. Labels

So what exactly do I mean when I say “Bicycle Time trial System?” Well, if you have ever seen the Tour De France (a big bycling tournament) you probably know, but If you don’t, I will explain what it is basically. You get on the bike, and ride on a track, trying to get the least amount of time as possible, and go as fast as you can. This tutorial is about how to make something similar in your RPG.

Set-Up

The first thing that you need to do is make a new map. This will be your test map for the time trial system. Make the map’s size about 80 x 80. Since it’s only a test map, it doesn’t have to be very big. (When you make it on your own, it should probably be a lot bigger than that. 170 x 170, probably bigger. The tracks aren’t short in the Tour De France.) Now on the map, make a new event. Call this event “Time Trial System.” Make the event an “AutoStart” event, and have the starting condition switch of this event be “trial_begin.” Now that you have this done, you can construct the track however you want. It should have at least one direction of turning, and a place where it is uphill, a place where the track goes downhill, uphill, a beginning, and a finishing line. Also, you have to make sure that the path is only 1 tile by 1 tile.

Now go into your database (F8), and click on the hero’s tab. In here, make a new hero. Make it’s
graphics the graphic of your hero on a bicycle. To make this graphic, you’ll probably have to get someone to edit it for you, or do it yourself. Once you have that done, put that graphic into your new hero’s graphics. Name the hero, “[Your hero’s name] (bicycle)” (Replacing “[Your Hero’s Name]” with the name of your hero, brackets and all, of course). Now hit the apply button and then go into the common events tab.

In the common events tab, make a new event. Name this event “trial Timer.” Make it’s starting
condition switch be the switch “Trial_begin.” (Haven’t we seen this switch just a little bit ago perhaps?) Make this event an autostart event. Now at the top, put a change variable event in there. Use the variable “Timer,” and set the variable to “0” (zero), put in a wait 0.1 event, and then below that put in a new label. (You can use whatever label number you want, but in this tutorial, the label number for this event will be the number “1.”) Then put in a change variable event. Make the command add “1” (one) to the variable “Timer.” Then wait 1.0 seconds, and then make a Go To label command that goes back to label number one. Hit the apply button, and then the okay to return back to your map.

Now on your map, go back to the “Time Trial System” event. Below the “Trial_begin,” put in 4 (four) more pages to the event. Make all of the event’s starting conditions be the switch “Trial_begin.” Now go to the second page (the first one you made when making the new pages), and below that “Trial_begin” switch, put in a new starting condition switch below that called “DownDir.” On the next page do the same, but use the switch “UpDir,” On the next use “RightDir” and on the next one, you guessed it, “LeftDir.” Next, make two more pages, one for the switch “Uphill,” and one for the switch, that’s right, “Downhill.” On the Uphill page, below that, put in the starting condition switch “DownDir.” Now hit the OK button and go back to your map.

On the Tracks

Now it’s time to put some events on the track. Right below the place that you’ve designated the starting position, below that make an on hero touch event that turns on the switch that corresponds with the direction that you are facing and turn on the switch “Trial_begin.” (For example: If you start off facing down, you would have the on hero touch event turn on the switch “DownDir”, and “Trial_begin”) Then at the places where the roads turn, you put in another on hero touch event that turns on the switch of the direction you are going when you change, and turn off the other direction switches. (EX: If you are chaining and go to the left, you would turn on the switch “LeftDir,” and off with the other direction switches.) Now one the places where the track would change elevation (going uphill or downhill), put an on hero touch event on the place where it would start, and turn on the corresponding switch, and turn off all the directional switches except for the one that you are currently going at, which should be either up or down, and the opposite elevation switch (EX: If you have a place that is going downhill and it’s direction is down, turn on the “downhill” switch, turn off all right left and up switches, and turn off the “uphill.”) At the bottom, you would have another even that turns off both elevation switches and turns on the switch that corresponds with the direction that you are going again. Eventwise, it should look similar to the picture below:



Energy and Moving

Now that you have this done, it’s time to make the system that makes the bicycle move, wipeout, an energy-o-meter and make the finish line events.

The system that this tutorial is going to use for how to make the bicycle move, is for the player to have to continuously tap the arrow button of the direction that they are facing to increase speed. The faster they go, the harder it gets to increase the speed of the bicycle. Also that uphill and downhill effect the speed of the bicycle (uphill is harder to pedal, and downhill is easier to pedal), and how to make it so they have a certain amount of energy, so it seems more realistic.

Now, the first thing that you have to get here is some more graphics. What you are going to have to
make, is something for your energy bar. You can do it in various ways, but in this tutorial, we are going to do in a way that you can think of as something like this:



Anyway, it probably shouldn’t look that crappy, but basically this is the scoop on how it’s to work. You have four different pictures. One is full (like the picture) the next is the same picture without out the fourth thing (green dot on the picture) and so on till it would have 1 thing on it. When it’s 0, you would fall down, and have to leave the track and try again later. Of course, in real life, over time energy gets back little by little, and we’re going to make it the same way for this system. So basically you’ll have to even out all the times that you hit, because you’ll need to hit at a more steady pace. This system will be on taking away energy on how many times that you hit it within certain amount of times. (Like if you hit it like 60 times you would lose a energy point. Yeah, that might sound high, but I tried it myself, and I go 81 hits within 10 seconds going as fast as I could, so 60 might actually be a little high if you want them to have a steady pace. Of course, you are just only making the system, so you can change it as it feels right later.)

Let’s work on this. Open up your common events tab in your database (F8), and make a new common
event. Make this common event a parrell process common event, and have it’s starting condition switch be the switch “Trial_begin.” Name this common event, “Energy System.” You’ll soon be adding to this, but for now, hit the apply button and go back to your track event.

Now go to your “Time Trial System.” Now on all of the pages, (except for the uphill and the downhill events) make the events parrell process events. On the page with “Down Dir” , put in a label event (we’ll call it label number two), then below that, put in an enter password event. Have it use the variable “Bike_Movement.” Select the box with (1,2,3,4), do not hit the wait until key is hit, and hit the okay button. Now below that, put in a fork option that says, “IF variable ‘Bike_movement’ is equal to 1, then” make add one to the variable “Energy,” and one to the variable “Speed.” Then below that, put in a wait event for 0.1 seconds. Below that, put in a change variable event that set’s the variable
“Bike_Movement” down to 0. Then go back to the label that you used. Do the same thing for the other directional events. Just be sure to use a different label, and have what the fork equals be different. Just remember to follow the password commands diagram.
----
-1 stands for Down
-2 stands for Left
-3 stands for Right
-4 stands for Up
----
Once you have this done, go back to your “Energy System” common event that is located in your
database. In here, make a fork option that says, “IF variable ‘Energy’ is above 60,” (Above in a fork condition means equal to, or higher.) have it take away one from the variable “Energy_scale.” Then make it set the variable “energy” down to zero (0). Now make a fork option below that that says, “IF variable ‘Energy_scale’ is equal to 0, then” now here, make your characters graphic change, to make it look like they fell off the bike or something, and make them stop moving and turn off the “Trial_begin” switch, and all the other switches that you used in this tutorial, and all variables used down to zero. (Remember just to turn the switches on as necessary when you begin the trial, and variables should take care of themselves with the switches coming back on.) You can now have it do what you like, like teleport them back to an inn, or some place.

The next thing that we have to make is a system that displays your energy bar. So go back to your track map and make a new event on it. Make this event a parrell process, and have the event’s starting condition switch be the switch “Trial_begin.” First thing, make a fork option that says. “IF variable ‘energy_scale’ is equal to 4, then”, Now in here, display the picture that shows full health as picture number 4. Then erase picture number 3. Now make a fork option in the else case that says, “IF variable ‘energy_scale’ is equal to 3, then” Have it erase picture 4, and display the energy graphic that is three-quarters full as picture number three. In the else cases, make a fork that says, “IF variable ‘energy_scale’ is equal to 2, then” make it erase picture number 3, and display the one-halves full energy bar graphics. In the else case, make a fork for when “Energy_Scale” is one, erase picture one, and display the one-quarters full picture.

Now we have to make a system for the energy to return over time. Make a new common event. Make
this event a parell process event, and have the starting condition switch be the switch “Trial_begin.” Name the event “Energy System 2.” In here, Put in a wait command. Now when you finalize the system on your own, you can change it to whatever you desire by playing around with it, but for this tutorial, we will make it 40 seconds. So in here, put in a new label event, put in a wait 40.0 seconds event. (Make sure it’s not 4.0 seconds) Then put in a fork option that says, “IF variable ‘energy_scale’ is equal to 4, then” have it return to the label that you just used. In the else case, put in a fork that says, “IF variable ‘energy_scale’ is below 3, then” (remember, below means equal to or less.) have it add one to variable “Energy_Scale” by using a change variable command, and return to the label.

Now you pretty much have an energy system. You of course could make your hero’s graphics change as the energy changes, but we aren’t going to do that in the tutorial.

Wipeout!

Now you’ll have to make it so that when they are on the track, they don’t get off the track. This can be accomplished by making wipeout events. Just make an on hero touch event, in the event, make them do what you want to do when they wipe out (graphic change, teleport to an inn, etc.). Now copy and paste that event on the outsides of the track to tiles wide on each side. To make it quick, you’ll have to use the Ctrnl + C and Cntrl + V thing. Just copy using Cntrl + C, and to paste, continuously hit Cntrl + V over the different tiles, if you didn’t know that already. It should look something like this.



Focusing On Moving

Now that we have the energy system completed, we have to make the character be able to move on their bicycle. We have already done the event that makes the password event for the moving event, and adds to variable “Speed” which is our main movement variable. Now we just have to add to this so speed increases. So now, go into your database (F8), and go back into the common tabs event again. Make a new common event. Have this common event be a parrell process event, and have this event’s starting condition switch be “Trial_begin.” Call the event, “Bicycle Speed.” Now in here, put in a wait 3.0 seconds event, and then a fork option that says, “IF variable ‘Total_speed’ is below 4, then”, directly below it (or, not in the else case) put in another fork option that says, “IF variable ‘Speed’ is above 5, then” make it remove 5 from the variable ““speed”, and add one to the variable “Total_Speed.” Then turn on switch “SpeedIncrease,” wait 0.3 seconds, and then turn off the switch “SpeedIncrease.” In the else case, put in a fork option that says, “If variable ‘Total_speed’ is below 4,” and below that, “IF variable ‘speed’ is smaller than 5, then” make it remove one from the variable “Total_speed” and turn on switch
“SpeedDecrease,” wait 0.3 seconds, and then turn off the switch. We will expand on this later, so for now, hit the apply button.

Now make another common event. Make this common event an AutoStart event, and call the event
“Speed Increase.” Make the starting condition switch for this common event be “SpeedIncrease.” In here, make it add once to the hero’s speed by using a change event command, and adding to speed (not frequency), and then wait 0.3 seconds. Then make another common called “Speed Decrease. “ Make the event an AutoStart event, and have it’s starting condition switch be “SpeedDecrease.” In here, make it decrease the speed of the hero, and wait 0.3 seconds. Now hit the apply button and return back to the movement event.

Now in the last else case of “Bicycle Speed” and put in a fork option that says, “IF variable ‘Total_speed’ is more than 5,” and then in a fork below that fork, “IF variable ‘total_speed’ is less than 9, then” below that, “If variable ‘speed’ is above 10, then” make it do the same things as the one did before. Now you’ll have to make another common event for the other speeds, because the waiting time is going to change. Just continue the pattern up as far as you want, always increase by fours, and changing for each two different speed changes. Not too hard, right? You should probably end with 30 to “Total_speed” or something. This is really just a chance to play around right here.

Now put the same thing that you had on the “Time Trial System” Event, with the page for “DownDir” on all the other direction events. Now on the page for “Uphill” have it add two to energy instead of one, and add one to the variable “Uphill_move.” Then make a fork below that says, “If variable ‘Uphill_move’ is above 3, then” make it add one to speed. On the downhill page, make it not add anything to energy, and make speed increase by 2 instead of 1.

Coasting

On the tracks event, make a new event. Make this event’s starting condition be when variable
“Total_speed” is 1 above. Make this event a parrell process event. Make the first thing in the event a fork option that says, “If switch ‘uphill’ is on, then” have it do nothing. In the else case, make a fork option that says, “IF variable ‘downdir’ is on, then” make it use a move event command that moves your hero down, by using a face down , and move down. In the else cases, do the same for all the directional switches, and for downhill make it go downwards, (because you can’t go down hill going up, right?)

End of the Track Events

You remember the timer event, right? The you made in the begging? Now it’s finally time for that to be used. Whahay! At the end of the track, make an on hero touch event that turns off the switch “Trial_begin” and other switches that you feel should be off, and variables you feel should be to 0, but not the time timer stuff, nor “Total_speed” (not yet) because you need them, for a little bit anyway. After that’s done in the on hero touch event, make them be teleported to someplace where they hear their score automatically (this event should be an autostart event) with a message saying, “Your time was \\v[xx] seconds! (replacing xx with the number variable that “timer” is, also if \\ shows up as two slashes, you only use one, if not, well, :D). Then make a fork option that says “IF variable ‘Timer’ is above variable ‘HighScore,’ then,” make it set variable “Timer” To “HighScore” and “Timer” down to zero. Then you make it say what the HighScore is by using a \\v[yy](replacing yy with the number of the variable that “HighScore.” is. Then below that, make a fork that says, “IF variable ‘Total_speed’ is above 30, then” take away 30 from their hero movement speed, and so on till it’s down to one, because you don’t want them to move a lot faster on the track than they normally can, and it’s unlikely they get over thirty. Then set “Total_speed” to 0.

So that’s really all their is to making a bicycle timer trial system in your RPG! So Congratulations!

Remember: This tutorial is only on how to make the engine, and it’s the definate way, so feel free to change the speeds of things, wait times, etc. to how you want it to be!

Good Luck!

Remember,
“Even the greatest gamers were n00bs.”

- ATARI