Check state's turn left?

BlueMage

Slime Lv99
Veteran
Joined
Apr 13, 2019
Messages
116
Reaction score
149
First Language
English
Primarily Uses
RMVX
Hi, how can i check how many turn is left for a state on enemy in Battle? (by script call)
=D please help
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
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]
 

BlueMage

Slime Lv99
Veteran
Joined
Apr 13, 2019
Messages
116
Reaction score
149
First Language
English
Primarily Uses
RMVX
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? :o 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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top