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,284
Reaction score
1,693
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 Posts

Latest Profile Posts

and_remember_tomorrow_on_the_plus_side.jpg

After countless hours, I finally solved the mystery of the missing puzzle pieces, but also created the mystery of the space trees... Progress? :kaoswt:
I am playing Momodora today and OMG this game is hard! o.o
Really happy to see people from Brazil doing an amazing game :3
Just noticed... I'm now called a Veteran not just Member...
Effervesce Fallacy™ - PV - C'est La Vie, for the best viewing experience, run the EXE, and adjust the audio via Options. The footsteps sounds are once again, barely audible. :frown: The PV only sounds as intended, if BGM Volume is set to 20%, or 40%, depending on your audio hardware.

Stream will be live shortly with some Gex 3! Tonight, I get revenge on the Buccaneer Program! Feel free to drop by!

Forum statistics

Threads
109,222
Messages
1,043,157
Members
141,734
Latest member
netispalsu
Top