Instant changing of class in battle

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
Summary: I want to make a battle system where when I click a specific skill under the command "Transform", it allows me to change the actor's class (via States).

Problem: When I select a skill (for example: Heavy Armor), the skill applies "Heavy" on the actor but it doesn't change the actor's class yet. I have to re-select the skill before the system changes the actor's class. Basically, it requires two turns of selecting the same skill.

First, to clarify things: The concept of this system is already laid out. My reason of using "State" as a switch to change class rather than the "Switch" command type itself is because: the battle command type for activating switches is not "Skill-Specific". This means that if in case the actor transforms and learns a "skill specific" skill let's say Steel Crash which I want to be under the battle command "Gear", it will also appear on "Transform". So to fix this issue, I made the "Transform" command a skill specific and used the Heavy "State" to activate the transform common event. However, the system doesn't instantaneously recognize the actor's state. I've also tried it with the normal switch type and it's the same effect. It requires res-election of the same skill. To clarify also (in case someone asks), I've made the state rate for the State "Heavy" 100% meaning it will not miss.

Here's a snippet of my code:
Skill
rm1.PNG
Troop
rm2.PNG

Common Event
rm3.PNG
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
681
Reaction score
393
First Language
English
Primarily Uses
RMMV
Your problem is that it calls the common event before the state is inflicted.

The flow goes like this:
  • Iskar uses Transform
  • Common event checks, sees no state, aborts
  • The transform skill goes off, and sets the state to heavy
  • turn end
  • Next turn transform is used again
  • The common event checks for the state, which is already on from last turn
  • successful check, class is changed
  • skill goes off again.
You can confirm this by adding an else case to your conditional branch. The common event will only be called if the transform command is used, but the command is used before the skill is executed, because using the command and executing the command are not the same thing.

A switch is probably a better way to do this. To get around the issue of having skills only usable by being transformed also show up and activate the transform command switch, add the skills for each transformation to their own skill type, and have the class you're changing into give you that skill type.
 

JosephSeraph

White Mage
Restaff
Joined
Mar 7, 2014
Messages
1,169
Reaction score
1,418
First Language
Portuguese
Alternatively, if you use Maniacs Patch you have access to in-battle common events. This is a sleekier solution overall because you only code the effects once and it'll automatically apply to every single encounter.

This way all you got to do is check if state X is applied. If so, then you execute the class change and remove the state. Although you don't even need that much -- Maniacs allows you to directly check for any skills used and retrieve information of caster, target, skill type and skill ID -- by crossing this info you can do the class change without using states at all.
 

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
Your problem is that it calls the common event before the state is inflicted.

The flow goes like this:
  • Iskar uses Transform
  • Common event checks, sees no state, aborts
  • The transform skill goes off, and sets the state to heavy
  • turn end
  • Next turn transform is used again
  • The common event checks for the state, which is already on from last turn
  • successful check, class is changed
  • skill goes off again.
You can confirm this by adding an else case to your conditional branch. The common event will only be called if the transform command is used, but the command is used before the skill is executed, because using the command and executing the command are not the same thing.

A switch is probably a better way to do this. To get around the issue of having skills only usable by being transformed also show up and activate the transform command switch, add the skills for each transformation to their own skill type, and have the class you're changing into give you that skill type.
Thanks for the response! I think I have a good grasp now on how I should work around the transform and state detection codes. I never thought that the "Actor uses battle command" in the Troop section meant that system will run the action on selecting the specified battle command and not after selecting. That was the main reason why I did not figure out a solution immediately.
 

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
Alternatively, if you use Maniacs Patch you have access to in-battle common events. This is a sleekier solution overall because you only code the effects once and it'll automatically apply to every single encounter.

This way all you got to do is check if state X is applied. If so, then you execute the class change and remove the state. Although you don't even need that much -- Maniacs allows you to directly check for any skills used and retrieve information of caster, target, skill type and skill ID -- by crossing this info you can do the class change without using states at all.
Thank you! I'll make sure to check on it later.
 

SilentGhost

Warper
Member
Joined
Sep 14, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RM2k3
If you ok with transform taking up a battle command you can do it in 1 turn.

also I had to write an exp adjust code because switching class causessaid hero exp to reset.
 

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
If you ok with transform taking up a battle command you can do it in 1 turn.

also I had to write an exp adjust code because switching class causessaid hero exp to reset.
really? May I see?
 

JosephSeraph

