Meat_Cube

Warper
Member
Joined
Jan 2, 2021
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
I would like to know how to make simple attack buffs and defense debuffs. In my mind, these buffs/debuffs would increase or decrease the stat variable ( Stat Variable = the attack or defense stat from the targeted actor ) by 15%. I have not worked with code in the past, so I looked on forums and tried to stitch together something that made sense, at least in my mind.

Code:
<Custom Apply Effect>
If (target.isactor()) { target.atk * 20 }
</Custom Apply Effect>

<Custom atk Buff Turn>
turn = 10
turn += user.agi;
</Custom atk Buff Turn>

If someone could lay out the building blocks, I can replicate it for each buff / debuff.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,282
Reaction score
1,692
First Language
EN
Primarily Uses
RMMZ
The engine has a basic stacking buff/debuff system for basic params (MHP, MMP, ATK, DEF, etc). You can apply +1 (de)buff via the Effects list of a skill or item. By default each (de)buff level corresponds to ±25% to that parameter, and can stack up to a total of ±50%. Debuffing a buffed param removes one buff level, etc. :kaohi:

If you don't need it to stack, you can simply use a state with a Parameter Rate: Attack trait. 115% is an increase of 15%; 85% is a decrease of 15%. These traits combine multiplicatively. :kaophew:

Otherwise I think you will need a plugin, e.g.
  1. Something that can change the default buff system, e.g. the plugin parameters (editable via the Plugin Manager) of Yanfly's Buffs & States Core; or

  2. Something that can implement stacking states (I don't know of one, maybe someone else does); or

  3. Something that can set custom parameter formulae, e.g. the plugin parameters of Yanfly's Base Parameter Control (paid plugin).

Your attempt with a <Custom Apply Effect> tag from Buffs & States Core is flawed for several reasons:
  • Invalid code: if (target.isActor()) target.atk *= 1.15; could be valid, but...

  • Parameter values like atk cannot be changed like that. Their value is determined based on the actor's class/level, current equipment, permanent bonuses (e.g. from the Change Parameter event command), and traits.

  • If you work around those two points, you would (I assume) also need some way to undo the ATK change once the state wears off. In theory you could remember the offset before applying it, then remove that offset when the state ends. However, I seem to remember Yanfly's Buffs & States tags only running during battle, which if true would make this approach somewhat bug-prone. :kaoslp:
 

Meat_Cube

Warper
Member
Joined
Jan 2, 2021
Messages
4
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thank you for the help, it means a lot to me that you would take the time to answer a question this simple with a paragraph of useful information
 

Latest Threads

Latest Profile Posts

Can anyone provide a link to where Vlue said that his Plugins for MV were free for commercial usage? I only see it on the thread here, but Vlue didn't directly start it. What do guys think about it?

I've been struggling with getting a couple skills setup, trying over and over and doing common events...and now I got it working with just one state.
When the answer is so simple, I don't know whether to be happy or eh about how much time it took to realize the issue. :kaoeh:
Anybody know how to make an enemy have a line of sight? I'm trying to make Persona-like enemies.
zomboars.jpg

Concept art

Zomboars- main enemies in my story
mutant pigs addicted to beer
SF_People1_3 added!
index.php

Forum statistics

Threads
109,203
Messages
1,043,034
Members
141,717
Latest member
GorgarWillEatYou
Top