Cutstuff Forum

Mega Man 8-bit Deathmatch => Tutorial Collection => Topic started by: Joseph Collins on August 27, 2013, 07:42:17 PM

Title: [Scripting] Alias to Announce Current Health?
Post by: Joseph Collins on August 27, 2013, 07:42:17 PM
I'm really irritated that I couldn't figure this out on my own, given the resources available, but... how do I make a script that tells my team mates (or everyone in the room) my current health?  I just can't seem to get Zandronum to read my health, convert the variable into a printable text string.  In other words, I want to be able to press a key on the keyboard and have something like this display to everyone:
Quote
Me: I currently have 82 Life Energy.
How is this done?  I've seen others use it, but I never bothered to ask about it.  I couldn't find anything remotely helpful in my browsing of the web.  It doesn't have to be fancy or anything, though something that changes the health color to reflect how badly I need health would be a nice bonus.

Thanks in advance.
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Russel on August 27, 2013, 07:45:14 PM
The code used is $health.
But in order to tell the game to translate to actually be the current health, you want to set the variable chat_substitution to 1 via the console.
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Ceridran on August 27, 2013, 07:46:09 PM
I believe you had to type "sv_chat_substitution 1", or just "chat_substitution 1" and then saying $health, $ammo, $ammocount, $armor, $weapon, etc, would work.

Lego got it.
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Russel on August 27, 2013, 07:50:51 PM
sv_chat_substitution isn't a thing, silly :ugeek:
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Ceridran on August 27, 2013, 07:51:50 PM
The last time I used it was something like last year, so I don't even remember it that well.
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Russel on August 27, 2013, 07:54:11 PM
I used it once ever.

After making the post I used ctrl+f in my ini file to make sure I was correct.
Title: Re: [Scripting] Alias to Announce Current Health?
Post by: Joseph Collins on August 27, 2013, 08:31:58 PM
I knew... I absolutely knew... it was something stupidly simple like that.  Gah!

It's working perfectly.  Thank you very much.  >_<