Analyse show HP Bars
#1
Hey again it's me :O
First, I use a analyse script and I use the CTB by Charlie Fleed.

Now in the CTB there is the feature that Enemy HP Bars are shown if an enemy is killed.

for enemy in $game_troop.enemies
if $game_system.killed_enemies_ids.include?(enemy.id)
enemy.show_hp_bar=true
end

Now I tried to show the HP Bars when the skill Analyse is used. How could I do this? Please help^^
Reply }
#2
I guess you could make your Analyze skill activate a common event in which you use a Call Script command with this: $game_troop.enemies[$scene.active_battler.current_action.target_index].show_hp_bar = true.

In this case, you would have to comment out the part of the code you wrote in your post.
Reply }
#3
Thank you for your answer^^ I tried to paste it in a common event but I get:
SyntaxError occured while running script.

When I paste it in a common event it looks like this:

$game_troop.enemies
[$scene.active_battler.current_action
.target_index].show_hp_bar = true

Maybe that causes the error
Reply }
#4
Yes. The lines are broken in a bad way. You can try something like this:
enemies = $game_troop.enemies
actor = $scene.active_battler
action_t = actor.current_action.target_index
target = enemies[action_t]
target.show_hp_bar = true
Reply }
#5
OK now there is no error but the bars are not there :O
But thank you :D
Reply }
#6
Forgot to ask... what is the scope of your skill ?
Reply }
#7
One Enemy ^^
Reply }
#8
In the Damage and Colors section of the CTB script, starting at line 197 (within the update method), you should find this:
Code:
# Support for HP bars
if HP_BARS and @battler != nil and @battler.is_a?(Game_Enemy) and
$game_system.killed_enemies_ids.include?(@battler.id) and
@battler.show_hp_bar and @battler_visible
Try to remove $game_system.killed_enemies_ids.include?(@battler.id) and. The show_hp_bar flag should only be on when the skill is used, so I guess it's safe.
Reply }
#9
yeah perfect, it works :D Merci infiniment ^^
Reply }
#10
Sorry to bother you again but I realized that it works not perfectly. The problem is, that the bar shows up, but if I attack the enemy the bar is not updated. It keeps filled. Maybe you could help me with that? Oh and also the bar should just show up if I analyze an enemy, not when I kill one.
ty very much^^

EDIT: Oh damn I just realized the scope is one enemy but it analyzes nevertheless every enemy on the field, so the scope is all enemys!!^^
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Scan skill should show states Tumen 5 9,211 05-02-2017, 03:33 AM
Last Post: DerVVulfman
   show variables on screen rpg maker xp ThePrinceofMars 22 33,896 10-19-2014, 08:01 PM
Last Post: ThePrinceofMars
   Damage appears behind bars in battle prioran 3 7,544 08-06-2011, 01:46 AM
Last Post: prioran
   VX Show Picture Event Command Code? PK8 2 6,364 02-27-2009, 11:30 PM
Last Post: PK8



Users browsing this thread: 3 Guest(s)