MZ Passive aura's

So I'm trying to create a passive aura for characters. Those passives will give the whole party a boost but the passive should only work when the specified party member is in the main party and not in the sub party.
I'm using Skillstatescore from visustella are a plugin now. When I try to run it. It crashes so the script doesn't work I think but I have no idea how to try to have the actor as a main party member condition this is what I use right now... The 17 refers to the 17th actor in my list.


<JS Passive Condition>

BattleManager.allBattleMembers().contains($gameActors.actor(17));

condition = true

</JS Passive Condition>
RangeError: Maximum call stack size exceeded
at Game_Actor.Game_BattlerBase.<computed>.<computed> (VisuMZ_0_CoreEngine.js:6816)
at Game_Actor.Game_BattlerBase.<computed>.<computed> (VisuMZ_1_ElementStatusCore.js:3319)
at Game_Actor.Game_BattlerBase.initMembers (VisuMZ_1_BattleCore.js:15748)
at Game_Actor.Game_BattlerBase.<computed>.initMembers (VisuMZ_1_SkillsStatesCore.js:2300)
at Game_Actor.Game_Battler.initMembers (rmmz_objects.js:3296)
at Game_Actor.initMembers (rmmz_objects.js:4029)
at Game_Actor.Game_BattlerBase.initialize (rmmz_objects.js:2623)
at Game_Actor.Game_Battler.initialize (rmmz_objects.js:3292)
at Game_Actor.initialize (rmmz_objects.js:4024)
at new Game_Actor (rmmz_objects.js:4010)

Keeps spamming this in my devtool.
This can sometimes happen when you check for an actor during that actors creation. (In this case, because the creation process is not yet completed, the game gets stuck trying to create new copies of the actor).

You could try to escape that by adding a check if the actor is already created:
Code:
<JS Passive Condition>
if ($gameActors._data[this.actorId()]) {

   condition = $gameParty.battleMembers().contains($gameActors.actor(17));

}
</JS Passive Condition>
(Although this might not work with actor-cloning plugins or similar addons that allow for more actors).

BattleManager.allBattleMembers() (= combined party and enemy troop members) includes your non-battle-party while you are not actually in battle. Since you are only checking for actors and not enemy troop members I'd suggest using $gameParty.battleMembers() instead.

Hope this helps in some way. 🙂
This can sometimes happen when you check for an actor during that actors creation. (In this case, because the creation process is not yet completed, the game gets stuck trying to create new copies of the actor).

You could try to escape that by adding a check if the actor is already created:
Code:
<JS Passive Condition>
if ($gameActors._data[this.actorId()]) {

   condition = $gameParty.battleMembers().contains($gameActors.actor(17));

}
</JS Passive Condition>
(Although this might not work with actor-cloning plugins or similar addons that allow for more actors).

BattleManager.allBattleMembers() (= combined party and enemy troop members) includes your non-battle-party while you are not actually in battle. Since you are only checking for actors and not enemy troop members I'd suggest using $gameParty.battleMembers() instead.

Hope this helps in some way. 🙂
It works thanks!
Moved to: Plugin Support

Double-post notice: @tinkie99

Original thread: https://forums.rpgmakerweb.com/threads/passive-auras.136555/