Health Bar

Posted by Adam Petersen on Fri 25 Apr 2003 09:40 PM — 13 posts, 50,080 views.

#0
Can someone please make a Health and mana bar for like the side of the screen in a plugin?
#1
The info bar can only be mounted in the top or bottom of MushClient I believe. From what I understand, this is a limitation of code that Nick doesn't have any direct access to changing, only using what he's given.
#2
I dont care were it is, as long as it is there!
Australia Forum Administrator #3
See Plugins - Health Bar entry.
#4
Is there a way to make the Health bar more accurate? (ie, changing when I've lost 1/50 of my health instead of every 10th?)
Australia Forum Administrator #5
I think the 3 places you would change in the plugin are (in bold here) ...




  pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 50)

'
'  Below 20% warn by using different colour
'

  if pc < 10 then
    InfoColour sBadColour
  else
    InfoColour sGoodColour
  end if

'
'  Draw active part of gauge
'
  for count = 0 to pc
    Info "g"
  next  

'
'  Draw rest of gauge in grey (ie. unfilled bit)
'

  InfoColour "dimgray"
  while count <= 50
    count = count + 1
    Info "g"
  wend
USA #6
If you nose a round you may find a script called HSLtoRGB. This can be used to make something more visually accurate by letting you recalc the color, brightness and purity (amount of grey) in the color you use to show your current health on the bar. However, I made one attempt to create a font that was only one pixel wide to use for producing such a bar with far better accuracy. Either the code for the bar won't support .FON fonts, or I messed something up in the font. Unfortunately I don't know of any super-thin .TTF fonts, which is what you would need to use in place of the existing one to make it more accurate. In theory, 0-100 could be any multiple of 100 dots, so a computer using 640x480 could show close to a 0-600 range, 'if' you could find a font thin enough to only display one pixel wide and not have any spaces around it.

The reason you can't manage this is that most fonts are 10x8 or 12x10, etc. So with 10 positions you are looking at 100-120 lines. With 50 it is 500-600 lines or the entire bar on a 640x480 display. For something like 1024x768 you can do much better, but only by having the client maximized, which I think looks silly, since half your output window is unused. So yes, you could change it in the DoGauge script itself to use 50 steps, but the result isn't very useful unless you can also shrink the width of the lines. But since changing the width also makes them shorter, you would have, say with an 8x6 font, a line that was 6 dots all and 400 long. It would take up nearly the entire infobar and end up being hard to see besides. :(
#7
What would I do if I wanted to change the bar from using the webdings box to that line above the enter key?
Australia Forum Administrator #8
Remove the line where it switches to WebDings font, and change:


Info "g"

to

Info "|"

in 2 places.
#9
Is there a way to get rid of those spaces in between the lines when I change it to the line?
Australia Forum Administrator #10
That was why I chose the Webdings font - that font is designed to be used as graphics, and the letters run into each other. If you choose a normal font, then it is designed to keep letters apart so you can read them.

All I can suggest is experiment with different fonts, like Webdings or Symbol (or similar) until you find a suitable character that draws a short line.
#11
Ah, Arial Narrow's line works...
Australia Forum Administrator #12
See Super Health Bar for my attempt to do a better job.