Change Hero graphics depending on equipment

This tutorial will show you step by step how to change your Hero's sprites (in-battle as well as overworld) and facesets depending on what equipment they currently wear.

1.GRAPHICS
First of all, you need to have graphics of your Hero's sprites and facesets wearing different kind of suits, and import them into your project. Make sure your graphics have the correct dimensions and are 256 colour PNG files.

2. DATABASE
Open your Database, under the Actors tab set your Hero's starting equipment and graphics. Go to the Classes tab and create entries for each of your Hero's suits. Go to the Animations 2 tab and create entries for each of your Hero's suits.

Also, under the Item tab, create entries for all the suits you want your Hero to be able to equip.

3. COMMON EVENTS

In the Database under the Common Events tab, create entries called Update Sprites, Store Hero Data and Call Hero Data.

4. UPDATE SPRITES

Set the common event called Update Sprites trigger to a Parallel Process.

Event Command -> Call Event

Call Common Events: Store Hero Data.

Event command -> Conditional Branch

Variable: If Hero Suit is not equal to Current Hero Suit

Create entries for both these variables; they will be set later in the tutorial.

Event command -> Conditional Branch -> Tab 2

If Hero has Suit 1 equipped... and check Execute Custom Handler if Condition Not Met.

Event Command -> Change Actor Class

Set Hero's class to the class corresponding to the equipped suit you selected in the Conditional Branch, and have no change occur to anything since we're only updating graphics.

Event Command -> Change Actor Graphic

Select your Hero and its correct sprite.

Event Command -> Change Actor Faceset

Select your Hero and its correct faceset.

Event Command -> Change Equipment

Select your Hero and make him change into the equipped suit.

Branch End.

Event Command: Control Variables

Set Current Hero Suit equal to variable Hero Suit.

Event Command -> Call Event

Call Common Events: Call Hero Data.

Event Command -> Wait

Set Time 0x0.1 seconds to prevent lag.

Under the Else of your Conditional Branch you put the same line of events for other suits for your Hero. This is an example of what it would look like for a Hero that has graphics for 2 different suits and 1 for if he isn't wearing any suit:

Pi9Hcxe.png


5. STORE HERO DATA

Set the common event called Store Hero Data trigger to None.

Event Command -> Variable Operations

Open Single Variable for the variables list. Next, make entries for all the variables you're going to need for this part:

-Weapon

-Shield

-Helm

-Accessory

-EXP

-Max HP

-HP

-MP

Create variables events for each of these categories set equal to your Hero's individual stats and equipment pieces.

Event Command -> Change HP

Decrease your Hero's HP by variable Hero HP.

Event Command -> Change MP

Decrease your Hero's MP by variable Hero MP.

Event Command -> Change EXP

Decrease your Hero's EXP by variable Hero EXP.

6. CALL HERO DATA

Set the common event called Call Hero Data trigger to None.

Event command -> Conditional Branch

Variable: If Hero's equipment piece (do this for each piece of equipment) is not equal to 0.

Event Command -> Change Equipment

Change your Hero's equipment to the pieces you stored in each variable in step #5.

Branch End.

Event Command -> Change HP

Increase your Hero's HP by variable Hero HP.

Event Command -> Change MP

Increase your Hero's HP by variable Hero MP.

Event Command -> Change EXP

Increase your Hero's HP by variable Hero EXP.

Event command -> Conditional Branch

Variable: If Hero's max HP is not equal to Hero's current HP.

Event command -> Conditional Branch

Variable: If Hero's current HP is not equal to 1.

Event command -> Change HP

Decrease your Hero's HP by 1.

Branch End.

7. TEST

If you followed these steps correctly, it should be working now. If not, feel free to ask questions.
This will, however constantly update the class, equipment, etc.

You should rather save the last status of the equipment in a switch or variable, and check if the equipment changed, and only then run all the "Change Class", "Change Actor Graphic", etc. commands.
Phluff said:
You've stated that you could help with the battle charset, but I didn't see anything in your tut covering that. How could I change my player's character's battle charset without having set one to begin with? I've been searching for a short while and can't find the option.
Milennin said:
RPG Maker 2003 comes with a battle charset for both genders for each class. You could use those to test if your events are actually working before using custom-made battle charsets.

Also, post this stuff in my thread so others can read it too.
Ok, so since I have read over the tutorial and asked that question, I've got one question that has been bugging me for a little bit.

I know that this is not based on equipment, but I've been trying to set up a character generation sequence where my player can select their favorite skin, gender, and class, but my battle sprites do not update. While typing this out, I thought about making a class for each different skin and coding it in that way, but wouldn't there be an easier way of doing this?
This will, however constantly update the class, equipment, etc.

You should rather save the last status of the equipment in a switch or variable, and check if the equipment changed, and only then run all the "Change Class", "Change Actor Graphic", etc. commands.
Added.

Ok, so since I have read over the tutorial and asked that question, I've got one question that has been bugging me for a little bit.

I know that this is not based on equipment, but I've been trying to set up a character generation sequence where my player can select their favorite skin, gender, and class, but my battle sprites do not update. While typing this out, I thought about making a class for each different skin and coding it in that way, but wouldn't there be an easier way of doing this?
I don't think there would be an easier way. The more options you give the player, the more work this system is going to be for you. I honestly wouldn't recommend going with a dozen+ different outfits, and also to stick to one piece of equipment that changes their looks, otherwise you're going to end up needing a ton of different sprite sheets, database entries and conditional branches for every possible combination.

But if you've got the time and patience for it, then go for it I say. 😀
For what I have been doing, I've been using the hero sprite sheets that came with the game.

Say I have four classes to choose from, but have 24 character skins, 12 male/12 female. Would I have to create 96 different classes based on the player's choice? If so, would I have to set up a variable so that when a player chose the skin, it would set a specific amount to correlate to the proper class based on the player's choice?
There are no shortcuts, so if you have 4 classes with your example, you'd need 96 sets.
Would it be possible for battlechars to get their clothing from battleweapon sets rather than making a lot of different battlechars? This seems like a nice workaround for me if there are no variations on which weapon a character uses, but it would obviously require some trickery with which equipment slot does what.
Would it be possible for battlechars to get their clothing from battleweapon sets rather than making a lot of different battlechars? This seems like a nice workaround for me if there are no variations on which weapon a character uses, but it would obviously require some trickery with which equipment slot does what.
Don't understand what you mean.
Would it be possible for battlechars to get their clothing from battleweapon sets rather than making a lot of different battlechars? This seems like a nice workaround for me if there are no variations on which weapon a character uses, but it would obviously require some trickery with which equipment slot does what.
No, it won't be possible, because the battle weapons are only visible during physical attacks (not even during physical skills, since you can't choose a weapon animation that should be used there). And only weapons are allowed to even have a battle weapon animation.

Original thread: https://forums.rpgmakerweb.com/threads/change-hero-graphics-depending-on-equipment.39350/