- Joined
- Mar 4, 2016
- Messages
- 2
- Reaction score
- 0
- First Language
- English
- Primarily Uses
I've been having a really tough time with a basic enemy HP and MP "scan" script. I've tried Yanfly Engine Ace - Enemy Target Info, but it's actually way too fancy for what I want. I just want to have an actor use a skill that shows whatever enemy he/she targets' current HP and MP. I think I'm close.
Right now, I've got a skill that adds a state to the target called "Revealed". The index of the state is '026' in my game.
The skill also calls a common event which has a script that sets two game variables, which I then display in a battle text window. Here's the common event:

The script text I have (which is also in the image) is:
$game_troop.members.any? { |m| m.state?(26)$game_variables[5] = m.name$game_variables[6] = m.hp$game_variables[7] = m.mp}
I'm not very good with Ruby, but my understanding is that this script is supposed to check to see if *any* enemy in a troop has the state 'revealed' (index 26) applied to it, and then set my game variables with that target's name, and current hp and mp. The problem is though that no matter which enemy in a troop larger than one that I target, it always only returns enemy A's hp and mp.
Can someone point out what stupid thing I may be doing here?
Thank you!!!
Right now, I've got a skill that adds a state to the target called "Revealed". The index of the state is '026' in my game.
The skill also calls a common event which has a script that sets two game variables, which I then display in a battle text window. Here's the common event:

The script text I have (which is also in the image) is:
$game_troop.members.any? { |m| m.state?(26)$game_variables[5] = m.name$game_variables[6] = m.hp$game_variables[7] = m.mp}
I'm not very good with Ruby, but my understanding is that this script is supposed to check to see if *any* enemy in a troop has the state 'revealed' (index 26) applied to it, and then set my game variables with that target's name, and current hp and mp. The problem is though that no matter which enemy in a troop larger than one that I target, it always only returns enemy A's hp and mp.
Can someone point out what stupid thing I may be doing here?
Thank you!!!

