Main Menu
  • Welcome to The RPG Maker Resource Kit.

A Monster HP Script.

Started by JJ_Legend, January 17, 2006, 06:10:41 AM

0 Members and 2 Guests are viewing this topic.

JJ_Legend

Does any one have a Script where it shows the monsters HP. On the default battle system. I don't need the Side-by-Side Battle system. Just the Default one.

Thanks in advance,

JJ  :)

SiR_VaIlHoR

i've make a topic with an item analyser if u're interesting tell me
I'm the Alpha and the Omega, the First and the Last, the Beginning and the End.

http://qualquek.miniville.fr/
http://www.dailymotion.com/bookmarks/ojah/video/x27l78_jake-simpson-stevie-wonder-isnt-she_music

My padawan (Tsunokiette) and me :p
http://www.team-aaa.com/root/profile.php?enter_id=614556
http://www.esl.eu/fr/player/2609080/
I'm French so forgive my bad english!

ahref

you mean an add-on to the original script to show the enemy hp..ok

describe where you want it to be positioned and then somebody might be able to help you

JJ_Legend

Well, Above the Enemy Would be appropriate. Please

ahref

points to sig im learning ruby at the moment i can edit scripts and advise people on how to word there request but i hav no idea yet

dwarra


ahref

here we go if you dont have a rmxp account:

someone else made this not me i might edit it to be above the monster but later he....

Ok here's the script read carefully:

in Window_Base add:


def draw_enemy_hp_meter(enemy, x, y, width = 156, type = 0)
 if type == 1 and enemy.hp == 0
   return
 end
 self.contents.font.color = system_color
 self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255)) #0, 0, 0, 255
 self.contents.fill_rect(x, y+28, width * enemy.hp/ enemy.maxhp,4, Color.new(0, 100, 155, 255)) #0, 255, 255, 255
end


Make a new window under window_battlestatus and add:


class Window_EnemyBar < Window_Base
#Thanks to rpgmaker for helping me with the x and y placements.
#--------------------------------------------------------------------------
# ● ã,ªãƒ–ã,¸ã,§ã,¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
 super(0, 0, 640, 480)
 self.z = 9998
 self.contents = Bitmap.new(width - 32, height - 32)
 self.contents.font.name = $fontface
 self.contents.font.size = $fontsize
 refresh
end
#--------------------------------------------------------------------------
# ● è§£æ"¾
#--------------------------------------------------------------------------
def dispose
 super
end
#--------------------------------------------------------------------------
# ● リフレッã,·ãƒ¥
#--------------------------------------------------------------------------
def refresh
 self.contents.clear
@item_max = $game_troop.enemies.size
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy = $game_troop.enemies[0]
draw_enemy_hp_meter(enemy, enemy.screen_x - 75, enemy.screen_y - 40, 120)
  self.contents.font.color = brightgray_color
self.contents.draw_text(enemy.screen_x - 90, enemy.screen_y - 25, 100, 32, "HP:")
self.contents.draw_text(enemy.screen_x - 20, enemy.screen_y - 25, 100, 32, enemy.hp.to_s + " /  ")
self.contents.draw_text(enemy.screen_x, enemy.screen_y - 25, 100, 32, " " + enemy.maxhp.to_s)
end
if enemy = $game_troop.enemies[1]
draw_enemy_hp_meter(enemy, enemy.screen_x - 75, enemy.screen_y - 40, 120)
    self.contents.font.color = brightgray_color
  self.contents.draw_text(enemy.screen_x - 90, enemy.screen_y - 25, 100, 32, "HP:")
  self.contents.draw_text(enemy.screen_x - 20, enemy.screen_y - 25, 100, 32, enemy.hp.to_s + " /  ")
self.contents.draw_text(enemy.screen_x, enemy.screen_y - 25, 100, 32, " " + enemy.maxhp.to_s)
end
if enemy = $game_troop.enemies[2]
draw_enemy_hp_meter(enemy, enemy.screen_x - 75, enemy.screen_y - 40, 120)
    self.contents.font.color = brightgray_color
  self.contents.draw_text(enemy.screen_x - 90, enemy.screen_y - 25, 100, 32, "HP:")
  self.contents.draw_text(enemy.screen_x - 20, enemy.screen_y - 25, 100, 32, enemy.hp.to_s + " /  ")
self.contents.draw_text(enemy.screen_x, enemy.screen_y - 25, 100, 32, " " + enemy.maxhp.to_s)
end
end
 
 end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
  end


In Winow_Base where you see the colors defined add:


def brightgray_color
  return Color.new(200, 200, 200, 255)
end


in Scene_Battle 1 (Thanks to rpgmaker for helping me along with this)
add


  @enemy_window = Window_EnemyBar.new
  @enemy_window.opacity = 0
  @enemy_window.back_opacity = 0


in the disposes add:


@enemy_window.dispose


same with the updates add:


@enemy_window.update


Now search for the line


@status_window.refresh


and add:


@enemy_window.refresh


Do this in scene battler 2 (There should only be one)
and 3 in scene battler 4

and that's it.

Any probs let me know.

Shinami

Sorry to ask but how does one make the actual script work?

ahref

im sorry im drugged up on stuff for my cold ill post them on my previous post

JJ_Legend


VampireHSS

I've done that and when I try to test the game a message appears saying:
?????'Window_EnemyBar'?50??? SyntaxError ????????
<3 phenom
<3 Hypnotic

JJ_Legend

Indeed, Me too. VampireHSS and Me and Some other people are making a game.

ahref

can you give me the line that it is on i may be able to fix it if not i shall post a message to the creator on your behaf

VampireHSS

It appears when I try to start the game, it doesn't say anything else, do you want a screenshot from it?
<3 phenom
<3 Hypnotic

jasonorme666

any chance of a working enemy hp script?

dwarra

It does work. Test your game. When you get the error, go to the script editior and find the line. Most chances are its a line with the line $fontsize.

Just change it to 22.

VampireHSS

How do I know which of the "categoryes" is the error?
How do I know the line of the error?
<3 phenom
<3 Hypnotic

JJ_Legend

Could you post the script with the enlarged line ? Please

VampireHSS

<3 phenom
<3 Hypnotic

JJ_Legend

Can somebody please post this Completed !!!

Dalton

Okay! To find your problem do play test, you get the error now go to the script manager and POOF! You're at the errored line.

Now according to how I read your error, you did not follow the instructions of the script, so I suggest you do it properly before complaining again.

noian

Edit: It works now except for this line in the script:
bitmap=RPG::Cache.picture("limit_gradient")
Where do I get this?(because it says that it can't find it when I start a battle)
>Current Project: Time Killer 2<
Description: Random, plotless project designed to kill spare time. No storyline, just a building to explore.

Status: Fascinated by how appalling the default database is balance wise.

Tsunokiette

Quote from: noianEdit: It works now except for this line in the script:
bitmap=RPG::Cache.picture("limit_gradient")
Where do I get this?(because it says that it can't find it when I start a battle)

considering it's called 'limit_gradient' I'm guessing it has absolutely nothing to do with  the monster Hp bar script and has to do with the fact that you didn't get the image from the same place you found the
limit-break/limits/overdrive/etc. script.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

noian

i can get the bar to show no but can't get the Monster HP words to show
>Current Project: Time Killer 2<
Description: Random, plotless project designed to kill spare time. No storyline, just a building to explore.

Status: Fascinated by how appalling the default database is balance wise.