Gw Temp

Menu

Tutorial - 'Super Easy Step System' by dragonheartman

An item about RPGMaker 2000 posted on

Blurb

Ever wanted to make a counter that counts the amount of steps you take? Then read on!

Body

Basically by setting up a parallel procass event an dropping a few lines of code, you can make a step system. Other variations could include a better random encounter system (random step 25-40 instead of 1-40), or even a step system. This is very easy to do and I don't think it's been done yet, so here goes!

Go to the database and make a common event. Name it "Step Track X". It should be parallel process (activated by switch if you wish).

Set a new label and then have a variable track the hero's X coordinate. Then set a new label and track the hero's X coordinate by a different variable. Add a fork condition here checking if the variables (both X coordinate checkers) are the same (add else case). Under the true case, have your script go to the second label you made, thus checking the coordinate for the second time again. Under the else case, have it change variable "steps taken" plus one and then go to the original label. Confused? The script runs through, checks the x position twice. If you ever take a step to the left or right, the variable for the second X position tracker changes and your step counter increases by one and the script loops. Here is the source code:


<>LABEL: 2No
<>Variable Ch:[0141:hero X pos again] Set, Hero X pos
<>LABEL: 1No
<>Variable Ch:[0142:hero x pos again2] Set, Hero X pos
<>Wait: 0.1s.
<>FORK Optn:Varbl[0142:hero x pos again2]-V[0141]Equivl
<>GO TO Label: 1No
<>
: ELSE Case
<>Variable Ch:[0138:Steps Taken!] + , 1
<>GO TO Label: 2No
<>
:END Case
<>

*Note: variable numbers and label numbers may differ.

Now what about Y coordinates? I'm sure there is a way to squeeze that in my code, but I'm not very efficient, so make a new common event. Name it "Step Track Y". This is basically the same except you check the hero's Y coordinate like so:


<>LABEL: 2No
<>Variable Ch:[0139:heroYpos again] Set, Hero Y pos
<>LABEL: 1No
<>Variable Ch:[0140:HeroYpos again2] Set, Hero Y pos
<>Wait: 0.1s.
<>FORK Optn:Varbl[0140:HeroYpos again2]-V[0139]Equivl
<>GO TO Label: 1No
<>
: ELSE Case
<>Variable Ch:[0138:Steps Taken!] + , 1
<>GO TO Label: 2No
<>
:END Case
<>


And BAM, you're done. If you want sound effects, ass a "Play sound effect" after the line of code where you add the step variable plus one. (Might want to slow stepping speed down to 1/2 normal so it sounds more realistic). If you want to make a better random encounter system, have it change a variable random 25-40. Under that else case of the fork condition, change another variable plus one. If the two variables mentioned are the same, start combat.

That's it! Simple, eh?

-dragonheartman