White Mage
Restaff
Joined
Mar 7, 2014
Messages
1,169
Reaction score
1,418
First Language
Portuguese
I think what they probably do is store the value then reinject it after the relevant class change.
 

SilentGhost

Warper
Member
Joined
Sep 14, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RM2k3
really? May I see?
-Hero 1 has battle command called transform. Make it special (event use)
-Create a common event called transform
-create a troop battle event. Condition hero turn count 1x
-inside event page add conditional branch for when hero1 uses transform.
-inside conditional branch call the common event called transform.

-now go to the common event transform and add a conditional branch that’s checks to see if transform switch is on. (Create a switch called transform)
This will make sure that Hero1 can’t transform after transforming.
When you switch classes hero1 will lose equipment so I’ll attach a code to fix that.

-once you write the equipment code/class change turn on transform switch.

if u run into any issues let me know.
 

Attachments

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
-Hero 1 has battle command called transform. Make it special (event use)
-Create a common event called transform
-create a troop battle event. Condition hero turn count 1x
-inside event page add conditional branch for when hero1 uses transform.
-inside conditional branch call the common event called transform.

-now go to the common event transform and add a conditional branch that’s checks to see if transform switch is on. (Create a switch called transform)
This will make sure that Hero1 can’t transform after transforming.
When you switch classes hero1 will lose equipment so I’ll attach a code to fix that.

-once you write the equipment code/class change turn on transform switch.

if u run into any issues let me know.
Ahh I've already done that. I'm sorry I forgot to mention. The reason why I wanted the transform to be skill-specific is because I want to have multiple transformation skills. I wanted to make the battle system interesting by giving the player options. Maybe he wanted a defensive type of transformation and outlasting the opponents; maybe he wanted a fast fragile type of transformation so it's kill or be killed first; etc. Of course, the character's skill changes as well. Maybe as a defensive class, he has support skills; maybe as a speed class he has DoT skills. You get it what I mean. But still thanks for replying!
 

SilentGhost

Warper
Member
Joined
Sep 14, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RM2k3
Ahh I've already done that. I'm sorry I forgot to mention. The reason why I wanted the transform to be skill-specific is because I want to have multiple transformation skills. I wanted to make the battle system interesting by giving the player options. Maybe he wanted a defensive type of transformation and outlasting the opponents; maybe he wanted a fast fragile type of transformation so it's kill or be killed first; etc. Of course, the character's skill changes as well. Maybe as a defensive class, he has support skills; maybe as a speed class he has DoT skills. You get it what I mean. But still thanks for replying!
How many transformations?
 

isvant

Villager
Member
Joined
May 24, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RM2k3
How many transformations?
Unfortunately, the game that I am planning to make is based from an existing fiction. There the character has more than 20 transformations, but I intend to include 9 only. I've already made the class specifics and their advantages (e.g. one transformation has immunity to fire). But I've removed the other sub skills from each transformation and instead utilized the attack command. Like if I use the fire type transformation, it's base attack has the element of fire etc. (basically I just equip a weapon with fire element). Still, the problem remains where a delay occurs. I'm still working on the codes. I just don't have a lot of free time lately
 

SilentGhost

Warper
Member
Joined
Sep 14, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RM2k3
Unfortunately, the game that I am planning to make is based from an existing fiction. There the character has more than 20 transformations, but I intend to include 9 only. I've already made the class specifics and their advantages (e.g. one transformation has immunity to fire). But I've removed the other sub skills from each transformation and instead utilized the attack command. Like if I use the fire type transformation, it's base attack has the element of fire etc. (basically I just equip a weapon with fire element). Still, the problem remains where a delay occurs. I'm still working on the codes. I just don't have a lot of free time lately
Any luck? There’s a way you can do it if you have the maniac patch.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

And back. Trying to work online with no internet for 1.5 days was...interesting. I felt like a character in a old Sierra game trying to find internet due to all the hoops I had to jump through just to get online for work.
grief... if MV didn't have certain plugins already, I think I'd upgrade to MZ. seeing like 10 MV plugins in 1 MZ one is hilariously convenient lol.
Have you already checkes out my mapping tutorial on the blog? I would love to hear your feedback and things you'd like to see in the future!

one of character for my upcoming game idk how to design o_O

Designing patches that can 'augmented' to clothing based armor. Such good fun. A bit time consuming due to the need to create image displays, but the patches are limited so it's not too tiring.
Note: lol, posting this made me find a couple mistakes.

Forum statistics

Threads
100,736
Messages
978,936
Members
132,357
Latest member
Versitax
Top