Quote: * @losl is back after 16521370w 3d 4h 12m 6s | <...
blade2k » articles & tutorials

jump to:
Tutorials » Game Creation » RPG Maker 2000

Make a Scan Command


Reading Article
Author: The Fierce Diety
Posted on 08/03/2004
print :: back to list
Use this tutorial to make a scan command

T

his tutorial will allow you to view a monster's current HP/max HP and current MP/Max MP. I have done this using Rm2k3, so I'm not sure if it works with Rm2k.

Making a scan command requires one command, one condition, 4 or 5 variables, one page of battle events, and one animation.

First, make the command. Call it "Scan." Set its archtype to attack. Give it to a character. Let's call him "Alex" for now.

Now make a condition. Why do we need a condition? This stops the character from attacking when the command is used and lets the battle events do the work. Call it "Normal" and set its color to whatever the color is when a character does not have a condition. Make the priority 1 and set action restrition to "no action allowed. Set recover to 100% chance to recover every turn. Set the animation to #4, the skill use animation.

Next, make the variables. You have two choices now. If you do not want the command to use any MP, only make the first four variables. If you do want it to use MP, make the fifth one. Call the first four Scan1, Scan 2, Scan3, and Scan 4. If using the fifth one, call it "Alex MP." Let's pretend you are using variables [0001] - [0005].

Now make an animation called scan. It doesn't matter what it looks like, do whatever you want.

Now for the battle events. This is the tricky part. Put eight monsters in the monster group. Let's call them monster 1 - monster 8. Make the trigger Hero Alex uses the Scan
command. Now, if you are using the fifth variable, use variable operations to set the variable to Alex's current MP. If you don't want to do that, just skip that step. Now change alex's condition to the "normal" condition you just made. Now if you are using
the fifth variable, make a conditional branch and execute a custom handler if the condition isn't met. Set the condition to Variable [Alex MP] is greater than or equal to x. x is the amount of MP you want scan to cost. The change Alex's MP and subtract X.
Under the else handler, make a message saying "Not enough MP!" If you are not using the fifth variable, just skip that step entirely.

Next, make another branch. If you are using the fifth variable, make this go under the main section of the previous branch. Make the condition for the branch "Monster 1 is the current target." Now show your scan animation on moster 1. Now use variable operations. Set [Scan1] to monster 1's current HP. Set [Scan2] to monster 1's max HP. Set [Scan3] to monster 1's current MP. And set [Scan4] to monster 1's max MP. Now show a message saying the following: "Moster 1 - HP v[0001]/v[0002]
MP v[0003]/v[0004]
That coding refernces the variables you just set. If you are not using variables [0001] - [0004], change the numbers to the ones you are using. Feel free to add in any other info on the message, such as weakness or resistance to elements. Now copy that branch and paste it under itself. change the target to monster 2, show the animation on monster 2, and set the variables to monster 2's stats. Keep doing this until you have a seperate branch for all 8 monsters. Now copy this page and put it in all of your monster groups. It will work no matter how many monsters you have, just remember, if you did include the monster's name in the message, to change it for every monster.

The coding should look like this -

Trigger [Alex] uses the [Scan] command

<>Variable Oper: [0005: Alex MP] Set, Alex MP *
<>Change Cond: Alex Normal Inflict
<>Branch: Var [0005: Alex MP] is X or more *
<>Change MP: Alex's MP X Remove *
<>Branch: 1: Monster 1 Targetted **
<>Show Battle Animation: Scan, 1:Monster 1 (Wait) **
<>Variable Oper: [0001: Scan1] Set, 1:Monster 1 HP **
<>Variable Oper: [0002: Scan2] Set, 1:Monster 1 Max HP **
<>Variable Oper: [0003: Scan3] Set, 1:Monster 1 MP **
<>Variable Oper: [0004: Scan4] Set, 1:Monster 1 Max MP **
<>Message: Monster 1 - HP v[0001]/v[0002]
MP v[0003]/v[0004] **
<>
: End
<>
: Else Handler
<>Message: Not Enought MP! *
<>
: End

* - this is optional, use this only if scan costs MP
** - copy this and change the target to other monsters so that scan works for all 8
monsters.

If you have any questions, BMS me - The Fierce Diety