- Joined
- Mar 30, 2017
- Messages
- 7
- Reaction score
- 0
- First Language
- English
- Primarily Uses
- RMMV
Bug Description: startDamagePopup Additional Number
When using Game_Battler.startDamagePopup(), an "extra", extremely large number (the likes of 80000000000+) along with the normal damage number(s) appears. This happens with both single target and AoE reactions. Sometimes this "random" number can be 54, or some other low number too.
Despite this, the actual damage dealt is mechanically accurate, which has had me baffled for hours. Stat effect Reactions also work just fine.
I want to be clear: It's only the display that is broken.
Context: What's a Reaction?
If you've played Genshin Impact, the mechanic is fairly similar to that.
A "Reaction" checks the element(s) of a given skill, and applies States depending on the element. If another "Elemental State" is present, they'll react instead of applying their Elemental State, resetting the target to "Neutral" elemental state. Unlike Genshin, I also have reactions for Fire -> Fire, Ice -> Ice, and Thunder -> Thunder.
Plugin List & Order. (Unique ones described)
Using this as a basis for state design:
www.yanfly.moe
State Notetag:
State IDs
It should be noted that most of my custom parameters use an exponential curve, but these numbers should not be this high.
I'm at level 5, with stats like 56 ATK. Could be messing with things though?
Notes and things I checked:
Edit 2: States added.
When using Game_Battler.startDamagePopup(), an "extra", extremely large number (the likes of 80000000000+) along with the normal damage number(s) appears. This happens with both single target and AoE reactions. Sometimes this "random" number can be 54, or some other low number too.
Despite this, the actual damage dealt is mechanically accurate, which has had me baffled for hours. Stat effect Reactions also work just fine.
I want to be clear: It's only the display that is broken.
Context: What's a Reaction?
If you've played Genshin Impact, the mechanic is fairly similar to that.
A "Reaction" checks the element(s) of a given skill, and applies States depending on the element. If another "Elemental State" is present, they'll react instead of applying their Elemental State, resetting the target to "Neutral" elemental state. Unlike Genshin, I also have reactions for Fire -> Fire, Ice -> Ice, and Thunder -> Thunder.
Plugin List & Order. (Unique ones described)
- YEP_CoreEngine
- YEP_BaseParamControl
- YEP_X_ClassBaseParam
- YEP_ExtraParamFormula
- YEP_MessageCore
- YEP_X_MessageBacklog
- YEP_X_MessageSpeedOpt
- YEP_SaveCore
- DMK_CriticalAddState (prototypes Game_Action.prototype.itemEffectAddAttackState and .itemEffectAddNormalState)
- DMK_ActionResultUtils
- all-new Game_ActionResult constructors, such as setting HP damage and hpAffected = true.
- Game_Battler.prototype.newDamagePopup that does similar to Game_Battler.prototype.startDamagePopup from Yanfly Battle Engine Core, but without setting to this._result. Was my attempt at fixing the odd damage numbers.
- YEP_BattleEngineCore
- YEP_X_ActSeqPack1
- SergeofBIBEKActionSequenceLoops
- Allows loops in action sequences. Currently unused in any skill as I've been using looping through foes with targetCore. - YEP_X_CounterControl
- YEP_X_InBattleStatus
- YEP_X_TurnOrderDisplay
- YEP_X_VisualHpGuage
- YEP_BattleStatusWindow
- YEP_BuffsStatesCore
- YEP_X_VisualHpGauge
- YEP_X_ExtDoT
- YEP_Z_StateProtection
- YEP_DamageCore
- YEP_X_CriticalControl
- YEP_ElementCore
- YEP_ExtraEnemyDrops
- YEP_ForceAdvantage
- YEP_HitAccuracy
- YEP_LifeSteal
- YEP_TargetCore
- YEP_Taunt
- YEP_VictoryAftermath
- YEP_EquipCore
- YEP_AutoPassiveStates
- YEP_X_PassiveAuras
- YEP_EnemyLevels
- YEP_X_DifficultySlider
- YEP_X_EnemyBaseParam
- YEP_EnhancedTP
- YEP_PartySystem
- YEP_X_ActorPartySwitch
- YEP_OptionsCore
- DreamX_ShowParam
- Should not be an issue. Purely display and not damage numbers.
Using this as a basis for state design:
Stormflurry (MV Plugin Tips & Tricks) - Yanfly.moe Wiki
State Notetag:
Code:
<Custom Establish Effect>
if (this.isSkill()) {
if (target && target.result() && target.result().hpDamage > 0) {
// Make a copy of the target's original action results
var originalResult = JsonEx.makeDeepCopy(target._result);
target.clearResult();
// Loop through all the elements for this attack.
for (var element of this.getItemElements()) {
reactionState = 0;
reactionMessage = undefined;
reactionAnimation = 0;
reactionEffect = undefined;
// if element Fire
if (element === 2) {
// If fire synergy, Burn.
if (target.isStateAffected(5)) {
reactionState = 8;
reactionAnimation = 67;
reactionMessage = user.name() + ' causes Burn!';
}
// If Ice synergy, chain Melt.
else if (target.isStateAffected(6)
|| target.isStateAffected(9)) {
reactionEffect = 'melt';
}
// If Thunder synergy, chain Explosion
else if (target.isStateAffected(7)) {
reactionEffect = 'explode_thunder';
}
// If no synergy is present, apply own synergy!
else {
reactionState = 5;
}
}
// if element Ice
else if (element === 3) {
// If ice synergy, Frostburn.
if (target.isStateAffected(6)) {
reactionState = 9;
reactionAnimation = 72;
reactionMessage = user.name() + ' causes Frostburn!';
}
// If Fire synergy, chain Melt.
else if (target.isStateAffected(5)
|| target.isStateAffected(8)) {
reactionEffect = 'melt';
}
// If Thunder Synergy, apply Stun.
else if (target.isStateAffected(7)) {
reactionState = 10;
reactionAnimation = 64;
reactionMessage = user.name() + ' causes Stun!';
}
// If no synergy is present, apply own synergy!
else {
reactionState = 6;
}
}
// if element Thunder
else if (element === 4) {
// If Thunder Synergy, remove MP/TP
if (target.isStateAffected(7)) {
target.clearResult();
reactionAnimation = 77;
target.gainMp(-20);
target.gainTp(-20);
if (target && target.result() && target.result().hpDamage > 0) {
target.startDamagePopup();
// Clear the target's results
target.clearResult();
}
reactionMessage = user.name() + ' causes Discharge!';
}
// If Ice Synergy, Stun.
else if (target.isStateAffected(6)
|| target.isStateAffected(9)) {
reactionState = 10;
reactionMessage = user.name() + ' causes Stun!';
}
// If Fire synergy, chain Explosion
else if (target.isStateAffected(5)
|| target.isStateAffected(8)) {
reactionEffect = 'explode_fire';
}
// If no synergy is present, apply own synergy!
else {
reactionState = 7;
}
}
// Apply Reaction State if applicable
if (reactionState) {
// ...then add the reactionState to the target.
target.addState(reactionState);
}
// Reaction Effect?
if (reactionEffect) {
if (reactionEffect == 'melt') {
target.clearResult();
// Set the base damage
reactionBaseDamage = 160;
// This is the damage formula.
reactionFinalDamage = Math.max(0, reactionBaseDamage * (user.atk / target.def));
target.removeState(5);
target.removeState(6);
target.removeState(8);
target.removeState(9);
reactionAnimation = 81;
target.gainHp(-reactionFinalDamage);
if (target && target.result() && target.result().hpDamage > 0) {
target.startDamagePopup();
// Check if the target is dead
if (target.isDead()) {
// Make the target collapse
target.performCollapse();
}
// Clear the target's results
target.clearResult();
}
} else if (reactionEffect == 'explode_fire'
|| reactionEffect == 'explode_thunder') {
reactionMessage = user.name() + ' causes Explosion!';
// Set the base damage
reactionBaseDamage = 100;
// Grab the group of alive foes as candidates.
if (user.isActor()) {
for (var member of $gameTroop.aliveMembers()) {
if ((reactionEffect == 'explode_thunder'
&& member.isStateAffected(7))
|| (reactionEffect == 'explode_fire'
&& member.isStateAffected(5))) {
member.clearResult();
var reactionFinalDamage = Math.max(0, reactionBaseDamage * (user.atk / member.def));
reactionAnimation = 107;
member.removeState(5);
member.removeState(7);
member.removeState(8);
member.gainHp(-reactionFinalDamage);
if (member && member.result() && member.result().hpDamage > 0) {
member.startDamagePopup();
// Check if the member is dead
if (member.isDead()) {
// Make the member collapse
member.performCollapse();
}
// Clear the member's results
member.clearResult();
member.startAnimation(reactionAnimation);
reactionAnimation = 0;
}
}
}
} else {
for (var member of $gameParty.aliveMembers()) {
if ((reactionEffect == 'explode_thunder'
&& member.isStateAffected(7))
|| (reactionEffect == 'explode_fire'
&& member.isStateAffected(5))) {
member.clearResult();
var reactionFinalDamage = Math.max(0, reactionBaseDamage * (user.atk / member.def));
reactionAnimation = 107;
member.removeState(5);
member.removeState(7);
member.removeState(8);
member.gainHp(-reactionFinalDamage);
if (member && member.result() && member.result().hpDamage > 0) {
member.startDamagePopup();
// Check if the member is dead
if (member.isDead()) {
// Make the member collapse
member.performCollapse();
}
// Clear the member's results
member.clearResult();
member.startAnimation(reactionAnimation);
reactionAnimation = 0;
}
}
} // end enemy loop
} // end if enemy
} // end if fire or thunder explode
}
// if reactionMessage present...
if (reactionMessage) {
SceneManager._scene._logWindow._lines.push(reactionMessage);
SceneManager._scene._logWindow.refresh();
var waitframes = 45;
BattleManager._actionList.push(['WAIT', [waitframes]]);
}
} // end element loop
// play reaction animation
if (reactionAnimation) {
target.startAnimation(reactionAnimation);
}
// restore original results
target._result = originalResult;
}
}
</Custom Establish Effect>
State IDs
4 - Elemental Synergy. Passively on all battlers and the one with the Notetags above.
5 - Fire Synergy.
6 - Ice Synergy.
7 - Thunder Synergy.
8 - Burn (20% DoT, simple)
9 - Frostburn (Prevents healing HP)
10 - Stun (next action cannot move.)
5 - Fire Synergy.
6 - Ice Synergy.
7 - Thunder Synergy.
8 - Burn (20% DoT, simple)
9 - Frostburn (Prevents healing HP)
10 - Stun (next action cannot move.)
It should be noted that most of my custom parameters use an exponential curve, but these numbers should not be this high.
I'm at level 5, with stats like 56 ATK. Could be messing with things though?
<Custom Class Parameters>
maxhp = 160 + (level**2 * 16);
maxmp = 20 + (level**2 * 2);
atk = 16 + (level**2 * 1.6);
def = 12 + (level**2 * 1.2);
mat = 10 + (level**2);
mdf = 10 + (level**2);
agi = 14 + (level**2 * 1.4);
luk = 10 + (level**2);
exp = (level**2 * 500);
</Custom Class Parameters>
maxhp = 160 + (level**2 * 16);
maxmp = 20 + (level**2 * 2);
atk = 16 + (level**2 * 1.6);
def = 12 + (level**2 * 1.2);
mat = 10 + (level**2);
mdf = 10 + (level**2);
agi = 14 + (level**2 * 1.4);
luk = 10 + (level**2);
exp = (level**2 * 500);
</Custom Class Parameters>
Notes and things I checked:
- All plugins are up to date.
- Disabling all custom, non-yanfly plugins did not fix the problem.
- Syntactically, there's "nothing wrong" with my notetags' JavaScript.
- If I remove all startDamagePopups. Normal damage shows up fine. Reaction damage still occurs but with no indicator of damage amounts.
Edit 2: States added.
Last edited: