Hey guys I'm currently trying to create a Magic Jammer effect in the buffs and states core I have the pre created one yanfly made but im struggling trying to change it to my needs. I have it set to block a percentage of the main characters health but it keeps giving me a bunch of decimal numbers for health. So when I heal I get numbers like 255.5655345 I'd like to round those numbers any way to do that?
MV How do I round numbers in yanfly buffs and states core
Javascript/Plugin SupportMoved to: Plugin Support
What is a "magic jammer" effect?
What is a "magic jammer" effect?
roud numbers is done with math.ceil(...) for up or down)
and there where was another one (1 for up, 1 for down), 1 is given,
forgot the other one.
depending what you have in the notetag of the state.
if you show that, advance lunatic coders can help you correct
the issue for you.
and there where was another one (1 for up, 1 for down), 1 is given,
forgot the other one.
depending what you have in the notetag of the state.
if you show that, advance lunatic coders can help you correct
the issue for you.
Put your formula (with the division to create the percentage) inside of Math.floor(
here)It basicly creates a barrier that nullifies incoming heals for a certain amount.
Hi sorry I have had to work a lot and havn't had much time to test this out. I tried it and it doesn't seem to be working. I'll send the line of code that the formula is placed in and maybe you could help? Thank you so much. There's two lines. One for generating the number to block and another to show it on the counter so the player can see how much they have to heal.
target._antiHealBarrier = target.mhp / 3;
target.setStateCounter(stateId, target.hmp / 3);
What did you try that didn't work?
I played with it for a little and it worked. I had the Math.floor in the wrong place on the second line I gave. I put it inside the quotations instead of outside of the entire thing. But it's working perfectly now! Thank you for your help!
Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-round-numbers-in-yanfly-buffs-and-states-core.142147/