Author Topic: health damage indicator  (Read 1305 times)

Bio

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
health damage indicator
« on: May 01, 2011, 10:43:10 pm »
How to start for writing a red flash when taking health damage? And red strobe flashing when 5hp or less.

Orpheus

  • Newbie
  • *
  • Posts: 49
  • Karma: +1/-0
  • Music is a way of life.
    • View Profile
    • Orphtown UK
Re: health damage indicator
« Reply #1 on: May 02, 2011, 11:44:58 am »
I hope you mean Pulsing/pulsating and not stobe :P as a Strobe is a constant flashing, which would make most people rage :P
But anyhow! I was looking into this, and how it can be achieved, as I intend a similar thing for my own server, My current recommendation would be to use the GUI features.

For instance, for the on hit have a timer run to make it show a semi transparent rad image over the entire screen.

Code: [Select]
//create the image at the top of the script
g_GUIRedHit <- GUISprite( "GUIRedHit .png", VectorScreen(0,0) ); // Make sure this Image is plenty big enough to cover the screen.
Code: [Select]
function onPlayerHealthChange (oldhp, newhp)
{
    //Then set a timer to remove it
    g_GUIRedHit.Visible = true
    NewTimer( "RemoveGuiHit", 500, 1);
}

Code: [Select]
function RemoveGuiHit()
{
     g_GUIRedHit.Visible = false
}

Or something Like this. I have yet to write mine as I'm working on re-Writing my whole scripts.
Hope this helps
Regards Orpheus

Windows: A 64-bit/32-bit extension to a 16-bit GUI on an 8-bit OS written for a 4-bit architecture by a 2-bit company who can not stand 1-bit of competition.

 

© Liberty Unleashed Team.