Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Lower health causes heart problems.
Lower health causes heart problems.
2004-09-08, 10:11 PM #1
Attached is my custom kyle cog. I would like it if someone could make it so that if the players health goes under 10 points then the screen tints red every 0.8 seconds and a heartbeat sound plays every 0.8 seconds. Like in some computer games. also when you get over 10 it goes back to normal.

Thanks
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-08, 10:14 PM #2
O poop soup forgot the attachment.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-09, 12:23 AM #3
It's not too hard, I think. A pulse message like this one should do it:
Code:
pulse:
   if(GetThingHealth(GetLocalPlayerThing()) < 10)
   {
      // Screen FX using NewColorFx or however this verb is called
      // Heartbeat using PlaySoundLocal or some other sound verb
   }
   Return;

Of course, you'd also have to add the message in the symbols section, start the pulse in the startup message using SetPulse(0.8), and so on.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-09-09, 1:33 AM #4
Thanks zagibu that was very helpful, my heartbeat thing is working now.
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-09-09, 5:08 AM #5
I did a pretty cool thing similar to this a long time ago. I had it play the heartbeat sound faster the lower your health was. If you had 2% health it would be thumping really fast.
-El Scorcho

"Its dodgeball time!" -Stormy Waters
2004-09-09, 9:38 AM #6
To do this you could modify above code like this:
Code:
player = GetLocalPlayerThing();
if(GetThingHealth(player) < 10)
{
   AddDynamicAdd(player, 120 + (1 / (GetThingHealth(player) + 0.01)) * 100, 0, 0);
   PlaySoundLocal(sound, 1 - GetThingHealth(player) / 20, 0, 0x4);
   SetPulse(0.3 + (GetThingHealth(player) / 20));
}

Untested.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

↑ Up to the top!