i just wanna know a script call to access the number of stacks of a particular status effect since i want to make the poison from slay the spire (does n damage then removes a stack at the end of the turn n= number of stacks)
Viewing post in RPG Maker MV: State Stacker comments
$gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id).length
- $gameParty.battleMembers() is the function call to get the battle members
- $gameParty.battleMembers()[member_index] specifies a battle member, member_index must be a number (begins at 0 for first member)
- $gameParty.battleMembers()[member_index]._states gives the states for that member in ID form
- $gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id) filters the states and returns an array that meets the required ID. req_state_id must be a number
- $gameParty.battleMembers()[member_index]._states.filter(state_id => state_id == req_state_id).length gives the number of states in the array
I recommend you learn array filter going forward before continuing.