Gw Temp

Menu

Tutorial - 'Lag Free Face System' by CrazyRob

An item about RPGMaker 2000 posted on

Blurb

An interesting system by CrazyRob that changes the character faces in the RM2K(3) menu to reflect a character's emotions, etc.

Body

Lag Free Face-Changing Tutorial

(Or how to show a character’s displeasure at bleeding from every orifice.)

This is a simple (I.E: You won’t need a degree in rocket physics to figure this one out.) tutorial designed to add life to a game by changing a character’s face as HP drops, because, hey, who smiles after getting their arm hacked off?


Ok, you need only one common event for this, but be prepared, as precision is key here.

You need a couple of free thing off the bat:

1 Free variable for the menu password. (You’ll see.)

2 Variables per character, CurrentHP and MaxHP. We’ll use my character, Blade, as an example. So, hereafter, the two are known as BladeHP and BladeMaxHP

5 switches per character for the face transitions. GoodStatus, Fair, Bad, Neardeath, and Dead

5 label points for each character, and one to either bring up the next character’s face process or to bring up the menu. (We’ll just do this for one character, though.)

5 different faces for the characters. (But that’s the whole point, right?)

Ok, from the top, let’s think of a few things.

Unless you’re using one of the new battles systems (The one that shows character portraits), or an overworld custom menu that shows the character portraits, the only time the player sees the character faces is when he/she opens the menu. So why not use that as the main event where all the face-processing is done, rather than cause lag in the game with a lot of reoccurring processes?

On to the common event. Set it as Parallel process, with the switch condition being blank and off (No check in the box). This may sound like lag city, but trust me, it won’t do any such thing.

Now, at the very beginning, create a key input processing event, the variable going into the menupassword variable I told you to create (Note: Don’t use this for anything else.) Have it only process the cancel key, which normally brings up the main menu. This should input the number “6” into the password variable.

Now, make a condition branch (No else case) with the criteria being that the passwordvariable is 6.

Under the branch condition, forbid main menu access. This prevents the default function of the cancel key from disrupting the face processes.

Now, set down your first Label, 1. This will come in handy for resetting the face if the character should be slain and then revived somehow.

Now, then, the fun part. (And by fun, I mean equivalent to flossing a saber-toothed tiger on acid with barbed wire. Just joking.)

Set the BladeHP variable to the current amount of HP the character (Blade) has. For those of you unfamiliar with this process, the Hero case allows a dropdown list of all heroes in your game. Click on the one you want to use, and select from the menu to the right, “HP”. This inputs into BladeHP the amount of current HP.

Now, Set the BladeMaxHP to, you guessed it, the Maximum HP value of the character.

Next, we have a little division cut out for us. In variable processing, divide the BladeMaxHP variable by 10. Next, multiply that by 8.

Now make a branch condition. (Else case included) If BladeHP is equal to or greater than BladeMaxHP (now at 80% of it’s normal value), then, have a branch condition check to see if The switch “goodStatus” is on. If so, jump to label 6. If not, have the else case change the character face to the face you want to express good health, switch Goodstatus on, and Fair, Bad, Neardeath, and Dead off.

As for the else case, (If BladeHP was less than the 80% value of BladeMaxHP.)
Switch StatusGood off, and jump to label 2.

Now remember the first branch condition? At the end of it, Place the label 2.
Now we basically repeat the first branch with a few changes.

In VO (Variable Operations), reset BladeMaxHP to the Maximum HP value of said character, restoring it from it’s previous 80% value.

Now, divide BladeMaxHP by 10, and multiply the result by 6. This gets the 60% value of the MaximumHP value.

Now, Make a BC (Branch Condition) checking to see if BladeHP is greater/equal than BladeMaxHP. (Else case) If so, make a BC (else case) checking if the Switch “Fair” is on. If so, jump to label 6. If not, in the else case, change the face to what you want to represent fair status, turn switch Fair on, and Bad, Neardeath, and Dead off.

Now return to the BC checking to see if BladeHP was greater than BladeMaxHP (60% value). At the very end of that BC, (after the END line), place the Label 3. In that same BC’s else case, turn switch Fair off, and jump to label 3.

Since it gets repetitive after this, repeat what we did for the first and second face changes two more times, reseting BladeMaxHP back to the character’s max HP, dividing it by 10, and multiplying by 4, then 2, to get the 40 and 20% value, repeating the above steps for both.

