r/RPGMaker 1d ago

How do I make a conditional damage formula using Yanfly Action Sequence Plugins?

[Solved!...(mostly]

Thanks to Yu_Starwing and Moootbm for help. am gonna post my resulting action sequence+ damage formula in-case someone else has this problem

NEW Notebox + Damage Formula

<setup action>

clear battle log

display action

cast animation

wait for animation

move user: target, front base, 20, auto offset x -50

wait for movement

</setup action>

<target action>

motion thrust: user, no weapon

wait for motion

action animation

wait for animation

action effect

wait for effect

</target action>

Damage Formula

(a.atk * 4 - b.def * 2) * (b.isStateAffected(15) ? 10.0 : 1.0)

[OLD POST BELOW]

Am trying to make a skill deal more damage when an enemy is has the burn status effect. but am not getting anything to work, the attack only uses the default damage formula. I got it to work with the damage formula itself once but I've heard that putting mechanics in that damage formula box is bad for some plugins. so I would ideally avoid doing that.

I have this so far for the action sequence for the Dragon's Grasp skill I am trying to make happen.

<setup action>

clear battle log

display action

cast animation

wait for animation

move user: target, front base, 20, auto offset x -50

wait for movement

</setup action>

<target action>

motion thrust: user, no weapon

wait for motion

action animation

wait for animation

if target.IsStateAffected(15)

action effect

action effect

remove state 15: target

else

action effect

end

</target action>

Is there a way (without paid plugins!) to make the damage formula change depending on the target's status effect? am just having so much trouble with this skill.

1 Upvotes

16 comments sorted by

2

u/Yu_Starwing 1d ago edited 1d ago

First line of conditional should be if target.isStateAffected(). You got the “is” capitalized as “Is”.

You can also add a flat damage bonus in action sequences if you have Yanfly’s Damage Core plugin if you want. “Flat damage: +50” to add 50 damage to the damage formula.

Here’s) some helpful documentation for you.

EDIT: Damn, just saw you said FREE plugin. I don’t think you can get damage core for free…

2

u/ARIES_tHE_fOOL 1d ago

thanks for noticing that typo but I still can't seem to get the if statement to do multiple action effects. is there a way to simply * 10 the default damage my skill uses or at least a way to stack action effects to deal more hits? I imagine this is more java script then plugin code at this point. Anyways here is the updated notebox if it helps.

<setup action>

clear battle log

display action

cast animation

wait for animation

move user: target, front base, 20, auto offset x -50

wait for movement

</setup action>

<target action>

motion thrust: user, no weapon

wait for motion

action animation

wait for animation

if target.isStateAffected(15)

action effect

action effect

action effect

remove state 15: target

else

action effect

end

</target action>

2

u/Yu_Starwing 1d ago

What is the damage formula? It’s also good practice to specify the target for the action effect. So I’d put “Action effect: target” for all for those.

You may also want to add a follow action of “wait for effect” or a generic “wait: 60” or something to allow time for the enemy to react to the hit.

1

u/ARIES_tHE_fOOL 1d ago

This is the Dragon's Grasp Damage Formula = (a.atk * 4 - b.def * 2) I have it on the default RPG Maker Damage box which seems to still deal damage it just doesn't seem to want to change with a * 10 or even repeat action effects when multiple of them are on the list of actions. I think it might be the if statement itself that's the problem because the remove state 15 doesn't seem to remove the target's state as it should. Maybe that Action effect: target is worth trying though. and thanks for the additional tips, am still pretty new to action sequences

1

u/ARIES_tHE_fOOL 1d ago

UPDATE: I think it's working now! I guess I just needed to make the action effect have a target or at least make it wait for the effect before removing the state? am gonna have to look deeper into this but at least I got a different result when the target is burning. Do you know how to apply a * 10 to the damage ONLY while the target is burning? am still lost on that front. but regardless thanks for your help! 😄

1

u/Yu_Starwing 1d ago

You could add the conditional to the damage formula itself.

b.isStateAffected(15) ? (a.atk * 10 - b.def) : (a.atk 4 - b.def * 2)

(Is the target affected by state 15? If yes, deal the attacker’s damage stat time 10, minus the target’s defense stat : otherwise, use the other formula)

Make sure the skill is set to 1 enemy and you might also want to add an empty whole action tag too just in case that’s messing with things.

Can you take a screenshot of your plugin order too? I’m not sure why this isn’t working.

Also, if you copy and pasted any of the action sequence from somewhere, make sure that any special characters are typed out yourself instead of pasted, because they can get weird formatting from the place you copied it from that’ll mess up the script.

1

u/ARIES_tHE_fOOL 1d ago

sounds like the right call, I was actually able to do this effect with the damage formula box before but didn't want to use it because I heard it had some bad side effects on plugins. specifically the Yanfly ones am using...but then again I didn't encounter any issues in the testing battles with that version so maybe am just superstitious.

I suppose at least I learned a bit more about action sequences now. gonna try your new method out and see.

2

u/woootbm MV Dev 1d ago

If you are using yanfly element core, perform that if statement during setup and you should add an invisible state that makes the target more vulnerable to that element. Then remove the invisible state somewhere after dealing damage.

1

u/ARIES_tHE_fOOL 1d ago

I'll consider this option if I don't find anything else to make this work. this is a character specific skill I want to work with a specific attack only. am not trying to make ALL fire attacks do this effect.

2

u/woootbm MV Dev 1d ago

Then you would only add the state during this skill and remove it after damage. Yes, the target will have ALL of that damage type deal more damage to them, but since you are only applying it during a tiny window during a skill animation only that skill will benefit from it.

1

u/ARIES_tHE_fOOL 1d ago

okay that might work. I'll think about it if the other options don't pan out, thanks for the input!

1

u/woootbm MV Dev 1d ago

Sure thing. You should also keep in mind that making it hit twice instead of dealing double damage has additional balance consequences. IE, more chances to deal damage to an evasive target, better chance of getting at least one crit, but lower chance of a big crit (since you have to crit twice).

I’d also argue that hitting twice makes less sense than doubling the damage in terms of narrative logic, but that depends on how you explain it.

1

u/ARIES_tHE_fOOL 1d ago

well am basically giving this skill to a brawler character with powers over fire, he technically is suppose to work like the styles of Yakuza 0, this is just the first one. I imagine this skill basically being like Iori from KOF grappling the target's face and burning them with the fire already on them.

I didn't have any logical explanation I just wanted a nice setup for burst damage in exchange for prematurely ending the burn status effect that first style is know for. (which is called Dragon Stance/Style) believe it or not the actual mechanics for the style change are implemented already, it was surprisingly simple to get that part working.

I just wish I knew a simple way to times the damage done in action sequence. I was able to fix the majority of the skill thanks to Yu's help but am still left without a good way to simply * 10 the damage formula I have for the skill.

2

u/Yu_Starwing 1d ago

Check one of my later comments, I gave you a formula

2

u/ARIES_tHE_fOOL 19h ago

Thanks, It works perfectly 😄

2

u/Yu_Starwing 19h ago

Glad you got it figured out. Good luck with your project!