Any way to swap stat values on the fly?

Helio

Villager
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
Yeah, sure. I don't really understand why you would want to switch them, but I am sure your idea is great. 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

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

pawsplay

Veteran
create two passive states, one that adds +200 to each stat. Swap them as needed.

Sullien

Dev Candidate
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
Yeah, sure. I don't really understand why you would want to switch them, but I am sure your idea is great. 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 ) 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
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.

Helio

Villager
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.
It didn't work. Do I need to change the variable somehow? I'm also using Variable 1 like you suggested

JohnDoeNews

Veteran
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
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
13.9 KB · Views: 3

Helio

Villager
says the difference is -95

JohnDoeNews

Veteran
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
140.8 KB · Views: 2

Helio

Villager
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
Whahaha. I had kind of the same thing. Didn't work for me either, cause I accidentally had it set to ATK and DEF. But after about 5 tries I figured it out.

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

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

Latest Profile Posts

So after completing the Mass Effect Trilogy the first time as a Vanguard, I decided to replay the trilogy as a Soldier. Thus far, I've just finished the Horizon mission in ME2, and I'm already exhausted from ME2's f**k-awful enemy design.
Yeah, now Yes !!!! "boom boom "
"Fire the monsters, guards!!!"

I can't stop buying resource packs I'll never use, or engines for that matter, or free resources as my two terabyte external will attest. I am a digital hoarder I guess. Some people get drunk off the silly juice when they are bored, I just buy shiny digital nonsense I don't need.
Not a bad weekend but anxiety kicking my but. Also wondering about Ms Littlefish. Some people move on. Anyways how is everyone doing?
I did a video review on Psychronic Games' Star Shift Origins, as they did a review on my game.
Check it out!