Hey y'all, so I've been testing out a few new abilities and stumbled upon an issue. The skill in particular has the following code:
After trying out a few different versions of the code, I got the ability to work. But when I choose the "none" option on the scope menu, the ability stops working. However, it works with any other scope, including when setting the scope to the enemy. Now, I guess this isn't a big problem as I can easily just use another scope but I'm not sure what's the cause of this. I'm thinking maybe the "none" scope has some unique properties but I couldn't find any explanation about it through Google. Does anyone know why this is the case?
Aside from this, I have two more questions:
1)
This was the initial way that I tried, but I got the error element.lifeBloom is not a function.
Above example is something I use elsewhere, and it works. So, my question is why does one work and the other doesn't? My guess is that a dot function has to be defined as a property of an object and the function I defined is global? I may be completely making this up, so I'd appreciate some clarification.
2)
My second question is, am I overcomplicating this? Do I even need to define a function, or can I do what the function does inside the forEach method? Is there a way easier method to do what I'm trying to do?
JavaScript:
<Before Eval>
function lifeBloom(actor) {
if ( actor.isStateAffected(35))
actor.gainHp(10);
actor.removeState(35);
}
$gameParty.members().forEach(element => lifeBloom(element));
</Before Eval>
After trying out a few different versions of the code, I got the ability to work. But when I choose the "none" option on the scope menu, the ability stops working. However, it works with any other scope, including when setting the scope to the enemy. Now, I guess this isn't a big problem as I can easily just use another scope but I'm not sure what's the cause of this. I'm thinking maybe the "none" scope has some unique properties but I couldn't find any explanation about it through Google. Does anyone know why this is the case?
Aside from this, I have two more questions:
1)
JavaScript:
$gameParty.members().forEach(element => element.lifeBloom(element));
This was the initial way that I tried, but I got the error element.lifeBloom is not a function.
JavaScript:
$gameParty.members().forEach(actor => actor.removeState(35));
Above example is something I use elsewhere, and it works. So, my question is why does one work and the other doesn't? My guess is that a dot function has to be defined as a property of an object and the function I defined is global? I may be completely making this up, so I'd appreciate some clarification.
2)
My second question is, am I overcomplicating this? Do I even need to define a function, or can I do what the function does inside the forEach method? Is there a way easier method to do what I'm trying to do?