[XP]In-Battle Character Transformation

Started by Wraith89, November 24, 2014, 03:49:32 pm

Previous topic - Next topic


November 24, 2014, 03:49:32 pm Last Edit: November 24, 2014, 10:28:30 pm by Wraith89
I know this is not much, but I just wanted to write something anyways just for the sake of beginners toying around with RMXP. I didn't see a transformation tutorial anywhere either.

Character Transformation


If you have played certain games, character transformation is a feature certain characters have, where a character gains certain attributes, such as increased stats, new skills, etc. Think Super Sonic when Sonic the Hedgehog gets all seven Chaos Emeralds, or Dragon Ball Z Super Saiyan forms, or Manaketes from Fire Emblem, or Mega evolution from Pokemon, or anything where the original idea got ripped off from anyhow. Fortunately, it is actually simple to do in RMXP because all it does is involve a bunch of eventing. That's right: scripting will NOT be necessary for this! This kind of thing can be fun and will add some dimension to your character and make them more unique.

For the sake of demonstration, we will make a character and transform the said character into another form. We will base this on Aluxes, and transform him into something hilarious.

Mind you this is not the only way of doing this: there are various ways of having this occur. I am just showing you the way I did it, and perhaps you may have found a better and more efficient way. If so, please let me know!

What We need
  • One Actor / Hero
  • Optional: One Transformation state Class
  • Two Common Events
  • Zero to Two Variables
  • One Switch
  • One new transformation state
  • One new transformation skill
  • Optional: extra transformed character attack/support skills
  • One Extra Page in Troops Tab (we will get there)
  • Optional: At least one new animation
  • Resources for your transformed character (if lazy use RTP because that is what it is there for!)

Starting Off

Spoiler: ShowHide

We will first start with making common events. Go to the database and inside the Common Event tab, we will make two. One for character transformation and the other for the detransformation. We will also need one switch and may need anywhere between zero to two variables, depending on the type of system you want to do.

We will also need to make a state that indicates your character is transformed. Name it something, set it to nonresistance, and release after battle, and after a certain amount of turns it will have a 100% chance to get released. The turn thing can get buggy though that the detransformation actually occurs after one extra turn of transformative state. This is due to how the "Turn" span works in the battle event page, but I will get to that later.

Spoiler: ShowHide

Also make sure to make a new skill that sets your character to the said transformative state. Make sure where it says COMMON EVENT in the skill, scroll down and make it so that it is Common Event "Character Transformation", whichever one you made it. In this example's case, it is Common Event #1. You will want it to add your transformation state, and set scope to USER and used only in battle. Here is a screenshot that will help you out:

Spoiler: ShowHide

If you want, you can make it so that this new transformative state has new properties, mostly elemental or status resistances. Weaponry and such and especially skill builds is actually irrelevant. You may or may not want to do this, depending on what kind of transformation you are trying to accomplish. To do this, go to the classes tab and create a new class while changing around the characters' strengths and weaknesses.

Spoiler: ShowHide

Chickenman???? What?

However, we do want to take the base class (Aluxes is a Fighter in this case) and add that very skill that transforms your character into the said transformed state. That should be easy enough. If it is a skill that is obtained from a quest or whatever in your game, skip this step.

Spoiler: ShowHide

Set it to whatever level... I made it 1 just for convenience sake.

However, we did not even set up the common event to begin with! This will take a while, and it will require you to think about what exactly you want your character to be. I will try to show you almost every possible situation I can think of, I suppose, if I do not forget my screenshots.

Creating the Common Events

We will now look into Character Transformation, double click in the List of Event Commands field, and click on CONTROL VARIABLES. We will make two variables, depending on if you need this or not. You most likely will. We will name it Character's Level and Character's SP. In this case, it is Aluxes, so we name it Aluxes's Level and Aluxes's SP. These will be some important factors in deciding some aspects in Aluxes's transformation skills and SP triggered detransformation. Again, if you are not doing this, do not make these.

Spoiler: ShowHide

Now set Character's Level variable to SET to Actor (Aluxes in my case) Level. If you do not know how to do that, the screenshot below will show you.

Spoiler: ShowHide

