Low Caliber Forum
BroadcastMessage, Colors, and storing variables to .TXT

This topic can be found at:
http://lowcaliber.com/eve/forums/a/tpc/f/3886011002/m/7406090824

Mon September 15 2003, 11:10 PM
Methril
BroadcastMessage, Colors, and storing variables to .TXT
Alright I have a few questions and I would like to know if anyone can help me. Ive been working on a small stats mutator, and This is what I have so far. I left out all the properties and junk so that you could see the code Im focusing on. Also, I would like to know how to store record variables into a text file so that I can keep track of people's stats.
==================================================
local RunePlayer Player;
local string PlayerName;
local float Score;
local float Deaths;
local int HeadKills;
if(Other.IsA('RunePlayer'))
{
Player = RunePlayer(Other);
PlayerName = Player.PlayerReplicationInfo.PlayerName;
Score = Player.PlayerReplicationInfo.Score;
Deaths = Player.PlayerReplicationInfo.Deaths;
HeadKills = Player.PlayerReplicationInfo.HeadKills;

BroadcastMessage(" Stats for "$PlayerName$" ");
BroadcastMessage(" Kills: "$Score$" Deaths: "$Deaths$" ");
BroadcastMessage(" Decapitated Enemys: "$HeadKills$" ");
==================================================Now, there are a few things bothering me about it. For one, it is all in default red. Does anyone know how to,
a. make it a runemessage.
b. reposition the text.
c. colorize the text.

The only other thing I really want to change is how when used, Deaths and Score return numbers with a lot of decimal places! Anyways, if anyone has anything to comment on or add, It would be appreciated.
Tue September 16 2003, 12:23 AM
Unter den Uebrigen
Originally posted by Methril:
Does anyone know how to, a. make it a runemessage. b. reposition the text. c. colorize the text.
BroadcastMessage takes two optional parameters in addition to message text:
BroadcastMessage(coerce string Msg, optional bool bBeep, optional name Type)
The following, therefore:
BroadcastMessage("Stats for" @ PlayerName, false, 'Subtitle');
would produce a white, beepless message at the bottom of the screen.  There are fourteen message types with distinct color and placement:If you want absolute control over the spacing and color, take a closer look at the function LocalizedMessage contained in RuneHUD.uc on line 592; you would do well to specify your own type and the means to interpret it.


Tue September 16 2003, 11:30 AM
Methril
Thank you very much Unter!