Ok, I've been looking into the kevlar add-on code and this is what I think I might be able to use to get that client message.
function Player::Damage( %this, %obj, %pos, %damage, %damageType )
{
if( %this.armored )
{
%this.armor -= %damage * 0.5;
%damage = %damage * %this.armorDivider;
commandToClient( %this.client, 'bottomprint', "\c6Armor\c3:" SPC MCeil( %this.armor ) @ "\c6.", 3, true );
Unfortunately, I have no freakin' idea what's going on here on so many levels. All I know is that it mentions "bottomprint" and "client" which makes it stand out to me. I know if i just paste this into the Doom Armor code that it won't do jack because I think there are variables here that aren't created in the Doom Armor to reference to. Like the "c6" and "SPC" thing. What in sam hill IS all that? I can't tell how much of this is general Torquescript language and what's a variable made up by the coder.
1) that code is essentially correct. what you have copied there however won't work, you're missing other parts of the function:
a) two closing brackets } } are needed to end the if() statement and the function.
b) parent::Damage( %this, %obj, %pos, %damage, %damageType ); needs to be placed there. parent:: ensures that you don't overwrite the damage function. if you leave this out, nobody will ever take damage. you can either put it at the start of the function or the end.
c) replace (%this.armored) with ( %this.getArmorPickupLevel() != 0 )
d) remove %this.armor -= %damage and the line after, they are unnecessary
2) \c6 and SPC are formatting codes, they allow you to format string fields.
a) \c6 is a color code. you put it inside a string to change the color to a set color code. to see what colors are available, go on a singleplayer server and type /colortest in the chat. it will show a bunch of numbers. each number corresponds to the color it represents. so \c6 is white, \c4 is cyan, etc.
b) SPC, @, TAB and NL can all be used in between strings to connect them or separate them. if you want an example, type in the console:
echo("hello" @ "these" SPC "are" TAB "string" NL "operations");
and it should print
hellothese are string
operations
http://docs.garagegames.com/tgea/official/content/documentation/Scripting%20Reference/Introduction/TorqueScript.html#String_Operators:
just as a rule of thumb, variables come in three forms:
%localvariable - a local variable, can only exist in a limited scope. if you put it inside a function, it will exist only inside that function
$globalvariable - a global variable. persists until the game is quit or it is changed.
object.field - a field. is a variable that is attached to an object, kind of like a nametag or something. the armor field used in doom armor pickups is a object field that is attached to players