Everyone with me so far? Good. Now press okay, and we will make another event. Double click on the field below your new "Set Character's Level variable to Character's level condition" and now we will make a CONDITIONAL BRANCH, so click on that (it's in Page 1 of events) and go to Tab 2. Select Actor (whichever actor yours is, mine is Aluxes) and click on "State", not "In the Party/Name/Skill/Weapons/Armour". Select the transformation state you have made. So it should read "Character has Transformation State Inflicted".

Spoiler: ShowHide

Now we will make another command (this common event will have a lot of these). Make it inside the Conditional Branch, directly below the "If character has state inflicted" line, not in the Else field. Else means "if this isn't true", but we want it so that this happens when your character is in the transformative state. Don't place it outside the conditional branch either, or else that whole conditional branch is useless. Click on CONTROL SWITCHES this time, as we MUST make this one switch. We will turn this switch (create a switch called TRANSFORMATION SWITCH or something) on. So set that new made switch to ON. This switch is an indicator as to whether your character has transformed or not.

Spoiler: ShowHide

So the boring mechanical part is done, now we can do the actual transformation and customise your character. We go to Page 3 of events for this, where you can find Change Actor Graphic. Let's do that: let's make Aluxes into something else. It is important that you set both Battler and Character picture, or else Aluxes's character will disappear. It won't matter so much in this transformation part, where Battler is the only one necessary, but in detransformation, we will. More on that later.

Spoiler: ShowHide

We can also change the Actor's class if you set a new set of weaknesses and resistances. Let's do that. This is all in Page 3 of events remember... so click on Change Actor Class. I'm changing Aluxes from Fighter to Chickenman. You may also change the actor's name by clicking "Change Actor Name". I changed Aluxes to Chickenman.

Spoiler: ShowHide

Next is the fun part where we get to add stats to our newly transformative state! Yes... go to page 3 in events again and go click on Change Parameters. This is where we can add stats and such. For example, in this, I will go ahead and add 3000 HP to Aluxes while he's chickenman, so set it to Actor whatever (Aluxes for me), Parameter to Max HP, operatoin at INCREASE, and Operand CONSTANT to 3000. This is Chickenman, he gains 3000 HP by transforming. You do whatever you want. Repeat for other stats, such as MaxSP, STR, DEX, AGL, and INT. I'm sure when your character has transformed, he or she has enhanced stats in nearly all parameters. Some characters have penalties when transformed so they lose STR or AGL or something, depending on your character. This part is entirely up to you. Do as you please.

Spoiler: ShowHide

Now we can change skills. Remember where I said ignore the skills part in the classes section? It is because your character does not automatically get new skills by simply changing classes. No, in fact, we have to do this the looooong way if you want a level up and get new skills thing. First thing is first: go to Page 3 in Event Commands and find Change Skills. This is where we can add new skills for your transformative state. For Actor whatever (mine is Aluxes), have him or her learn your new skills (I hope you set that up in the database... if not, you can go and do those right now). Since I'm lazy, I'm having Aluxes learn Wind because chicken.

Spoiler: ShowHide

Now you WANT to have your character FORGET the transformation skill while in transformation state, or else he will continue transforming, which doesn't make sense. So do add that into your list and have your character forget the transformation skill. Now how do we add extra skills while leveling up? This is where the our variable "Actor's Level" comes in handy. We will start making more Conditional Branches (page 1), and go to Tab 1 where it says Switch/Variable/Self Switch/Timer. Click on Variable, and set VARIABLE CHARACTER LEVEL is GREATER THAN OR EQUAL TO a Constant (which is what level you wish your character to learn a specific skill). For example, my Chickenman will be at Level 30 when he learns "Mass Wind", so I will set the Constant to 30. Inside that whole conditional branch, add "Change Skill" to learn whatever skill the character learns at that certain level. Leave the else field blank because when he is not level 30 or higher, he will not learn anything anyways.

Spoiler: ShowHide

Keep repeating for extra skills. Now for insurance, just in case your "transformation state" disappears from the transformation (it can happen), go to Page 3 in Event Commands and add "Change State", and select your Actor, and Add the Transformation State. I think this is optional, but I do it anyways.

Spoiler: ShowHide

If you gave your character an extra HP/SP boost, you can also go to Page 3 in event commands and click Recover All, and select your character (again, mine is Aluxes). What is that extra HP/SP when it is not even recovered?

Spoiler: ShowHide

The end result should look something like this:

Spoiler: ShowHide

If for some reason the images disappear because that can happen over time, let me know and I will fill it out for you... again. I suppose. Now we can move on to our second common event, Character Detransformation. This one will need some modifications, as in at the top field, where it says Trigger, pull down the arrow and click on PARALLEL PROCESS. In Condition Switch, select the Switch we made before (Transformation Switch). What this does is when the switch is on, the game will constantly check whether it is or not and will execute the common event we are making. Note that this only works in the overworld and not in battles. We will configure our battle shortly, so please wait.

Spoiler: ShowHide

Now, if you want your character to detransform if he or she has 0 or lower SP, go to Control Variables, selet the variable for your character's SP (remember this?). Yeah, now SET it to Actor's SP. This way this variable checks what your character's SP is, much like the other level variable.

Spoiler: ShowHide

Optional: You can find SP Poison (Regeneration Status) script in Blizzard's Tons of Addons Part 3 and set it to equal the ID of the transformative state to further ensure the overpowered transformed state does not always last very long.

Now make a new conditional branch if character's transformation state is inflicted, just like the other common event. This time, we will fill out the ELSE part. The reason is we want the character to detransform when the state "transform state" is NOT inflicted, right? Otherwise the character will detransform immediately, which is not fun and can cause World War 3. Who wants that? Now, go to Page 3 in event commands, and we will go and reverse EVERYTHING that we did in Character Transform. This includes changing the actor's graphic (make sure you do the battler and character this time, or else your character will be invisible in the overworld), reversing the stat gains, and forgetting all the new skills he learned and relearning his transformation skill. You could have had it so the transformation process made the transformed creature forget some skills, so to relearn them based on level, do the same thing, set the variable Character's Level to Level, and make multiple conditional branches based on that. In my case, I did not think it was necessary so I did not do that. Also make sure to turn the transformation switch to OFF. That is important, or else this detransformation will go on forever, and for insurance, change state so your character's transform state is removed (though I doubt it is necessary). You can also set a penalty for your character once they detransform, like changing state to paralysed, or stun, or something. I just did the usual CHANGE SP to -9999 so that Aluxes cannot retransform to Chickenman immediately.

However, under the conditional branch that is NOT the else part, we still need to fill out something. We have to make a conditional branch within a conditional branch. Oh my, sounds complicated? Not really. Just go to Event Commands page 1, make a new conditional branch, and click on Tab 1's Variable. Set it so it says "Character's SP" is LESS THAN OR EQUAL TO (just in case of error, I set it to that), and constant should be 0. This means "if character's SP ran out". We are going to have a detransformation happen here too. Joyous. So highlight everything you put at the else section, Ctrl + C (or right click + copy) and highlight inside the conditional branch which you just made (the character's SP is 0) and paste it (Ctrl + V, or right click + paste) to save you time.

Spoiler: ShowHide

I know my explanation sounds complicated, so here is a screenshot of what it should look like... or similar to.

Spoiler: ShowHide

Setting up Battle Events Page

Now, we have one more thing to do. Remember when I said the parallel detransformation common event only works in the overworld and NOT battles? We will have to go inside "Troops". Make a new page inside the Battle Event, and set the Condition to "Switch Transformation is ON", while Span is set to "TURN".

Spoiler: ShowHide

Now click on the empty big field inside, go to Event Commands Page 1, and click CALL COMMON EVENT. Set it to the Character Detransformation event. This will make the game continually check during turns when switch Transform is on your character will properly detransform and not remain super saiyan forever.

Spoiler: ShowHide

Note: you will have to put this page in EVERY SINGLE TROOPS page. Unfortunately, this is the only way I know to do this. Just click on COPY EVENT PAGE and PASTE it everywhere, all the way from Ghost to ... Archangel? I don't want to fight benevolent beings that are Angels :(

Spoiler: ShowHide

Now that we have done that, we can go ahead and battle test. I will set Aluxes to 30 to see if he properly learns his Level 30 skill and not his level 50 skill.

Spoiler: ShowHide

Here we go!

Chicken Crow is my transform skill.

Witness the glory that is Chickenman! He learn the Mass Wind skill as he was supposed to, but he does not learn Chicken Destruction that is at Level 50. He also forgot Chicken Crow! Very nice!

