Gw Temp

Menu

Tutorial - 'Hide-and-Seek Tutorial' by AzureFenrir

An item about RPGMaker 2000 posted on

Blurb

Another tutorial by AzureFenrir, this time it's a RPGMaker tutorial and covers how to make a hide-and-seek minigame.

Body

Activating RM2K Tutorial Writing Sequence...
Status: Success (1)...Rebooting AzureFenrir...

Hi! This is AzureFenrir, the C++ Tutorial Idiot in RM2K mode! I come to thee with a tutorial on making a hide and seek mini-game for RM2K.

OK, let's skip the intro crap and get to the point:

THINGS THAT YOU NEED TO KNOW:

How to Use RM2K/Basic Commands
Using and Manipulating Switches
Fork Statements
Timer Operations


A hide and seek mini-game is basically a game where you have a set amount of time to find a number of different things. If you find everything in that set

amount of time, you usually win a cool item. If you don't...well, better luck next time :).

Before you start, here's the switches you need:

SWITCHES AND VARIABLES:

1 Switch to begin mini-game - "HideandSeek"
1 Switch for every object that you need to find - "Hideseekn"


Now, let's start with the "old man" (or event) that initiates the hide and seek game. Make a new event and name it STARTHIDE. Give it a suitable graphic.

Of course, he should do something cool before the hero acepts his challenge, so let's these to his event:

<>Messg:OLD MAN: Finds thou the seven green aliens,
: :Grantst thou I shall a prize.
<>Flash Screen: (R31,G31,B31,V31), 1.0sec(W)

You can change this to whatever effects you want, like maybe show a battle animation of the world blowing up?

Now, a hide-and-seek game would be boring if you have an unlimited amount of time to find the stuff, right? That means we should add a timer to make the

game somewhat challenging.

SUPER-QUICK TUTORIAL: TIMERS

Timers are very useful tools in RM2K that allows you to time events, add clocks to your game, etc. RM2K allows you to use one timer at a time, which, for

the purposes of this tutorial, is perfectly acceptable.

You can set a timer by clicking RM2K's Timer Operations... button, clicking on the "Set" option, and then typing the time that you want to set the

timer to. You can start and stop timers by clicking Timer operations..., and then selecting the start and stop options, respectively.

You can poll timers using the Fork Conditions... button. Just select the "Timer" option on the first page.


Use the timer operations feature to set the timer to the amount of time that you want to give the player, and then start the timer, like this:

<>Timer Operations:Create 0m.35s.
<>Timer Operations:StartTmr

Now, turn the HideandSeek switch on so that our game can begin:

<>Change Switch: [0007:HideandSeek]-ON Set

There's one problem though - the old man remains even after the game has started. And what's worse - every time you talk to that crazy bastard, he resets

the time, giving the player EVEN MORE TIME to find all of those objects! That cheating old man...

Anyway, to fix this problem, add another page to the STARTHIDE event, make the image blank, check the switch checkbox, and set the page to activate when

switch [HideandSeek] is on. That should get rid of the old man when the game starts.

Now, let's move on to the objects. Add a event to the hide-and-seek map, name it OBJECT1 (or whatever you want), and have it show up when switch

[HideandSeek] is ON. Add whatever special effects you want for the object, but make sure that you add the code to change the object's switch ON:

<>Change Switch: [0008:Hideseek1]-ON Set

You DID remember to reserve one switch for every object, didn't you? DIDN'T YOU? You did? Good :) Now just add another page, set it's sprite to a blank

one, and have it activate when switch [Hideseek1] is on. This will make the object disappear when you find it. Repeat this for every object.

Finally, you need to detect when the player has acomplished this task. This can be accomplished by adding another event and making it Parallel

Process
. Now, if the timer runs out, then the game stops, right? So click FORK Operations..., select the "Timer" option, and set it to 0 min, 1

seconds, less, like:

<>FORK Optn:Timer 0m.01s.less

Now, have the FORK condition turn off all of the object switches, as well as the [HideandSeek] switch:

<>FORK Optn:Timer 0m.01s.less
    <>Change Switch:[0007:HideandSeek]-OFF Set
    <>Change Switch:[0008:Hideseek1]-OFF Set
    <>Change Switch:[0008:Hideseek2]-OFF Set
...
:END Case

So what if the winner finds all of the objects? Well, let's add another FORK to take care of this:

<>FORK Optn:Switch[0008:Hideseek1]-ON
    <>FORK Optn:Switch[0008:Hideseek2]-ON
    <>Note: Repeat for each "object"...

Now, insert a Timer Operations - Stop Timer inside the nested FORK statements. This will stop the Timer when the player finds all of the objects and thus

wins the game. Now, add the code for the player's reward, and then change the switch [HideandSeek] OFF.

Here's an example:

<>FORK Optn:Switch[0008:Hideseek1]-ON
    <>FORK Optn:Switch[0008:Hideseek2]-ON
        <>Timer Operation:StopTimr
        <>Messg:OLD MAN: Thou hast succeeded!
        : :I praise thee!
        : :Thou shall receive this prize!
        <>Messg: Received SLIME SWORD!!!
        <>Add/Remove Item:Slime Sword-> 1 Incr.
        <>ALEX: Hey! This isn't Romancing Walker!
        : :Where's the real prize?
        <>Messg:OLD MAN: Bee happy and bee healthy
        : :with what thou hath, young man...
        <>Note: Quote (c) Kelloggs, Inc.
        <>Change Switch:[0007:HideandSeek]-OFF Set
        <>
    :END Case
    <>
:END Case
<>

If you want to make this a one-time game, then you can add another switch that will permenantly end the game and make the old man disappear if the player

completes the game.

GOING FURTHER: MACALANIA FOREST BUTTERFLY GAME

If you ever played FFX, then you know what the Macalania Butterfly game is. If you didn't, it's a mini-game where you try to touch all of the blue

butterflies to win a cool prize. There are also red butterflies, which will knock about three seconds off of your time and force you to enter a battle.

The butterfly game is similar to our hide-and-seek game. All you really have to do is make the "objects" activate On Hero Touch and give them a

butterfly sprite. However, the red butterflies are a bit more difficult, since the RM2K timer does not support a -3 seconds feature.

There are two solutions. The easy way is to add a Wait statement to force the player to wait three seconds every time they touch a red butterfly. However,

the real-time wait is frustrating to some players, and will make your game look more "newbish."

If you know how to use variables, there is a better alternative. Reserve a variable called...say...TimerTemp, and use the following code:

<>Timer Operation:StopTimr
<>Variable Ch:[0004:TimerTemp] Set, Timer Time remain
<>Variable Ch:[0004:TimerTemp] - , 3
<>Timer Operation:Create V[0004]
<>Timer Operation:StartTmr

I'll explain this script. We begin by stopping our timer (Timer Operations..., "Stop" Option) so we can reset it. Then, we set a variable named

[TimerTemp] to the amount of time remaining in the timer (Change Variable..., "Other" Option, "Timer Seconds Left" Option) and subtract it by three.

Now, we reset the timer to this new variable (Timer Operations..., "Set" Option, "Variab" Option) and restart the timer, which should now contain 3

less seconds than it did before.

You can also have the player enter an unescapable battle by using the Disable Escape... and Start Combat... features.

FINAL NOTE: If you want the player to enter a battle every time he/she touches a red butterfly, then you should make sure that "Available in Battle"

option is disabled. Otherwise, the timer will continue during the battle, and the player will lose much more than a few seconds.


I hope that this tutorial helped :). Tada.

AZUREFENRIR