MV YEP_BuffsStatesCore/SkillCore drain that heals team, popups issue

Hi !
I've been adding my ideas smoothly on my project so far, and I begin to get used to YEP's notetags to implement mechanics.
My issue here is a popup error on a skill that drain HP then heals allies a certain amount of the drain dealt.
So the skill is set as a drain HP on one enemy, then I add a Post-Damage Eval notetag that does the following :

Code:
<Post-Damage Eval>
var pourfam = Math.floor(value*0.5);
$gameParty.aliveMembers().forEach(function(member) { member.gainHp(pourfam); });
$gameParty.aliveMembers().forEach(function(member) { member.startDamagePopup(); });
</Post-Damage Eval>

The "startDamagePopup" here is supposed to show the heal on allies, but it doesn't show things correctly. Either it only shows the drain and heal on the skill's user only, or it shows only the heal on everyone and the drain popup disappears.

The skill itself works, but it just shows popups incorrectly and I tried multiple ways to get around it without success.
Can someone help me on it to make the effect more understandable please ?
The skill itself works, but it just shows popups incorrectly and I tried multiple ways to get around it without success.
Can someone help me on it to make the effect more understandable please ?
If the skill itself is supposed to drain on hit to heal the player's party, why not avoid the popup issue entirely by having the skill heal everyone in the party except the user and let the engine's drain handle the user's heal, or make the skill hp damage and leave the tag as is?
I'm inclined to agree with @Robro33...I haven't messed with it, but I'd think your problems might come from multiple popups getting assigned to (and called on) the same actor.
Alright, I'll have to be more precise then 😅
I use Moogle_X_PassiveSkill and EquipSkillSystem to have passives that can add depth to a character's kit.
This skill is affected by it, the heal on the team occurs only when a passive is equipped.

Code:
<Post-Damage Eval>
if ($gameActors.actor(6).eqsSkillEquipped($dataSkills[192]))
{
var pourfam = Math.floor(value*0.5);
$gameParty.aliveMembers().forEach(function(member) { member.gainHp(pourfam); });
$gameParty.aliveMembers().forEach(function(member) { member.startDamagePopup(); });
}
</Post-Damage Eval>

I could ignore a way to work around this as I don't code and pick codes from the forum on the most part.
I tried applying a state to try to "delay" the popup or something, but I never end up to the "drain popup > heal popup on all allies" result 😅
This skill is affected by it, the heal on the team occurs only when a passive is equipped.
that doesnt necessarily change the possible solutions i mentioned. if you let the tag heal everyone else but the user and let the engine's drain heal the user, the issue where the user's popup gets cut off shouldnt happen id wager. the drain would be unconditional and the resulting party heal would be subject to having the passive, which im assuming is intentional since the skill initially is hp drain. In the end, everyone would only get one popup
if you let the tag heal everyone else but the user and let the engine's drain heal the user, the issue where the user's popup gets cut off shouldnt happen id wager.
So I'm just missing the script that must replace the "forEach(function(member) { member." then ? 😅
So I'm just missing the script that must replace the "forEach(function(member) { member." then ? 😅
no need to replace it, just change the array its working on to not include the user. It could look like this:
Code:
var pourfam = Math.floor(value*0.5);
var allies = user.friendsUnit().aliveMembers();
allies.splice(allies.indexOf(user), 1);

allies.forEach(member => {
    member.gainHp(pourfam);
    member.startDamagePopup();
});
Thank you very much, it works perfectly 😂
no need to replace it, just change the array its working on to not include the user. It could look like this:
Code:
var pourfam = Math.floor(value*0.5);
var allies = user.friendsUnit().aliveMembers();
allies.splice(allies.indexOf(user), 1);

allies.forEach(member => {
    member.gainHp(pourfam);
    member.startDamagePopup();
});
So, what do ".splice()" return ? you used the index of the user, but I don't get the 1 :distrust:
So, what do ".splice()" return ? you used the index of the user, but I don't get the 1 :distrust:
splice has a few uses, but the way it works there is that itll look at a starting index and then remove the specified number of elements from there. without the 1, itll remove every element including and following the starting point
the method already makes the change to the array. if you were to use it as a value for something, itll return the elements removed while the array would only contain what was untouched.
Thanks for the reply, I see how it works in this situation now 😍

Original thread: https://forums.rpgmakerweb.com/threads/yep_buffsstatescore-skillcore-drain-that-heals-team-popups-issue.163559/