Check state's turn left?

Hi, how can i check how many turn is left for a state on enemy in Battle? (by script call)
=D please help
Insert a snippet
Code:
class Game_Battler
  attr_reader :state_turns
end
Then you can use it like (pick whichever based on your need)
Code:
$game_actors[id].state_turns[state_id]
$game_party.members[index].state_turns[state_id]
$game_troop.members[index].state_turns[state_id]
Insert a snippet
Code:
class Game_Battler
  attr_reader :state_turns
end
Then you can use it like (pick whichever based on your need)
Code:
$game_actors[id].state_turns[state_id]
$game_party.members[index].state_turns[state_id]
$game_troop.members[index].state_turns[state_id]
Hm awesome!! Just like that? 😮 Does that mean if i write:
attr_reader :[local variable name]
then i can access that local variable the same way?
(state_turns was a local var right?)
That's much better solution compare to this =|
Code:
class Game_Battler
  def state_turns(stateId)
    @state_turns[stateId]
  end
end
Thanks @TheoAllen . By the way i want to ask another thing.
Is there a script snippet to check for what attributes are available for a specified object?
For example, i want to check what attributes is available for a state object on actor (ex: id)
but the only way i know is to do a Global Search for "state." and it doesn't work very well.
Is there a script snippet to check for what attributes are available for a specified object?
Read help file
Screenshot_910.jpg
Read help file
😮 oh god! Yes, that's the first thing i should do. Sighhh =D Thank you

Original thread: https://forums.rpgmakerweb.com/threads/check-states-turn-left.108369/