I try this again at Level 50... Chicken Destruction is now here! Let's see what it does...

Goodbye Ghosts, go return to your own dimension!

Now I have to check one more thing... if detransformation works properly...

Spoiler: ShowHide

Hello friends! Chickenman here... oh, Y U ATTAK ME??!!

5 defends later, I detransform, and as I put in my common event detransform, Aluxes's SP is subtracted so much it goes back to 0, just as a punishment for being so tough for five turns. Okay, everything is working properly!

If you want to do this for more characters you will have to repeat this process and make separate common events and separate battle pages for each character in your party that has the possibility to transform.

I hope this helped to give an idea how to make a character transform with only events and some imagination. I really hope you can make some fun and excellent characters out of this as well!

Extra Resources

If you want to use the chickenman for fun, I suppose the credits for the Chickenman frakensprites go to 이온캐논 (Ion Cannon), if I'm correct that he actually made these. There is a version for Aluxes, Basil, and Wight/Skeleton (Undead03 from RTP). I found it hilarious and had to use them. The original sprites are of course Enterbrain's, but that is still where credits are due. I found these on avangs.info, a Korean RPG Maker resource website. They are mostly collections of scripts from other sites (yes, even Chaos Project is mentioned and is referred to as "a famous overseas site"), and usually these Koreans do not seem to attribute the sources for graphic resources properly. The site itself may be hard to navigate and requires you to register, but if you ever decide to go in and check it out, do let me know and I can help you navigate, I guess.

Spoiler: ShowHide

I'm sure these guys will love to be used in your projects. Maybe.


Quote from: Wraith89 on November 24, 2014, 03:49:32 pm
I know this is not much.

This is a really good tutorial and better than I ever imagine myself doing, keep up the good job for this community, do my part aswell :V:


Thanks :)
I figure if you know something and feel like sharing you go ahead and share your discoveries and such.


With one small script, you can allow the user to specify different transitions to accompany the transformation of their character. In place of the code that you used to change the actor's graphic, just use a set move route on the player with this script line in it:
Code: rgss
player=$scene.instance_variable_get(:@spriteset).instance_variable_get(:@actor_sprites)[0];oplayer=Sprite.new(enemy.viewport);oplayer.x,oplayer.y,oplayer.ox,oplayer.oy,oplayer.zoom_x,oplayer.zoom_y=player.x,player.y,player.ox,player.oy,player.zoom_x,player.zoom_y;oplayer.bitmap=player.bitmap;player.battler.instance_variable_set(:@battler_name,NEW_GRAPHIC);player.battler.instance_variable_set(:@battler_hue,0);player.update;Transitions.transition_out(oplayer, TRANSITION_TYPE, DURATION, ARGUMENTS);Transitions.transition_in(player,TRANSITION_TYPE, DURATION, ARGUMENTS)

The capitalized words other than Sprite and Transitions are places where you subsitute in a certain value in place of the capitalized word.
NEW_GRAPHIC -> the filename of the new graphic
TRANSITION_TYPE, DURATION, ARGUMENTS -> one of the various transition setups listed below

And when you want the character to detransform, just do the same thing, only with the name of the original file subsituted in for NEW_GRAPHIC.

Here are the possible values for to paste in in place of "TRANSITION_TYPE, DURATION, ARGUMENT" in the line of code above, taken from the instructions in my script.
Here are the ones for transitioning the old graphic out:

   # Slicing Animations (Animation #0)
   #   parameters: (amount_movement)
   0, 40
   0, 20
   0, 20, [0.6]
   # Fading Animations (Animation #1)
   #   parameters: none
   1, 20
   1, 30
   # Zooming Animations (Animation #2)
   #   parameters: (x_zoom, y_zoom) or (zoom)
   2, 30
   2, 20, [1.2]
   2, 30, [1, 0]
   2, 30, [0, 1]
   2, 30, [1.8, 0.2]
   2, 30, [0.2, 1.8]
   2, 30, [0.2]
   # Zooming and Spinning Animations (Animation #3)
   #   parameters: (x_zoom, y_zoom, spin_degrees) or (zoom, spin_degrees)
   3, 20
   3, 40, [1.8, 0.2, 720]
   3, 40, [0.2, 810]
   3, 40, [0.2, 1.8, 720]
   # 3D Spin Animations (Animation #4)
   #   parameters: (zoom, num_rotations)
   4, 40
   4, 40, [0, 4]
   4, 40, [0.5, 6]
   4, 30, [0.7, 2]
   # Slide-In Animations (Animation #5)
   #   parameters: (slide_direction)
   5, 24
   5, 24, [-1]
   # Fold Animations (Animation #6)
   #   parameters: none
   6, 30
   # Shaking Animations (Animation #7)
   #   parameters: (x_strength, x_speed, y_strength, y_speed) or (x_intensity, y_intensity)
   7, 40
   7, 40, [6..9, 4..7]
   # Ripple/Distort Animations (Animation #8)
   #   parameters: (x_amplitude, x_wavelength, num_x_ripples, y_amplitude, y_wavelength, num_y_ripples) or (x_amount, num_x_ripples, y_amount, num_y_ripples)
   8, 40
   8, 40, [40, 10, 0.5, 10, 10, 2]
   8, 40, [10, 10, 2, 40, 10, 0.5]
   8, 40, [10, 40, 2, 10, 10, 2]
   8, 40, [10, 10, 2, 10, 40, 2]
   8, 40, [10, 10, 3, 10, 10, 2]
   8, 40, [10, 10, 2, 10, 10, 3]
   8, 10, [10, 40, 0.5, 10, 10, 0.5]
   8, 10, [10, 10, 0.5, 10, 40, 0.5]
   # Dissolve to Sprite Animations (Animation #9)
   #   parameters: (fade_duration)
   #            or (fade_duration, x_size, y_size, negative?, tint_amount,
   #                tint_red, tint_green, tint_blue)
   #            or (fade_duration, x_size, y_size, negative?, tint_amount,
   #                tint_red, tint_green, tint_blue, grayscale_amount)
   #   note - use a float for x_size or y_size to specify it as a fraction
   #     example - 1.0 for the width of the sprite, 0.5 for half the width, and so on
   9, 40
   9, 40, [10, 1.0, 1, false, 50, 200, 50, 50]
   9, 40, [10, 5, 5, true, 50, 100, 200, 200]
   9, 40, [10, 1, 1.0, false, 0, 0, 0, 0, 100]
   # Dissolve Animations (Animation #10)
   10, 40
   10, 40, [1, 1.0]
   10, 40, [5, 5]
   10, 20, [10, 10]
   # Transition Graphic Animations (Animation #11)
   #   parameters: (transition_graphic_name, fade_duration)
   #     fade_duration - how long it takes for each individual pixel of the
   #       sprite to fade out
   11, 100
   11, 40, ['001-Blind01', 5]

And here are those for transitioning the new one in:

     # Fading Animations (Animation #0)
     #   parameters: none
     0, 20
     0, 30
     # Zooming Animations (Animation #1)
     #   parameters: (x_zoom, y_zoom) or (zoom)
     1, 30
     1, 20, [1.2]
     1, 30, [1, 0]
     1, 30, [0, 1]
     1, 30, [1.8, 0.2]
     1, 30, [0.2, 1.8]
     1, 30, [0.2]
     # Zooming and Spinning Animations (Animation #2)
     #   parameters: (x_zoom, y_zoom, spin_degrees) or (zoom, spin_degrees)
     2, 20
     2, 40, [1.8, 0.2, 720]
     2, 40, [0.2, 810]
     2, 40, [0.2, 1.8, 720]
     # 3D Spin Animations (Animation #3)
     #   parameters: (horizontal?, zoom, num_rotations)
     3, 40
     3, 40, [true, 0, 4]
     3, 40, [true, 0.5, 6]
     3, 30, [true, 0.7, 2]
     # Shaking Animations (Animation #6)
     #   parameters: (x_strength, x_speed, y_strength, y_speed) or (x_intensity, y_intensity)
     6, 40
     6, 40, [6..9, 4..7]
     # Transition Graphic Animations (Animation #7)
     #   parameters: (transition_graphic_name, fade_duration)
     #     fade_duration - how long it takes for each individual pixel of the
     #       sprite to fade out
     7, 100
     7, 40, ['001-Blind01', 5]