I have made a skill that executes a script through Yanfly's ActionBeginEnd plugin.
It targets everyone in the enemy party and has a different effect on each member based on what state they are currently affected by.
It's an "if" that checks the member and their condition
"(($gameTroop.members()[0].isStateAffected(15)) {..."
and is followed by many "else if's" with the same setup but with different effects and state and member "id's."
So i have a copy paste of the same script 8 times to have a different effect on a maximum of 8 possible members in a troop.
The skill still works on a troop with fewer members than the script addresses but every time i use it, it will bring up an error
about how it can't check the state affected of the non-existent troop.
It is not an issue when the game is deployed, the skill does what I need it to, I'm just trying to find a way to get it to ignore the unnecessary part of the script that causes the error popup during play testing.
Now about $gameTroop.aliveMembers().length > 0
I assume that this counts how many members exist in the enemy troop.
but my script doesn't count members, it refers to them by their ID in that fight from 0-7.
This is where i'm not so sure how to use this. My scripting knowledge is pretty close to nothing.
If let's say the member with ID of 3 is defeated, would the member with ID 4 become ID 3?
If that isn't the case, is there a script that could be used to check the existence of troop members specifically
maybe something that might look like this?
$gameTroop.aliveMembers()[#]
Thank you to anyone that can help me out.
It targets everyone in the enemy party and has a different effect on each member based on what state they are currently affected by.
It's an "if" that checks the member and their condition
"(($gameTroop.members()[0].isStateAffected(15)) {..."
and is followed by many "else if's" with the same setup but with different effects and state and member "id's."
So i have a copy paste of the same script 8 times to have a different effect on a maximum of 8 possible members in a troop.
The skill still works on a troop with fewer members than the script addresses but every time i use it, it will bring up an error
about how it can't check the state affected of the non-existent troop.
It is not an issue when the game is deployed, the skill does what I need it to, I'm just trying to find a way to get it to ignore the unnecessary part of the script that causes the error popup during play testing.
Now about $gameTroop.aliveMembers().length > 0
I assume that this counts how many members exist in the enemy troop.
but my script doesn't count members, it refers to them by their ID in that fight from 0-7.
This is where i'm not so sure how to use this. My scripting knowledge is pretty close to nothing.
If let's say the member with ID of 3 is defeated, would the member with ID 4 become ID 3?
If that isn't the case, is there a script that could be used to check the existence of troop members specifically
maybe something that might look like this?
$gameTroop.aliveMembers()[#]
Thank you to anyone that can help me out.