Gw Temp


Tutorial - 'Timed Item Hunt Mini Game' by Lith

An item about RPGMaker 2000 posted on


Learn how to create a mini-game where you must collect a set amount if items in a limited amount of time.


This tutorial will teach you how to make a mini game in which a predetermined number of items must be gathered within a certain time limit. This game could be used for a number of different things. Such as, a machine is about to malfunction unless you can gather all it's spare parts in time. One example in my game is you need to gather twigs to start a fire before it get's dark, or monsters attack you. This will be the example I use throughout this tutorial. Now let's begin.

It's best if you know the basics of switches, variables, fork conditions, timer functions, common events, and parallel processes to fully understand this tutorial, but it is not neccessary because I will give you a complete example.

First, create a new map where the mini game will take place, in the example it will be a forest. Spiff up your map however you want.
Now create a transparent event and name it something like "Mini Game Start".
Set it as parallel process and event condition as
Variable 0002:Game Started
0 Above.
In event commands, add a Wait 0.0, then choose Timer Operations (1st Tab) and set a timer to 30 seconds or whatever your time limit will be. Next, add a message telling the player what the objective is, such as "Gather 6 twigs to start a fire. Hurry, it's almost dark!". Next, make a switch called 0007:Mini Game Begins and turn it on. Finally, add in a Clear Timer event.

Your code for the first page should look like this:
() Wait: 0.0s
() Timer Operation:Create 0m.30s.
() Messg:Gather 6 twigs to start a fire.
: Hurry, it's almost dark!
() Change Switch : [0007:Mini Game Begins]-ON Set
() Clear Timer

Now, create a new page for this event. Keep it as a parallel process but make Event Conditions
Switch 0007:Mini Game Begins - ON
For your code, add in a Wait 0.0s. Next, change the variable 0002:Game Started to -1. And finally, under Timer Operations, start the timer.

Your code for the second page should look like this:
() Wait 0.0s
() Variable Ch:[0002:Game Started] Set, -1
() Timer Operation:StartTmr

Create a 3rd page for the same event and keep it as Parallel Process. Event conditions should be
Switch 0008:Success - ON
In the code, stop the timer and add in a Clear Timer event.

Your code for the third page should look like this:
() Timer Conditions:StopTimr
() Clear Timer

Finally, make a 4th page for the event, still keep it as Parallel Process. Make event conditions
Switch 0009:Failure - ON
Leave the code blank.

(NOTE: This next event can and should be changed to fit your game. I coded this as a demo, and I'm only showing it now as example.)

Now, let's create another event and name it Faliure or whatever you'd like to call it. Make it transparent, and set it as Autostart. Event conditions should be:
Timer 0 min 0 sec.less
In the event commands section, turn the switch 0009:Failure on. Add in a Wait 0.0s. And fade out the BGM by about 3 seconds. Now play a sad sounding midi or something, I chose GameOver3 from the RTP purely for example. Add in a message telling the player they were too slow. Wait a few seconds, fade the BGM out, erase the screen, and goto the title screen.

Your code for the Failure event should look like this:
() Change Switch :[0007:Failure]-ON Set
() Wait 2.0s
() Fade-out BGM: 3s
() Play BGM: GameOver3
() Messg:You were too slow...
() Wait 5.0s
() Fade-out BGM: 3s
() Erase Scren:Fade-Out
() Goto Title Screen

(NOTE: This event can and should also be changed to fit in with your game. This code only applies to the demo, but is used for example.)

Now create another Autostart, transparent event. Name it Success and set the event conditions as:
Switch 0008:Success - ON
In the code, turn the switch 0007:Mini Game Begins off, play a success SE (I chose Decision2 from the RTP for example), show a success message, and play some happy music. For this demo, I then waited 5 seconds. faded out the BGM, erased the screen, and went to the title screen.

The code for the Success event should look like this:
() Change Switch : [0007:Mini Game Begins]-OFF Set
() Play SE: Decision2
() Messg:Success!
() Play BGM: Ending3
() Wait 5.0s
() Fade-Out BGM: 5s
() Erase Scren:Fade-Out
() Goto Title Screen

Okay, we're almost done (well, sort of..). Now create an event somewhere on the map, this is going to be where the player goes after they've collected all the items. You can make it transparent, or a picture of something. Mine is transparent since it's just a spot on the ground where the player goes to start a fire, though it is surrounded by leaves so they know where to go. Now, set the event as Push Key, and Same Level as Hero, there should be no event conditions. In the Event Commands, add a Fork Condition (3rd Tab) with an Else Case. For the Fork Conditions, make it where the Variable 0001:Twigs is the same as 6. Inside the Fork, fade out the BGM and turn the switch 0008:Success on. In the Else Case, put a message saying the player doesn't have enough twigs. Now make another page and set it as Parallel Process, and event conditions should be:
Switch 0008:Success - ON
Change the graphic to a fire or whatever best fits your game. Leave the code blank.

Now, press F8 on your keyboard to open up the Database. You can also open the Database by pressing the corresponding button on the top menu, or selecting Tool from the drop-down menu and then Database.
Go to the Common Events tab and name an event Darkness Comes or something of the like. Set it to Parallel Process. Appearance Conditions Switch should be checked and 0007:Mini Game Begins selected. Now in the code set the screen tone a shade darker than the original. Uncheck Wait until Done and set it to where it takes about 5 seconds to change. Now do 4 more of these. Each making it darker. The code should look like this:

() Set Screen Tone:(R090,G090,B090,S100),5.0sec
() Set Screen Tone:(R080,G080,B080,S100),5.0sec
() Set Screen Tone:(R070,G070,B070,S100),5.0sec
() Set Screen Tone:(R060,G060,B060,S100),5.0sec
() Set Screen Tone:(R050,G050,B050,S100),5.0sec

Now, make another Common Event and name it Firelight or something like that. Set it as Parallel Process and Appearance Conditions Switch as 0008:Success. In the code, set the screen tone to something a little dimmer than normal. The code should look like this:

() Set Screen Tone:(R070,G070,B070,S100),2.0sec

Close the database, we've gotten all the difficult stuff out of the way. Now, we just need to make the objects the player has to pick up.

Make 6 (or however many items you want)events on the map, and set the graphic to a twig or whatever fits your game. Set the events as Push Key and Below Hero. In the code, add 1 to the variable 0001:Twigs. Play a sound effect letting the player know they successfully picked up the item. And change the switch 0001:Twig1 Collected (Or whichever switch corresponds with the current twig event) to on. Now make a second page, and make the graphic blank. Event conditions should be:
Switch 000#:Twig# - ON
Leave the code blank.

Make sure you have a different switch for each item, or else when you just have one switch and you turn it on, all the items will disappear.

I have uploaded an example of this mini game to my website, you can download it here.
Note, the file is in RAR format and you need a program like WinRAR to extract it.

This concludes my first tutorial, and I hope you learned something from this. If you use this mini game in your game, I would appreciate it if you put my name in the credits, but it's not neccessary. Thanks for reading!