Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
In the game I'm making, there's a character who I want to assign a unique gimmick. He normally has an Attack of 300 and a magic attack of 75. He has decent magical and physical attacks. I want him to have a skill that allows him to switch his attack and magic attack stat in the middle of battle so that he instead has a magic attack stat of 300 and an attack stat of 75. Is there any way to do this?
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
Yeah, sure. I don't really understand why you would want to switch them, but I am sure your idea is great. :p I can tell you how to do it, though

First you make a skill, the skill that you just described, and you make that skill trigger a common event.
We come back at the common event in a minute, but first lets talk about the skill formula.

To make this skill, we need to use 1 variable in the formula. For this formula I will use variable 1. If you use another variable, simply change the 1 to the id of the variable you use. The formula should be like this:

v[1] = a.atk - a.mat ; 0

This makes that variable 1 is not the difference between ATK and MAT of the spell caster. It is important that you make the skill target anything (friend or foe) and that the type is set to damage. (If you set it to heal, the formula would not set Var 1 if the target is at full health.)

Best to target the caster if the skill does nothing else. But you can also have the skill target an enemy, do damage and then AFTER the damage is done, it will trigger the common event. (In this case replace the 0 in my formula with the actual battle formula)

Now, for the common event. You just need 2 little commands:
Change ATK of actor: - variable 1
Change MAT of actor: + variable 1

1639013033685.png

That is all you need to do. The same skill will switch the values back if triggered again.
 

pawsplay

Veteran
Veteran
Joined
Mar 29, 2012
Messages
495
Reaction score
270
First Language
English
Primarily Uses
RMMV
create two passive states, one that adds +200 to each stat. Swap them as needed.
 

Sullien

Dev Wannabe
Veteran
Joined
Apr 5, 2015
Messages
32
Reaction score
76
First Language
English
Primarily Uses
RM2k3
What was mentioned above could work but it would be more versatile if you added a variable amount so you could keep track of each stat and apply accordingly.
 

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Yeah, sure. I don't really understand why you would want to switch them, but I am sure your idea is great. :p I can tell you how to do it, though

First you make a skill, the skill that you just described, and you make that skill trigger a common event.
We come back at the common event in a minute, but first lets talk about the skill formula.

To make this skill, we need to use 1 variable in the formula. For this formula I will use variable 1. If you use another variable, simply change the 1 to the id of the variable you use. The formula should be like this:

v[1] = a.atk - a.mat ; 0

This makes that variable 1 is not the difference between ATK and MAT of the spell caster. It is important that you make the skill target anything (friend or foe) and that the type is set to damage. (If you set it to heal, the formula would not set Var 1 if the target is at full health.)

Best to target the caster if the skill does nothing else. But you can also have the skill target an enemy, do damage and then AFTER the damage is done, it will trigger the common event. (In this case replace the 0 in my formula with the actual battle formula)

Now, for the common event. You just need 2 little commands:
Change ATK of actor: - variable 1
Change MAT of actor: + variable 1

View attachment 209156

That is all you need to do. The same skill will switch the values back if triggered again.
I tried this, and I believe I followed your instructions correctly, but all that happens is it says that the user took no damage and doesn't swap the stats. I have the target set to user. The attack stat is 2, and mat is 100. The common event looks exactly like the screenshot you sent. I do have the common event trigger in the skill (almost forgot to at first :p) and the formula is v[1] = a.atk - a.mat ; 0. It's set to HP damage. Is there anything I might be missing?
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
Did you also target the caster with scope?

The scope can't be "none" or "the user". That will skip the selection part of the skill. And you need to select anything. I don't know why that is, but if you skip, your might still have your variable a 0 when the common event runs. Set the scope to "1 ally" instead.

I hope that works, otherwise I have to think real hard what part I was missing. :p
 

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Did you also target the caster with scope?

The scope can't be "none" or "the user". That will skip the selection part of the skill. And you need to select anything. I don't know why that is, but if you skip, your might still have your variable a 0 when the common event runs. Set the scope to "1 ally" instead.

I hope that works, otherwise I have to think real hard what part I was missing. :p
It didn't work. Do I need to change the variable somehow? I'm also using Variable 1 like you suggested
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
Hmmm. Well, can you try maybe putting a text message in the common event that says: "\v[1]"

This way you can see what was stored in the variable, that should be the difference between the 2. If the whole message doesn't show up at all, then your common event is not triggered.

Can I see a screenshot of the common event maybe? (Maybe something went wrong and 2 see more than 1)
 

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Here you are good sir, I'll do that text message thing while you look at the screenshot
 

Attachments

  • image_2021-12-08_212747.png
    image_2021-12-08_212747.png
    13.9 KB · Views: 4

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
says the difference is -95
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
Hmmm... I don't immediately see a mistake in your screenshot, and when I try to create the skill myself, it works flawlessly.

Wait... Oh wait... Is it an actor who switches their own stats? Or is it an enemy?
Because until now I thought we were working with actors, until I noticed it was called a sigma slimeset... If this is for enemy stats, then my approach will not work at all.

If it is an enemy changing the players stats, then change the a in the formula into a b.
So then the formula should be v[1] = b.atk - b.mat ; 0 and you also need to make sure it targets the right actor.
 

Attachments

  • 1639017829147.png
    1639017829147.png
    140.8 KB · Views: 5

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
12
Reaction score
2
First Language
English
Primarily Uses
RMMV
Oh god I had it set to the wrong actor the whole time. thank you so much for your help, and sorry for your troubles! After testing again, it definitely worked. by the way, do you know what the 6 pistol salute is?
 

JohnDoeNews

Mod on Steam (MV/MZ)
Veteran
Joined
Apr 25, 2017
Messages
1,572
Reaction score
1,178
First Language
Dutch
Primarily Uses
RMMV
Whahaha. I had kind of the same thing. Didn't work for me either, cause I accidentally had it set to ATK and DEF. :p But after about 5 tries I figured it out. :p

Glad to read it works now. :) I hope to see the result one day! Good luck!

-

Oh and no idea what the 6 pistol salute is. What is it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,485
Reaction score
16,402
First Language
English
Primarily Uses
RMMV

I've moved this thread to MV Support. Thank you.

 

Latest Threads

Latest Profile Posts

After an entire year, finally made new story cutscenes. Ones that take place after the current last boss. Praise be.
That moment when you're getting a new update ready, deploy it for the final round of testing (gotta make sure the deployed version runs, ya know?) andddddd there's a visual blip :ysrs: Doesn't impact gameplay. It's only on-screen for a few seconds. But you can't leave it there.
So now you have to fix it, then redeploy, then retest. Why do I do this to myself.
So I'm reading a sci-fi book called Berserker Man. Now, the 'Berserker Man' isn't a man or a Berserker. He is actually a very calm 11 year-old-boy. So misleading title. He was recruited to fight these emotionless killing machines called Berserkers. Also confusing. I will read it until it starts making sense.
A few tweaks and changes, now the load screen is literally loading :kaoswt:
loading.gif
I tried a new thing.

fg.png

Forum statistics

Threads
129,798
Messages
1,205,246
Members
170,902
Latest member
Tanawindinn
Top