Helio

Villager
Member
Joined
Jan 15, 2020
Messages
10
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

Veteran
Veteran
Joined
Apr 25, 2017
Messages
328
Reaction score
204
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
397
Reaction score
137
First Language
English
Primarily Uses
RMMV
create two passive states, one that adds +200 to each stat. Swap them as needed.
 

Sullien

Dev Candidate
Member
Joined
Apr 5, 2015
Messages
20
Reaction score
23
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
10
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

Veteran
Veteran
Joined
Apr 25, 2017
Messages
328
Reaction score
204
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
10
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

Veteran
Veteran
Joined
Apr 25, 2017
Messages
328
Reaction score
204
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
10
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: 3

Helio

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

JohnDoeNews

Veteran
Veteran
Joined
Apr 25, 2017
Messages
328
Reaction score
204
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: 2

Helio

Villager
Member
Joined
Jan 15, 2020
Messages
10
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

Veteran
Veteran
Joined
Apr 25, 2017
Messages
328
Reaction score
204
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
44,647
Reaction score
15,740
First Language
English
Primarily Uses
RMMV

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

 

Latest Threads

Latest Posts

Latest Profile Posts

I'm wondering if it's possible to get the font used for the title in RPG Maker MZ's splash screen, because it's a neat looking font. I wanna use it for like, a title screen or something.
I think it's by time I make use of this feature in the forums. I'm never one to share profile updates or anything the sort, but hey, you gotta start somewhere! I think I'll use this place primarily to post maps actually, so here, have a goblin cave!

PqleoRp.png

Inspired largely by Wynncraft's Aseado Leaf cave
Does anyone know if Yanfly's Ace scripts are still free for use in both commercial and noncommercial projects? Can't find much except for the wordpress Terms of Use, but not sure if it's not outdated.
I just realized two of My series are beginning to look virtually identical to one another in mechanics and general themes, I never had this problem before.

This is Stifling! Must resolve this!
Lord's Reincarnation III (LR3) MOBILE is coming!!!
iu_534706_7630675.png

Forum statistics

Threads
118,711
Messages
1,118,109
Members
155,852
Latest member
rumnerd_frog
Top