RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
A Monster HP Script.

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 89
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  :)

****
Rep:
Level 91
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!

*
Resident Cloud
Rep:
Level 91
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

**
Rep: +0/-0Level 89
Well, Above the Enemy Would be appropriate. Please

*
Resident Cloud
Rep:
Level 91
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

*****
Rep:
Level 91
Thanks For Coming
Its below the enemy, but im sure its useful for you.

http://www.rmxp.net/forums/index.php?showtopic=6647&hl=enemy+hp

*
Resident Cloud
Rep:
Level 91
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:

Code: [Select]

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:

Code: [Select]

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:

Code: [Select]

 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

Code: [Select]

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


in the disposes add:

Code: [Select]

@enemy_window.dispose


same with the updates add:

Code: [Select]

@enemy_window.update


Now search for the line

Code: [Select]

@status_window.refresh


and add:

Code: [Select]

@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.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
Sorry to ask but how does one make the actual script work?

*
Resident Cloud
Rep:
Level 91
im sorry im drugged up on stuff for my cold ill post them on my previous post

**
Rep: +0/-0Level 89
Thanks Alot.

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

**
Rep: +0/-0Level 89
Indeed, Me too. VampireHSS and Me and Some other people are making a game.

*
Resident Cloud
Rep:
Level 91
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

**
Rep:
Level 89
Developer
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

**
Rep: +0/-0Level 90
any chance of a working enemy hp script?

*****
Rep:
Level 91
Thanks For Coming
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.

**
Rep:
Level 89
Developer
How do I know which of the "categoryes" is the error?
How do I know the line of the error?
<3 phenom
<3 Hypnotic

**
Rep: +0/-0Level 89
Could you post the script with the enlarged line ? Please

**
Rep:
Level 89
Developer
please dwarra
<3 phenom
<3 Hypnotic

**
Rep: +0/-0Level 89
Can somebody please post this Completed !!!

***
Rep:
Level 90
~
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.

**
Rep: +0/-0Level 89
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.

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
Quote from: 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)


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."

**
Rep: +0/-0Level 89
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.