RPG Maker MV

RPG Maker MV

Pippon! Apr 17, 2016 @ 6:00pm
Stacking Buffs? Dispelling only one stack?
Hi again. I have been writing up groundwork for a few boss fights and have a few questions. Im fairly new to RPGMaker so im not an experienced programmer, so going into creating scripts and such is beyond me.

[Willing to use Yanfly if necessary so long as someone is willing to teach me how to implement it.]

One boss has an ability that on use, puts several stacks of a debuff/state on everyone in your party, and several turns later uses an ability that deals damage equal to how many stacks each member has and the idea is that you need to debuff them so its not fatal. is there a way to make it so dispelling only takes off one stack? Is there a way to make the ability deal damage based on these stacks?

Another boss starts out with a buff that reduces damage taken, and the idea is to break support beams around it to reduce its stacks, making it weaker with each one destroyed. again, im not too sure how I could do this.

I know it may be selfish and a bit much to ask, but I have tried doing some research and havent found any good leads, and I dont know anyone personally who also uses the program. Thanks in advance.
Last edited by Pippon!; Apr 25, 2016 @ 4:38pm
< >
Showing 1-13 of 13 comments
Jazeeri Apr 17, 2016 @ 6:31pm 
Dusty from Dustwood gaming, might be a good resource for events like this. He has a lot of
Youtube videos and does answer questions, if no one else knows this answer. I certainly don't :)
Pippon! Apr 17, 2016 @ 6:41pm 
Originally posted by Jazeeri:
Dusty from Dustwood gaming, might be a good resource for events like this. He has a lot of
Youtube videos and does answer questions, if no one else knows this answer. I certainly don't :)

Never heard of him. Tried a google search and got nothing.
Though I never asked about youtube channels, would prefer a direct answer than a mention of a youtube channel.
Last edited by Pippon!; Apr 17, 2016 @ 6:41pm
Slim Jimmy Apr 17, 2016 @ 9:03pm 
iirc, Yanfly's Buff/State Core has functions that does that sort of thing
Pippon! Apr 18, 2016 @ 6:53pm 
Originally posted by Russel Jimmy:
iirc, Yanfly's Buff/State Core has functions that does that sort of thing
Buff/State Core only supports statistical buffs/debuffs. (ie ATK, DEF, EVA, etc)
Sabi Apr 18, 2016 @ 10:04pm 
So, are you talking about stacking States for the first part perhaps? Stacking states would be ideal for that but the default RPGM doesn't support that and even overwriting it (putting the same state multiple times in the states list) doesn't stack the way you might want. However, using Yanfly's Buffs/States Core with a little lunatic scripting can get this done.

First, this is based on the idea that you will make the enemy attack with an element. This can be a unique element not used anywhere else in your game and not even be an actual "element", merely a way to enhance damage done - by altering element rate. This part is standard RPGM using States but to get the affect of a stacking state debuff, use Yanfly's script as follows:

1. Each level of your state will be a different state; so for example Poison 1 can be state 10, Poison 2 state 11, Posion 3 be state 12, etc.

2. Then create a place holder state. It's affect is irrelevent because it will only be used to trigger the appropriate stacked state then remove itself. Under notes, place the following tags..

<Custom Apply Effect> if(!a.isStateAffected(10) && !a.isStateAffected(11)) { a.addState(10); } else if(a.isStateAffected(10)) { a.addState(11); a.removeState(10); } a.removeState(12); </Custom Apply Effect>

The numbers themselves are just examples and represent the state ID numbers. In the first if statement, continue with the !a.isStateAffected for all your stacks and then continue with else if statements for each individual stack to afflct with the next stack (I realize this sounds confusing but I hope it will eventually make sence). The final statement removes the placeholder state that was just added. This is so this code can run again when the state is reapplied.

3. Your enemy will use a skill that adds the placeholder state and the script takes care of the rest.

Basically, what this custom apply effect does is that it first checks to see if the target has any stacks of the state. If not, it adds the first level. If it does, then it checks which state stack it has and then adds the next stack and removes the current stack (you could keep all stacks active if you wish but that can add up the icons :) ). Then it removes itself - the dummy state - so that the same process can run for reapplying it.

Again, I know is a bit much but I have tested this and does work. I hope you find it helpful.
Pippon! Apr 19, 2016 @ 4:54am 
Originally posted by Sabi:
So, are you talking about stacking States for the first part perhaps? Stacking states would be ideal for that but the default RPGM doesn't support that and even overwriting it (putting the same state multiple times in the states list) doesn't stack the way you might want. However, using Yanfly's Buffs/States Core with a little lunatic scripting can get this done.

First, this is based on the idea that you will make the enemy attack with an element. This can be a unique element not used anywhere else in your game and not even be an actual "element", merely a way to enhance damage done - by altering element rate. This part is standard RPGM using States but to get the affect of a stacking state debuff, use Yanfly's script as follows:

1. Each level of your state will be a different state; so for example Poison 1 can be state 10, Poison 2 state 11, Posion 3 be state 12, etc.

