Gw Temp

Menu

Tutorial - 'Making a Basic Picture Based Health and MP System' by Dimensionwyrm

An item about RPGMaker 2000 posted on

Blurb

A nice (albeit short) tutorial on add an HP bar to your game.

Body

This is a simple tutorial on showing a health bar in rm2k/3. If you are a complete n00b to 2k/3 I suggest learning until you can create a simple ABS before starting as you will have no use for this.

NOTE:THIS IS BASED ON PERCENTAGES.

DIFFICULTY:1/5
SWITCHES:NONE
VARIABLES:"Hero HP", "Hero Maximum HP", "Dummy Max HP"
GRAPHICS:Pictures for:an HP bar in red(or any other color but red looks best) for HP 0-10(A blank bar to a full bar).

-----HP BAR-----

STEP 1:Defining the percentages

Make a new common event. It should be a call event. Set the three variables to the corresponding objects(HP and Max HP).

Next divide the dummy max hp variable by 10(for 10% of the maximum). Now create a fork to check if the current HP and Max HP is the same. Code as of now:

<>Variable Oper:[xxxx:Hero HP]set, Hero HP
<>Variable Oper:[xxxx:Hero Maximum HP]set, Hero Max HP
<>Variable Oper:[xxxx:Dummy max HP]set, Hero max HP
<>Variable Oper:[xxxx:Dummy max HP]/, 10
<>FORK opt:[xxxx:Hero HP], [Hero Maximum HP]Equiv.
<>
:END Case

STEP 2:SHOWING THE PICTURES

Within that fork show the full HP bar in the place you want(50, 30 is good). Now after the end case subtract the hero max HP variable by the dummy max hp variable. Then check if the variable Hero HP is GREATER THAN OR EQUAL TO Hero Max HP. In vthe branch case show the 90% health bar in the same place. Here is the code for after the first branch from the first step:

<>Variable Oper:[xxxx:Hero Maximum HP]-,var.[dummy max hp]
<>FORK Opt:Var.[xxxx:Hero HP] is var.[max hp] or more
<>Show picture:1, 90% HP

:ELSE CASE
(Insert the previous code in bold here but repleace the 90% HP picture with the one below and repeat).
NOTE:Repeat the previous process for the rest of the health

-----MP system-----

Same as health but replace health with MP.

Well there you have it! A simple percentage based health system! If I left anything out PM me or post it in a comment.