I really not proud of asking such basic questions, but after searching for tomorrow and today, I still wasn't able to figure out how. What I want is to make State X, that boosts damage by 10%, being able to stack, so by inflicting it 3 times, you could get 30% damage increase. I have VisuMZ plguins, but the only thing I found is notetags for increasing state duration.
How to make certain state stackable?
RPG Maker MZ SupportThere's not actually any such thing as "stacking" states. You have a state or you don't.
You can use notetags to see if a battler already has a state when it would be applied, and increase a variable on them accordingly.
For example:
That creates a _boostCounter variable that increases by 1 every time the state is applied to the battler, to a max of 3. You can reference that in your damage formulae, notetags, whatever.
You can use notetags to see if a battler already has a state when it would be applied, and increase a variable on them accordingly.
For example:
Code:
<JS On Add State>
target._boostCounter ??= 0;
target._boostCounter = Math.min(target._boostCounter+1, 3);
</JS On Add State>
<JS Pre-Damage as User>
if (this.isDamage())
value += Math.round(value * (.1 * user._boostCounter));
</JS Pre-Damage as User>
<JS On Erase State>
delete user._boostCounter;
</JS On Erase State>
That creates a _boostCounter variable that increases by 1 every time the state is applied to the battler, to a max of 3. You can reference that in your damage formulae, notetags, whatever.
Theo - Stacking States
About: You want to stack the same state x times Use to determine the maximum stack you can use. Preview: Download: Save as a new JS file Terms of Use: Read here I hope you find this useful.
forums.rpgmakerweb.com
I use this one.
Have you tried it with VisuStella plugins? It overwrites some low-level methods, so I'd be leery about them working together.
But if you've tried it, groovy 🙂
Er, I believe so, but I'm not 100%.
Thanks for catching that!
Thanks for catching that!
you had the marked state you asked about a few days ago that does a similar thing. you didnt try to modify it as a base to create the effect for this one?
If you purely want to stack up any Status like Attack, Defense or Agility. You should prepare an Condition that will be applied to the user/enemy/party member. Like Attack Upx3 adding 30% damage.
give that skill the normal stuff and add a common event that will be triggered upon the skill's use.
The things will be like this:
Skill
Condition 1 (Attack Up) << This is the first Stage with the 10% up
Condition 2 (Attack Up) << This is the second stage with the 20% up
Condition 3 (Attack Up) << This is the third Stage with the 30% up
NOW to the Common Event:
IF a person is already afflicted with the said Condition, Remove the first Stage and give it the Second Stage.
This will be a lot of work if you have many characters in your game that can be in your party but that's A way to go about it.
give that skill the normal stuff and add a common event that will be triggered upon the skill's use.
The things will be like this:
Skill
Condition 1 (Attack Up) << This is the first Stage with the 10% up
Condition 2 (Attack Up) << This is the second stage with the 20% up
Condition 3 (Attack Up) << This is the third Stage with the 30% up
NOW to the Common Event:
IF a person is already afflicted with the said Condition, Remove the first Stage and give it the Second Stage.
This will be a lot of work if you have many characters in your game that can be in your party but that's A way to go about it.
I will try to put everything into one post:
-Code that ATT_Turan sent is working, but I wonder if it can be modified, to account for already boosted enemy damage? So, if enemy has 10 damage, first time it's buffed to 11, then by 10% from 11, and so on. Currently it always takes for account enemy base damage.
-Theo plugin doesn't seems to work, probably because of VisuMZ?
-I did thought of using that code as reference, but due to my low experience with code, I decided I couldn't turn it into percentage. It's a good idea, thought, and EliDynamicParameters has mentioned being able to use formulas for it's parameter, so I guess you could change adding attack directly to adding attack percent? Or, well, damage buff percent.
- I guess I seen methods like these, but I would resort to it only if nothing else works, since it seems less than optimal.
-Code that ATT_Turan sent is working, but I wonder if it can be modified, to account for already boosted enemy damage? So, if enemy has 10 damage, first time it's buffed to 11, then by 10% from 11, and so on. Currently it always takes for account enemy base damage.
-Theo plugin doesn't seems to work, probably because of VisuMZ?
-I did thought of using that code as reference, but due to my low experience with code, I decided I couldn't turn it into percentage. It's a good idea, thought, and EliDynamicParameters has mentioned being able to use formulas for it's parameter, so I guess you could change adding attack directly to adding attack percent? Or, well, damage buff percent.
- I guess I seen methods like these, but I would resort to it only if nothing else works, since it seems less than optimal.
modify the math so that each stack is multiplied individually instead of being added together and multiplied as a whole
Code:
value = Math.round(value*(1.1**user._boostCounter));
Its the same idea the mark state uses, just instead of adding a constant number * the number of stacks to the damage value, you take the already existing value and modify it by a percentage of itself
Just for your info, so people will understand you better, the word in RPG Maker is State, not Condition.
The way you describe can be done much more efficiently with some script calls in the common event, but the OP is already using VisuStella plugins that give access to relevant notetags (and there are other ways to get such notetags).
I'm not super following, my math should do exactly what you described in your first post. It increases the base damage by 10% per counter. So if your skill is dealing 10 damage, the math I typed will make it do 11, 12, or 13 depending on how many times they've received the state.
I don't know what "takes for account enemy base damage" means.
Can you help me with the reasoning? That 3% difference is not going to change anything going off of the example 10 damage Jobhob mentioned.
it wont in this case cause the values are too small for it to matter.
But since thats how they had asked for it (or atleast how i interpreted it), i imagined that either the damage eventually grows to a point where itll matter, or that there may be similar effects in the future that use greater percentages/stacks to make the change from additive to multiplicate stacks more impactful
It helps actually. Now, after getting that buff like 7 times, it increases by 3-4 damage per new, not just 1, so it can snowball. As example, first it takes 10% from 10 and adds that, then it takes 10% from 11 and add that, then 10% from 12, and so on and so on, that's what I was looking for.
P.S.
value = Math.round(value*(1.1**user._boostCounter));
1.1 here is the modifier, right? So if I want 20% increase, I just change it to 1.2?
My interpretation of Jobhob's request is that they wanted the buff to stack multiplicatively instead of additively.
Apparently? I was going off:
Which is pretty clearly stated. I guess it wasn't a clear wording of the desire 🤣
Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-certain-state-stackable.163440/