2. Then create a place holder state. It's affect is irrelevent because it will only be used to trigger the appropriate stacked state then remove itself. Under notes, place the following tags..

<Custom Apply Effect> if(!a.isStateAffected(10) && !a.isStateAffected(11)) { a.addState(10); } else if(a.isStateAffected(10)) { a.addState(11); a.removeState(10); } a.removeState(12); </Custom Apply Effect>

The numbers themselves are just examples and represent the state ID numbers. In the first if statement, continue with the !a.isStateAffected for all your stacks and then continue with else if statements for each individual stack to afflct with the next stack (I realize this sounds confusing but I hope it will eventually make sence). The final statement removes the placeholder state that was just added. This is so this code can run again when the state is reapplied.

3. Your enemy will use a skill that adds the placeholder state and the script takes care of the rest.

Basically, what this custom apply effect does is that it first checks to see if the target has any stacks of the state. If not, it adds the first level. If it does, then it checks which state stack it has and then adds the next stack and removes the current stack (you could keep all stacks active if you wish but that can add up the icons :) ). Then it removes itself - the dummy state - so that the same process can run for reapplying it.

Again, I know is a bit much but I have tested this and does work. I hope you find it helpful.

I will try my best to implement this. Sure its a bit overwhelming but its the best lead I got and a good push to learn more about scripting. Cheers mate.
Sabi Apr 19, 2016 @ 9:01pm 
Ok, from a little trial and error, I figured out how to create stacking states without a script, though it will require the creation of several states.

First, it will work off the same premise; different states representing a stack (i.e. Weakness 1, Weakness 2, etc). In addition, you will also need to create a "Shield" state for each stack after the first (i.e. Weak Shield 2, Weak Shield 3, etc).

The shield states simply have an effect of State Resist - Weakness xxx, where xxx is the state to block. Each Weakness state also has a State Resist of the next level shield state. Finally, you need to add all Shield states to your actors before the battle begins.

So, for example, lets create a weakness state that increases Dark Elemental damage and stacks 3 times.

Create States:
Weakness 1. Traits: Element Rate - Darkness * 150%, State Resist: Weak Shield 2.
Weakness 2. Traits: Element Rate - Darkness * 200%, State Resist: Weak Shield 3
Weakness 3. Traits: Element Rate - Darkness * 300%
Weak Shield 2. Traits: State Resist: Weakness 2
Weak Shield 3. Traits: State Resist: Weakness 3

Now create the skill, the skill will add the states in the following order under traits:
AddState: Weakness 3
AddState: Weakness 2
AddState: Weakness 1

And then last, before the battle starts (Either in the event to trigger the battle or in the troop event), add the states Weak Shield 2 and Weak Shield 3 to all party members.

Every time the Weakness skill is used, it will add each new level. If you want, you can also have each new level remove the previous level by making another State Resist call in each state

ex> Weakness 2. Traits: Element Rate - Darkness * 200%, State Resist: Weak Shield 3, State Resist: Weakness 1.

This does work in stacking states as well, though as you can see, it will increase the number of states you need to create. I tried using State Rate adjustments but that didn't work, this method does so you can use whichever you prefer.
Sabi Apr 21, 2016 @ 9:40am 
Solomore, were you able to find a solution to this or do you still need assistance?
Pippon! Apr 25, 2016 @ 4:38pm 
Originally posted by Sabi:
Solomore, were you able to find a solution to this or do you still need assistance?
For now this may be sufficient info. Will remove the tag until I need to revisit this. Thanks all.
Pippon! Apr 28, 2016 @ 11:19pm 
Originally posted by Sabi:
Ok, from a little trial and error, I figured out how to create stacking states without a script, though it will require the creation of several states.

First, it will work off the same premise; different states representing a stack (i.e. Weakness 1, Weakness 2, etc). In addition, you will also need to create a "Shield" state for each stack after the first (i.e. Weak Shield 2, Weak Shield 3, etc).

The shield states simply have an effect of State Resist - Weakness xxx, where xxx is the state to block. Each Weakness state also has a State Resist of the next level shield state. Finally, you need to add all Shield states to your actors before the battle begins.

So, for example, lets create a weakness state that increases Dark Elemental damage and stacks 3 times.

Create States:
Weakness 1. Traits: Element Rate - Darkness * 150%, State Resist: Weak Shield 2.
Weakness 2. Traits: Element Rate - Darkness * 200%, State Resist: Weak Shield 3
Weakness 3. Traits: Element Rate - Darkness * 300%
Weak Shield 2. Traits: State Resist: Weakness 2
Weak Shield 3. Traits: State Resist: Weakness 3

Now create the skill, the skill will add the states in the following order under traits:
AddState: Weakness 3
AddState: Weakness 2
AddState: Weakness 1

And then last, before the battle starts (Either in the event to trigger the battle or in the troop event), add the states Weak Shield 2 and Weak Shield 3 to all party members.

Every time the Weakness skill is used, it will add each new level. If you want, you can also have each new level remove the previous level by making another State Resist call in each state