Now, finally, we should have four “sets” of face changes, each beginning with a label. At the last change set, at the END case of the first BC, place label 5. Now we check to see if the character is dead.

Make a BC checking if BladeHP is equal to zero, with an else case. If it is zero, make another BC checking to see if “Dead” is on. If it is, jump to label 6.
If not, (else case) change the character face to what you want to represent death,
And turn Dead on. Then jump to label 6.

At the very, VERY end, place label 6. This allows the label six jumps to skip all the other processing and not cause lag.

Still confused? Here’s a poorly made chart to help (confuse) you.

Key Input Proc. V:Menupassword
>BC: If V:Menupassword is 6
>>Label 1
>>VO: V:BladeHP- Set to Character’s HP
>>VO: V:BladeMaxHP- Set to Char’s Max HP.
>>VO: BladeMaxHp / by 10
>>VO: BladeMaxHp x 8
>>BC: If BladeHP is V:BladeMaxHP or More
>>>BC: if switch StatusGood is on
>>>>Jump To Label 6
>>>>
ELSE
>>>>Change Face Association: (Face of Good Health)
>>>>Switch Op: StatusGood ON
>>>>Switch Op: Fair Off
>>>>Switch Op: Bad Off
>>>>Switch Op: Neardeath Off
>>>>Switch Op: Dead Off
>>>>Jump to Label 6
>>>>
END
>>>
ELSE
>>>Switch Op: StatusGood Off
>>>Jump to label 2
>>>
END
>>Label 2
>>VO: V:BladeHP- Set to Character’s HP
>>VO: V:BladeMaxHP- Set to Char’s Max HP.
>>VO: BladeMaxHp / by 10
>>VO: BladeMaxHp x 6
>>BC: If BladeHP is V:BladeMaxHP or More
>>>BC: if switch Fair is on
>>>>Jump To Label 6
>>>>
ELSE
>>>>Change Face Association: (Face of Fair Health)
>>>>Switch Op: Fair ON
>>>>Switch Op: Bad Off
>>>>Switch Op: Neardeath Off
>>>>Switch Op: Dead Off
>>>>Jump to Label 6
>>>>
END
>>>
ELSE
>>>Switch Op: Fair Off
>>>Jump to label 3
>>>
END
>>Label 3
>>VO: V:BladeHP- Set to Character’s HP
>>VO: V:BladeMaxHP- Set to Char’s Max HP.
>>VO: BladeMaxHp / by 10
>>VO: BladeMaxHp x 4
>>BC: If BladeHP is V:BladeMaxHP or More
>>>BC: if switch Bad is on
>>>>Jump To Label 6
>>>>
ELSE
>>>>Change Face Association: (Face of Bad Health)
>>>>Switch Op: Bad On
>>>>Switch Op: Neardeath Off
>>>>Switch Op: Dead Off
>>>>Jump to Label 6
>>>>
END
>>>
ELSE
>>>Switch Op: Bad Off
>>>Jump to label 4
>>>
END
>>Label 4
>>VO: V:BladeHP- Set to Character’s HP
>>VO: V:BladeMaxHP- Set to Char’s Max HP.
>>VO: BladeMaxHp / by 10
>>VO: BladeMaxHp x 2
>>BC: If BladeHP is V:BladeMaxHP or More
>>>BC: if switch Neardeath is on
>>>>Jump To Label 6
>>>>
ELSE
>>>>Change Face Association: (Face of Neardeath)
>>>>Switch Op: Neardeath ON
>>>>Switch Op: Dead Off
>>>>Jump to Label 6
>>>>
END
>>>
ELSE
>>>Switch Op: Neardeath Off
>>>Jump to label 5
>>>
END
>>Label 5
>>BC: If BladeHp is equal to 0
>>>BC: If switch Dead is ON
>>>Jump to Label 6
>>>
END
>>
ELSE
>>Switch OP: Dead Off
>>Jump to Label 1
>>
END
>>Label 6
(Now here, you can begin another character face calculation with Labels 7 through 12, or end it and open the menu.)
>>Open main menu: (Don’t worry, this overrides the forbid main menu)
END

And that concludes my face-changing tutorial. As with all my good tutorials, this was done at 4:00 am when the voices are most active, so drop me a lien at RobCrosby@houston.rr.com if you find any mistakes or need help.

Until next time,

Crazy Rob