ex> Weakness 2. Traits: Element Rate - Darkness * 200%, State Resist: Weak Shield 3, State Resist: Weakness 1.

This does work in stacking states as well, though as you can see, it will increase the number of states you need to create. I tried using State Rate adjustments but that didn't work, this method does so you can use whichever you prefer.



Having a bit of trouble wrapping my head around this.
The point of the boss is;
The boss has a buff that reduces the damage they take from all souces
The goal of the fight is to destroy support beams to reduce the amount of damage taken by the party.
(ie The boss starts with 90% resistance to damage, then 75%, then 60%, etc. all the way to 0 to take full damage from all sources.)
Sabi Apr 29, 2016 @ 9:04am 
Turns out there is an easy way to stack states built-in but requires a script call - addNewState. This will add the state regardless if it's already on the target. Remove state will still only remove one instance of the state. So this might be a good start.

Next is how to deal with the beams powering up your enemy. I would suggest playing around with different values and different parameters to fine tune, but to start, let's say each beam increases your enemy's Attack, Defence, Magic Attack, and Magic Defence by 100%. So you would make one state that has all parameters with a rate of + 200%. Next, I assume the beams will be targetable enemies in your battle. You can make troop events that trigger when each beam's HP falls to zero (you will also need immortal flags on them to start so the event will trigger). Each one simply calls the event procedure Remove State on the boss to remove each stack as well as remove the immortal state from the beam.

Finally to get things going, you need a troop event to run at the very start of battle that places the immortal state on the beams and the 4 stacks of your state on the enemy. For the last part, use a script that calls:

$gameTroop.members(0).addNewState(stateId);

4 times. StateId is your stacking state and I used 0 only because I assume the boss is the first enemy you added to this troop, with the beams later.


I also thought about your first question and here's an alternate approach - how to make a skill the enemy will use have its damage determined by the number of beams is actually a bit easier that doesn't require states. Simply designate a game variable that will hold the number of beams still in play. Start at 5 and with each event that triggers when a beam is destroyed, reduce the count by 1. Finally, the skill that the enemy will use will have a formula something like this (assuming using variable 2):

a.atk * 6 * $gameVariables.value(2) - b.def * 2;

You can adjust the constants to raise or lower the damage done, but this will scale the damage based on the number of beams. The reason we started at 5 is so that the skill will still do damage even after all beams are destroyed.

I hope you find this information helpful.
Pippon! Apr 29, 2016 @ 9:22am 
Originally posted by Sabi:
Turns out there is an easy way to stack states built-in but requires a script call - addNewState. This will add the state regardless if it's already on the target. Remove state will still only remove one instance of the state. So this might be a good start.

Next is how to deal with the beams powering up your enemy. I would suggest playing around with different values and different parameters to fine tune, but to start, let's say each beam increases your enemy's Attack, Defence, Magic Attack, and Magic Defence by 100%. So you would make one state that has all parameters with a rate of + 200%. Next, I assume the beams will be targetable enemies in your battle. You can make troop events that trigger when each beam's HP falls to zero (you will also need immortal flags on them to start so the event will trigger). Each one simply calls the event procedure Remove State on the boss to remove each stack as well as remove the immortal state from the beam.

Finally to get things going, you need a troop event to run at the very start of battle that places the immortal state on the beams and the 4 stacks of your state on the enemy. For the last part, use a script that calls:

$gameTroop.members(0).addNewState(stateId);

4 times. StateId is your stacking state and I used 0 only because I assume the boss is the first enemy you added to this troop, with the beams later.


I also thought about your first question and here's an alternate approach - how to make a skill the enemy will use have its damage determined by the number of beams is actually a bit easier that doesn't require states. Simply designate a game variable that will hold the number of beams still in play. Start at 5 and with each event that triggers when a beam is destroyed, reduce the count by 1. Finally, the skill that the enemy will use will have a formula something like this (assuming using variable 2):

a.atk * 6 * $gameVariables.value(2) - b.def * 2;

You can adjust the constants to raise or lower the damage done, but this will scale the damage based on the number of beams. The reason we started at 5 is so that the skill will still do damage even after all beams are destroyed.

I hope you find this information helpful.

I know you are trying to help, and your putting a lot of effort into it, but I must stress.
These are 2 seperate bosses that deal with stacks seperately.
Boss A takes less and less damage with each support beam up.
Boss B is much later in the game and puts a stacking debuff on the party, and deals according damage several turns later.

I think you may be confusing these which is really scrambling my brain >_<
Sabi Apr 29, 2016 @ 11:39am 
I'm sorry, it is a bit much so I'll try to sum up:

You can use Buffs and Debuffs built into RPGM if you want to modify parameters. These support stacking.

If you want more control such as elements or special parameters, use states. To stack states you can use the script command addNewState.

Beyond that, the only other thing I can add is that to do specifically what you want to do is very much possible, but it is not a built in feature and thus requires event writing and a little scripting.
< >
Showing 1-13 of 13 comments
Per page: 1530 50

Date Posted: Apr 17, 2016 @ 6:00pm
Posts: 13