Author Topic: [REQ] Chat/kill message hud - Half-life style  (Read 23730 times)

Posts

  • Posts: 19
  • Turrets: +6/-2
[REQ] Chat/kill message hud - Half-life style
« on: August 30, 2008, 04:07:26 am »
In summary it's half-life chat/kill messages. After having played half-life for many years i find switching to quake style to be intolerable.

*Chat messages and kill messages appear in different boxes. (right now its a spam box, kills push chat out, kill messages cry wolf, real chat message comes by, i don't read it)

Chat:
*Messages linger for 10 seconds. (i'm in combat for a few seconds, die, now i can read chat)
*Team color, no custom colors (when the person talking as if we know what team he is on
*Chat box is left side, 30% from bottom. (doesn't matter where, just that it has its own space)

Kill:
*no long sentence fluff, it should look like the bellow
  Bob --o) John
(killer weapon victim)
*weapon is a solid color picture/sprite
*Team color, no custom colors
*If same killer and same weapon for multiple kills, the messages should line up, victim names should screw it up
(i want my brain to quickly parse this info, most of the time i just want to know what team is killing, what weapon, and if someone just killed 5 people at once i want to know it)
*Top right

Other messages:
* put it up top (don't even risk contaminating my precious chat messages)

http://games.softpedia.com/screenshots/9-495_2.jpg
http://ob81.com/wp-content/uploads/2007/07/counterstrike.jpg
http://content.ytmnd.com/content/8/0/4/8047b736448e13783e50444d7472db13.jpg

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #1 on: August 30, 2008, 05:59:59 am »
Go ahead and code it!

∧OMG ENTROPY∧

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #2 on: August 30, 2008, 06:26:54 am »
Personally I've always interpreted that "emoticon" support in SVN cgame/ui to mean we're headed in the
dude1 :dretch: dude2
killmessage direction, but the devs could have something else in mind.

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #3 on: August 30, 2008, 09:02:14 pm »
I rather like this idea, but I have one thing to add to it: Enemy deaths should be written in green, team deaths in red. That way at a glance you can see which team is suffering losses, without having to check the names/icon. This is done in MoH, and it's very handy, since you don't even have to really look at the messages to know what's going on.

Lava Croft

  • Guest
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #4 on: August 31, 2008, 03:21:45 pm »
Please do not make the obituaries look like a goddamn rainbow. The less colours the better, certainly considering the amount of colours people tend to put in their nicknames.

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #5 on: August 31, 2008, 03:27:13 pm »
No, my point is that it would display the entirety of the text (names included) in one of only two colours, none of these silly multicoloured names. Although it may still look a little like an episode of Ready Steady Cook...

Snake

  • Posts: 541
  • Turrets: +43/-110
    • IdeaShock
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #6 on: August 31, 2008, 05:01:31 pm »
This is what i have to say to you.

#10


In the memory of playa1 :'(

Note1:We dont accept that kind of requests here, if you want something, go code it urself or pay someone to do it.

Note2: THIS IS NOT HALF-LIFE.
.

Posts

  • Posts: 19
  • Turrets: +6/-2
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #7 on: August 31, 2008, 06:22:01 pm »
This is what i have to say to you.

#10


In the memory of playa1 :'(

Note1:We dont accept that kind of requests here, if you want something, go code it urself or pay someone to do it.

Note2: THIS IS NOT HALF-LIFE.
snake:

so if i left out "half-life" all would be ok? i gave enough details and reasoning not to need "half-life"

"We dont accept that kind of requests here"
You sound like you have authority on your side, it sounds as if your speak for the devs/mods
1. I already checked all the stickied threads, searched the forums, please cite an authority, you already went through the effort of citing something unhelpful that has already been spammed all over the place.
2. two moderators have already commented, you are not a moderator, on internet back seat moderation is generally frowned at, some forums even have rules against it, "you must be new to the internet" :P
3. the thread you cited lacks authority and quality.

Your post
1. sounds like "me too! me too!", on many forums you'll find rules against this, a mod has already said "Go ahead and code it!"
2. "me too" in terms of that "#10" thread being cited over and over in this forum, yet it lacks the relevance and quality to be spammed.
3. restating the obvious, "THIS IS NOT HALF-LIFE.", "this is not" might be deserved in cases where the feature request obviously conflicts with the goals of tremulous, but this is not the case, unless you have some sort of speech to give on how the quake HUD is superior in its own way.

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #8 on: August 31, 2008, 06:37:37 pm »
Also #10 is meaningless in the Mods Section...

Snake

  • Posts: 541
  • Turrets: +43/-110
    • IdeaShock
Re: [REQ] Chat/!ban nub - dis isnt halflief
« Reply #9 on: August 31, 2008, 08:55:24 pm »
Actually, you didnt readed all the stickys, as you should know, Tremulous 1.2 will be coming out soon, and the requests and all these stuff are going up in this thread:

http://tremulous.net/forum/index.php?topic=8389.0

I know the process is slowly but it takes time.

And me, as a coder, knows that is gay that the people thinks that have authority over you without even do anyother contribution to the community like a donation or help doing mods and stuff for the tremulous community. Maybe you arent a coder, but "If you want something, first you have to do something better for earn it" you just cant come and say, oh yeah, make trem fer me(instead that you giv teh munyz), we maybe i'm not part of the official tremulous coders but i have some projects running arround tremulous.

and about

Also #10 is meaningless in the Mods Section...

who said that?

PS: It is also some kind of the 10c.

PS2: This still is not half-life or something related to it.
« Last Edit: August 31, 2008, 09:01:01 pm by Snake »
.

epsy

  • Posts: 205
  • Turrets: +8/-25
    • Armagetron Advanced!
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #10 on: September 01, 2008, 12:19:06 am »
i like plain messages for kills, i would even want moar D:
Warning: All opinions expressed in my posts are mine and mine alone. Any connection to any group I am affiliated with - be it the ArmagetronAd Developers or any other group, is purely coincidental unless otherwise expressly stated. Don't be a dolt when you read my posts, as they *may* require some brainpower and thinking (also purely coincidental). Any opinion in my posts not expressed by me are purely figments of your imagination and will be dealt with accordingly.
SigTemplate by Khasla.

mooseberry

  • Community Moderators
  • *
  • Posts: 4005
  • Turrets: +666/-325
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #11 on: September 01, 2008, 09:18:57 am »
Snake, please refrain from spamming those links. The thread was to let noobs know what not to do, not to attempt to stifle any creative ideas posted on these forums.
Bucket: [You hear the distant howl of a coyote losing at Counterstrike.]

मैं हिन्दी का समर्थन

~Mooseberry.

Samurai.mac

  • Posts: 317
  • Turrets: +18/-17
Re: [REQ] Chat/!ban nub - dis isnt halflief
« Reply #12 on: September 01, 2008, 07:16:16 pm »
PS2: This still is not half-life or something related to it.

Half-Life is an FPS, so is Trem. Half Life has Humans fighting Aliens, so does Trem. Trem was built on the Q3 engine, Half-Life was built on the Source engine, which is based on the Q3 engine. I could go on, but I don't think I need to. The two are more closely related than you seem to think.

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #13 on: September 01, 2008, 11:49:24 pm »
I'm failry sure HL1 uses the GoldSrc engine HL2 uses Source engine.

Ender

  • Posts: 44
  • Turrets: +12/-16
    • TremFusion
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #14 on: September 02, 2008, 01:50:48 pm »
Good idea, I was working on something similar for TremFusion

http://groups.obliter8.com/node/4133

I hadn't thought of color-coding the kill/death messages though. I like it.

-Ender

Lava Croft

  • Guest
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #15 on: September 02, 2008, 03:27:54 pm »
PS2: This still is not half-life or something related to it.

Half-Life is an FPS, so is Trem. Half Life has Humans fighting Aliens, so does Trem. Trem was built on the Q3 engine, Half-Life was built on the Source engine, which is based on the Q3 engine. I could go on, but I don't think I need to. The two are more closely related than you seem to think.

MartinX3

  • Guest
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #16 on: September 02, 2008, 04:17:41 pm »
Do you mean the hud from Half life 1 or Half life 2? ^^

Hendrich

  • Posts: 898
  • Turrets: +168/-149
    • TremCommands
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #17 on: September 04, 2008, 01:46:49 am »
Quote
so if i left out "half-life" all would be ok? i gave enough details and reasoning not to need "half-life"

"We dont accept that kind of requests here"
You sound like you have authority on your side, it sounds as if your speak for the devs/mods
1. I already checked all the stickied threads, searched the forums, please cite an authority, you already went through the effort of citing something unhelpful that has already been spammed all over the place.
2. two moderators have already commented, you are not a moderator, on internet back seat moderation is generally frowned at, some forums even have rules against it, "you must be new to the internet"
3. the thread you cited lacks authority and quality.

Your post
1. sounds like "me too! me too!", on many forums you'll find rules against this, a mod has already said "Go ahead and code it!"
2. "me too" in terms of that "#10" thread being cited over and over in this forum, yet it lacks the relevance and quality to be spammed.
3. restating the obvious, "THIS IS NOT HALF-LIFE.", "this is not" might be deserved in cases where the feature request obviously conflicts with the goals of tremulous, but this is not the case, unless you have some sort of speech to give on how the quake HUD is superior in its own way.

+1 for stating the obvious. :P

I'm sorry Snake, but recently you've been like the new player1, but the more jerk-ish version of him. And I think (unless it deserves it) we can all say we are tired of seeing #10 or #2a) or #69 being smacked on threads for a sign of instant "idiot" for the thread-creator. Its an idea, all mods begins as an idea so maybe people would be intrested enough to start coding them, maybe he doesn't know how to code or he would need support from the forum members, just, just shutup and go with it whatever people have to say, it won't help putting anyone down, especially if a) Noone likes you for it b) You're being a jerk about it c) You have no absoloute authority or right to childishly critizise his ideas, the fourms is a place of helping, growing ideas for Tremulous so Tremulous can continue its growth as a good FPS, your just one of those people who are bringing that concept down, way,way down. :/

Quote
Source engine, which is based on the Q3 engine

And the Gold Source engine is based on the Q1 engine, Valve is very lazy when it comes to making engines from scratch :P

And thus, lets get back on topic.  :D

Posts

  • Posts: 19
  • Turrets: +6/-2
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #18 on: September 08, 2008, 03:40:56 am »
I found some remains of a team chat message draw thing.

part of the code got removed with the purge of MISSIONPACK stuff.

already existing code:
  { &cg_teamChatTime, "cg_teamChatTime", "3000", CVAR_ARCHIVE  },
  { &cg_teamChatHeight, "cg_teamChatHeight", "0", CVAR_ARCHIVE  },
before testing make sure you set cg_teamChatHeight to a positive non zero value, like 20

some sloppy porting from the ioquake3 svn:
src\cgame\cg_draw.c
Code: [Select]
/*
=================
CG_DrawTeamInfo
=================
*/
static void CG_DrawTeamInfo( void ) {
int w, h;
int i, len;
vec4_t hcolor;
int chatHeight;

#define CHATLOC_Y 420 // bottom end
#define CHATLOC_X 0

if (cg_teamChatHeight.integer < TEAMCHAT_HEIGHT)
chatHeight = cg_teamChatHeight.integer;
else
chatHeight = TEAMCHAT_HEIGHT;
if (chatHeight <= 0)
return; // disabled

if (cgs.teamLastChatPos != cgs.teamChatPos) {
if (cg.time - cgs.teamChatMsgTimes[cgs.teamLastChatPos % chatHeight] > cg_teamChatTime.integer) {
cgs.teamLastChatPos++;
}

h = (cgs.teamChatPos - cgs.teamLastChatPos) * TINYCHAR_HEIGHT;

w = 0;

for (i = cgs.teamLastChatPos; i < cgs.teamChatPos; i++) {
len = CG_DrawStrlen(cgs.teamChatMsgs[i % chatHeight]);
if (len > w)
w = len;
}
w *= TINYCHAR_WIDTH;
w += TINYCHAR_WIDTH * 2;

//if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED ) {
if ( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) {
hcolor[0] = 1.0f;
hcolor[1] = 0.0f;
hcolor[2] = 0.0f;
hcolor[3] = 0.33f;
//} else if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE ) {
} else if ( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) {
hcolor[0] = 0.0f;
hcolor[1] = 0.0f;
hcolor[2] = 1.0f;
hcolor[3] = 0.33f;
} else {
hcolor[0] = 0.0f;
hcolor[1] = 1.0f;
hcolor[2] = 0.0f;
hcolor[3] = 0.33f;
}

trap_R_SetColor( hcolor );
//CG_DrawPic( CHATLOC_X, CHATLOC_Y - h, 640, h, cgs.media.teamStatusBar );
trap_R_SetColor( NULL );

hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
hcolor[3] = 1.0f;



//void CG_DrawStringExt( int x, int y, const char *string, const float *setColor,
//qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars ) {

//void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) {

for (i = cgs.teamChatPos - 1; i >= cgs.teamLastChatPos; i--) {
/*
CG_DrawStringExt( CHATLOC_X + TINYCHAR_WIDTH,
CHATLOC_Y - (cgs.teamChatPos - i)*TINYCHAR_HEIGHT,
cgs.teamChatMsgs[i % chatHeight], hcolor, qfalse, qfalse,
TINYCHAR_WIDTH, TINYCHAR_HEIGHT, 0 );
*/
CG_Text_Paint( CHATLOC_X + TINYCHAR_WIDTH, CHATLOC_Y - (cgs.teamChatPos - i)*TINYCHAR_HEIGHT, 0.5, hcolor, cgs.teamChatMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE );

}
}
}



add   
CG_DrawTeamInfo();
before
CG_DrawVote( );
in fuction
static void CG_Draw2D( void )

i tested it, looks a little messy, needs tweaking, this thing will show team messages (result of messagemode2) near the bottom of the screen, left side.

also see, "CG_AddToTeamChat" and the place its called, and CG_Obituary for death message
« Last Edit: September 08, 2008, 04:50:18 am by Posts »

Hendrich

  • Posts: 898
  • Turrets: +168/-149
    • TremCommands
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #19 on: September 11, 2008, 11:38:34 pm »
Now thats a nifty feature I would ove to se ehappen! :D

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #20 on: September 12, 2008, 06:20:50 am »
This would require both client and server co-operation, so i suspect the only places that could enable such a system would be Development servers, mod servers, or TremFusion.

∧OMG ENTROPY∧

Posts

  • Posts: 19
  • Turrets: +6/-2
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #21 on: September 14, 2008, 03:38:53 am »
done

*chat messages are not team colored, but the kill msgs are, might need server side or a ugly hack for recolored chat
*end of round, with score screen forced on, you'll only see the old chat system. (easy to change)
*old system is easy to remove (keep all minus chat+kill), but i've left it untouched.
*between names in kill message its easy to do relevant emoticons(when ever that feature happens). could just do text weapons, level 1 weapon "->", level 2 weapon "=>"

+  { &cg_killMsgTime, "cg_killMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_killMsgHeight, "cg_killMsgHeight", "5", CVAR_ARCHIVE  },
+  { &cg_chatMsgTime, "cg_chatMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_chatMsgHeight, "cg_chatMsgHeight", "5", CVAR_ARCHIVE  },

diff from 1.1 / r755
co svn://svn.icculus.org/tremulous/tags/RELEASE_1_1_0/
Code: [Select]
Index: src/cgame/cg_draw.c
===================================================================
--- src/cgame/cg_draw.c (revision 1117)
+++ src/cgame/cg_draw.c (working copy)
@@ -1984,6 +1984,85 @@
 }
 
 /*
+=================
+CG_DrawSecondaryChat
+=================
+*/
+static void CG_DrawSecondaryChat( void ) {
+ int i;
+ vec4_t hcolor;
+ int chatHeight;
+
+#define SCHATLOC_Y 400 // bottom end
+#define SCHATLOC_X 0
+
+ if (cg_chatMsgHeight.integer < TEAMCHAT_HEIGHT)
+ chatHeight = cg_chatMsgHeight.integer;
+ else
+ chatHeight = TEAMCHAT_HEIGHT;
+ if (chatHeight <= 0)
+ return; // disabled
+
+ if (cgs.secondaryChatLastPos != cgs.secondaryChatPos) {
+ if (cg.time - cgs.secondaryChatMsgTimes[cgs.secondaryChatLastPos % chatHeight] > cg_chatMsgTime.integer) {
+ cgs.secondaryChatLastPos++;
+ }
+
+ hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
+ hcolor[3] = 1.0f;
+
+ for (i = cgs.secondaryChatPos - 1; i >= cgs.secondaryChatLastPos; i--) {
+
+ CG_Text_Paint( SCHATLOC_X + TINYCHAR_WIDTH, SCHATLOC_Y - (cgs.secondaryChatPos - i)*20,
+ 0.4, hcolor, cgs.secondaryChatMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE );
+
+ }
+ }
+}
+
+/*
+=================
+CG_DrawSecondaryKill
+=================
+*/
+
+static void CG_DrawSecondaryKill( void ) {
+ int i, w;
+ vec4_t hcolor;
+ int chatHeight;
+
+#define SKILLLOC_Y 200 // bottom end
+#define SKILLLOC_X 500
+#define SKILLSCALE 0.4f
+
+ if (cg_killMsgHeight.integer < TEAMCHAT_HEIGHT)
+ chatHeight = cg_killMsgHeight.integer;
+ else
+ chatHeight = TEAMCHAT_HEIGHT;
+ if (chatHeight <= 0)
+ return; // disabled
+
+ if (cgs.secondaryKillLastPos != cgs.secondaryKillPos) {
+ if (cg.time - cgs.secondaryKillMsgTimes[cgs.secondaryKillLastPos % chatHeight] > cg_killMsgTime.integer) {
+ cgs.secondaryKillLastPos++;
+ }
+
+ hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
+ hcolor[3] = 1.0f;
+
+ //w = CG_Text_Width( cgs.secondaryKillMsgs[i % chatHeight], SKILLSCALE, 0 );
+
+ for (i = cgs.secondaryKillPos - 1; i >= cgs.secondaryKillLastPos; i--) {
+
+ CG_Text_Paint( SKILLLOC_X, SKILLLOC_Y - (cgs.secondaryKillPos - i)*20,
+ SKILLSCALE, hcolor, cgs.secondaryKillMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWED );
+
+ }
+ }
+}
+
+
+/*
 ===============================================================================
 
 LAGOMETER
@@ -3265,6 +3344,9 @@
   }
   else if( cg_drawStatus.integer )
     Menu_Paint( defaultMenu, qtrue );
+
+  CG_DrawSecondaryChat();
+  CG_DrawSecondaryKill();
 
   CG_DrawVote( );
   CG_DrawTeamVote( );
Index: src/cgame/cg_local.h
===================================================================
--- src/cgame/cg_local.h (revision 1117)
+++ src/cgame/cg_local.h (working copy)
@@ -1342,7 +1342,17 @@
   int           teamChatMsgTimes[ TEAMCHAT_HEIGHT ];
   int           teamChatPos;
   int           teamLastChatPos;

+  char          secondaryChatMsgs[ TEAMCHAT_HEIGHT ][ TEAMCHAT_WIDTH * 3 + 1 ];
+  int           secondaryChatMsgTimes[ TEAMCHAT_HEIGHT ];
+  int           secondaryChatPos;
+  int           secondaryChatLastPos;
 
+  char          secondaryKillMsgs[ TEAMCHAT_HEIGHT ][ TEAMCHAT_WIDTH * 3 + 1 ];
+  int           secondaryKillMsgTimes[ TEAMCHAT_HEIGHT ];
+  int           secondaryKillPos;
+  int           secondaryKillLastPos;

   int           cursorX;
   int           cursorY;
   qboolean      eventHandling;
@@ -1434,6 +1444,10 @@
 extern  vmCvar_t    cg_synchronousClients;
 extern  vmCvar_t    cg_teamChatTime;
 extern  vmCvar_t    cg_teamChatHeight;
+extern  vmCvar_t    cg_killMsgTime;
+extern  vmCvar_t    cg_killMsgHeight;
+extern  vmCvar_t    cg_chatMsgTime;
+extern  vmCvar_t    cg_chatMsgHeight;
 extern  vmCvar_t    cg_stats;
 extern  vmCvar_t    cg_forceModel;
 extern  vmCvar_t    cg_buildScript;
@@ -1731,6 +1745,7 @@
 //
 // cg_servercmds.c
 //
+void          CG_AddToSecondaryKill( const char *str );
 void          CG_ExecuteNewServerCommands( int latestSequence );
 void          CG_ParseServerinfo( void );
 void          CG_SetConfigValues( void );
Index: src/cgame/cg_servercmds.c
===================================================================
--- src/cgame/cg_servercmds.c (revision 1117)
+++ src/cgame/cg_servercmds.c (working copy)
@@ -472,9 +472,170 @@
     cgs.teamLastChatPos = cgs.teamChatPos - chatHeight;
 }
 
+/*
+=======================
+CG_AddToSecondaryChat
 
+=======================
+*/
 
+static void CG_AddToSecondaryChat( const char *str )
+{
+  int   len;
+  char  *p, *ls;
+  int   lastcolor;
+  int   chatHeight;
+
+  if( cg_chatMsgHeight.integer < TEAMCHAT_HEIGHT )
+    chatHeight = cg_chatMsgHeight.integer;
+  else
+    chatHeight = TEAMCHAT_HEIGHT;
+
+  if( chatHeight <= 0 || cg_chatMsgTime.integer <= 0 )
+  {
+    // team chat disabled, dump into normal chat
+    cgs.secondaryChatPos = cgs.secondaryChatLastPos = 0;
+    return;
+  }
+
+  len = 0;
+
+  p = cgs.secondaryChatMsgs[cgs.secondaryChatPos % chatHeight];
+  *p = 0;
+
+  lastcolor = '7';
+
+  ls = NULL;
+  while( *str )
+  {
+    if( len > TEAMCHAT_WIDTH - 1 )
+    {
+      if( ls )
+      {
+        str -= ( p - ls );
+        str++;
+        p -= ( p - ls );
+      }
+
+      *p = 0;
+
+      cgs.secondaryChatMsgTimes[ cgs.secondaryChatPos % chatHeight ] = cg.time;
+
+      cgs.secondaryChatPos++;
+      p = cgs.secondaryChatMsgs[ cgs.secondaryChatPos % chatHeight ];
+      *p = 0;
+      *p++ = Q_COLOR_ESCAPE;
+      *p++ = lastcolor;
+      len = 0;
+      ls = NULL;
+    }
+
+    if( Q_IsColorString( str ) )
+    {
+      *p++ = *str++;
+      lastcolor = *str;
+      *p++ = *str++;
+      continue;
+    }
+
+    if( *str == ' ' )
+      ls = p;
+
+    *p++ = *str++;
+    len++;
+  }
+  *p = 0;
+
+  cgs.secondaryChatMsgTimes[ cgs.secondaryChatPos % chatHeight ] = cg.time;
+  cgs.secondaryChatPos++;
+
+  if( cgs.secondaryChatPos - cgs.secondaryChatLastPos > chatHeight )
+    cgs.secondaryChatLastPos = cgs.secondaryChatPos - chatHeight;
+}
+
 /*
+=======================
+CG_AddToSecondaryKill
+
+=======================
+*/
+
+void CG_AddToSecondaryKill( const char *str )
+{
+  int   len;
+  char  *p, *ls;
+  int   lastcolor;
+  int   chatHeight;
+
+  if( cg_killMsgHeight.integer < TEAMCHAT_HEIGHT )
+    chatHeight = cg_killMsgHeight.integer;
+  else
+    chatHeight = TEAMCHAT_HEIGHT;
+
+  if( chatHeight <= 0 || cg_killMsgTime.integer <= 0 )
+  {
+    // team chat disabled, dump into normal chat
+    cgs.secondaryKillPos = cgs.secondaryKillLastPos = 0;
+    return;
+  }
+
+  len = 0;
+
+  p = cgs.secondaryKillMsgs[cgs.secondaryKillPos % chatHeight];
+  *p = 0;
+
+  lastcolor = '7';
+
+  ls = NULL;
+  while( *str )
+  {
+    if( len > TEAMCHAT_WIDTH - 1 )
+    {
+      if( ls )
+      {
+        str -= ( p - ls );
+        str++;
+        p -= ( p - ls );
+      }
+
+      *p = 0;
+
+      cgs.secondaryKillMsgTimes[ cgs.secondaryKillPos % chatHeight ] = cg.time;
+
+      cgs.secondaryKillPos++;
+      p = cgs.secondaryKillMsgs[ cgs.secondaryKillPos % chatHeight ];
+      *p = 0;
+      *p++ = Q_COLOR_ESCAPE;
+      *p++ = lastcolor;
+      len = 0;
+      ls = NULL;
+    }
+
+    if( Q_IsColorString( str ) )
+    {
+      *p++ = *str++;
+      lastcolor = *str;
+      *p++ = *str++;
+      continue;
+    }
+
+    if( *str == ' ' )
+      ls = p;
+
+    *p++ = *str++;
+    len++;
+  }
+  *p = 0;
+
+  cgs.secondaryKillMsgTimes[ cgs.secondaryKillPos % chatHeight ] = cg.time;
+  cgs.secondaryKillPos++;
+
+  if( cgs.secondaryKillPos - cgs.secondaryKillLastPos > chatHeight )
+    cgs.secondaryKillLastPos = cgs.secondaryKillPos - chatHeight;
+}
+
+
+/*
 ===============
 CG_MapRestart
 
@@ -987,6 +1148,7 @@
       trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND );
       Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT );
       CG_RemoveChatEscapeChar( text );
+   CG_AddToSecondaryChat( text );
       CG_Printf( "%s\n", text );
     }
 
@@ -1005,6 +1167,7 @@
     Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT );
     CG_RemoveChatEscapeChar( text );
     CG_AddToTeamChat( text );
+ CG_AddToSecondaryChat( text );
     CG_Printf( "%s\n", text );
     return;
   }
Index: src/cgame/cg_event.c
===================================================================
--- src/cgame/cg_event.c (revision 1117)
+++ src/cgame/cg_event.c (working copy)
@@ -44,6 +44,9 @@
   char          className[ 64 ];
   gender_t      gender;
   clientInfo_t  *ci;
+  char          secondaryMessage[ 96 ];
+  char          cleanTargetName[ 12 ];
+  char          cleanAttackerName[ 12 ];
 
   target = ent->otherEntityNum;
   attacker = ent->otherEntityNum2;
@@ -70,6 +73,16 @@
   Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2 );
   strcat( targetName, S_COLOR_WHITE );
 
+  //team color
+  Q_strncpyz( cleanTargetName, targetName, sizeof(cleanTargetName) - 2 );
+  Q_CleanStr( cleanTargetName );
+  if(cgs.clientinfo[ target ].infoValid && cgs.clientinfo[ target ].team == PTE_HUMANS)
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_BLUE, cleanTargetName);
+  else if(cgs.clientinfo[ target ].infoValid && cgs.clientinfo[ target ].team == PTE_ALIENS)
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_YELLOW, cleanTargetName);
+  else
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_WHITE, cleanTargetName);
+
   message2 = "";
 
   // check for single client messages
@@ -177,7 +190,12 @@
 
   if( message )
   {

+    Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s-> %s", S_COLOR_WHITE, cleanTargetName);
+    CG_AddToSecondaryKill(secondaryMessage);
+
     CG_Printf( "%s %s.\n", targetName, message );
+
     return;
   }
 
@@ -186,6 +204,7 @@
   {
     attacker = ENTITYNUM_WORLD;
     strcpy( attackerName, "noname" );
+ strcpy( cleanAttackerName, "noname" );
   }
   else
   {
@@ -194,6 +213,17 @@
     // check for kill messages about the current clientNum
     if( target == cg.snap->ps.clientNum )
       Q_strncpyz( cg.killerName, attackerName, sizeof( cg.killerName ) );
+  
+ //team color
+ Q_strncpyz( cleanAttackerName, attackerName, sizeof(cleanAttackerName) - 2 );
+    Q_CleanStr( cleanAttackerName );
+    if(cgs.clientinfo[ attacker ].infoValid && cgs.clientinfo[ attacker ].team == PTE_HUMANS)
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_BLUE, cleanAttackerName);
+    else if(cgs.clientinfo[ attacker ].infoValid && cgs.clientinfo[ attacker ].team == PTE_ALIENS)
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_YELLOW, cleanAttackerName);
+    else
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_WHITE, cleanAttackerName);
+  
   }
 
   if( attacker != ENTITYNUM_WORLD )
@@ -324,6 +354,9 @@
 
     if( message )
     {
+   Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s %s-> %s", cleanAttackerName, S_COLOR_WHITE, cleanTargetName);
+      CG_AddToSecondaryKill(secondaryMessage);
+  
       CG_Printf( "%s %s %s%s\n",
         targetName, message, attackerName, message2 );
       return;
@@ -331,6 +364,10 @@
   }
 
   // we don't know what it was

+  Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s-> %s", S_COLOR_WHITE, cleanTargetName);
+  CG_AddToSecondaryKill(secondaryMessage);

   CG_Printf( "%s died.\n", targetName );
 }
 
Index: src/cgame/cg_main.c
===================================================================
--- src/cgame/cg_main.c (revision 1117)
+++ src/cgame/cg_main.c (working copy)
@@ -168,6 +168,10 @@
 vmCvar_t  cg_synchronousClients;
 vmCvar_t  cg_teamChatTime;
 vmCvar_t  cg_teamChatHeight;
+vmCvar_t  cg_killMsgTime;
+vmCvar_t  cg_killMsgHeight;
+vmCvar_t  cg_chatMsgTime;
+vmCvar_t  cg_chatMsgHeight;
 vmCvar_t  cg_stats;
 vmCvar_t  cg_buildScript;
 vmCvar_t  cg_forceModel;
@@ -306,6 +310,10 @@
   { &cg_thirdPerson, "cg_thirdPerson", "0", CVAR_CHEAT },
   { &cg_teamChatTime, "cg_teamChatTime", "3000", CVAR_ARCHIVE  },
   { &cg_teamChatHeight, "cg_teamChatHeight", "0", CVAR_ARCHIVE  },
+  { &cg_killMsgTime, "cg_killMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_killMsgHeight, "cg_killMsgHeight", "5", CVAR_ARCHIVE  },
+  { &cg_chatMsgTime, "cg_chatMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_chatMsgHeight, "cg_chatMsgHeight", "5", CVAR_ARCHIVE  },
   { &cg_forceModel, "cg_forceModel", "0", CVAR_ARCHIVE  },
   { &cg_predictItems, "cg_predictItems", "1", CVAR_ARCHIVE },
   { &cg_deferPlayers, "cg_deferPlayers", "1", CVAR_ARCHIVE },


(old screen shot messed up by jpeg compression, blue looks better in game, forced arrow to white)
« Last Edit: September 14, 2008, 03:53:58 am by Posts »

SlackerLinux

  • Spam Killer
  • *
  • Posts: 555
  • Turrets: +41/-62
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #22 on: September 14, 2008, 05:11:34 am »
done

*chat messages are not team colored, but the kill msgs are, might need server side or a ugly hack for recolored chat
*end of round, with score screen forced on, you'll only see the old chat system. (easy to change)
*old system is easy to remove (keep all minus chat+kill), but i've left it untouched.
*between names in kill message its easy to do relevant emoticons(when ever that feature happens). could just do text weapons, level 1 weapon "->", level 2 weapon "=>"

+  { &cg_killMsgTime, "cg_killMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_killMsgHeight, "cg_killMsgHeight", "5", CVAR_ARCHIVE  },
+  { &cg_chatMsgTime, "cg_chatMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_chatMsgHeight, "cg_chatMsgHeight", "5", CVAR_ARCHIVE  },

diff from 1.1 / r755
co svn://svn.icculus.org/tremulous/tags/RELEASE_1_1_0/
Code: [Select]
Index: src/cgame/cg_draw.c
===================================================================
--- src/cgame/cg_draw.c (revision 1117)
+++ src/cgame/cg_draw.c (working copy)
@@ -1984,6 +1984,85 @@
 }
 
 /*
+=================
+CG_DrawSecondaryChat
+=================
+*/
+static void CG_DrawSecondaryChat( void ) {
+ int i;
+ vec4_t hcolor;
+ int chatHeight;
+
+#define SCHATLOC_Y 400 // bottom end
+#define SCHATLOC_X 0
+
+ if (cg_chatMsgHeight.integer < TEAMCHAT_HEIGHT)
+ chatHeight = cg_chatMsgHeight.integer;
+ else
+ chatHeight = TEAMCHAT_HEIGHT;
+ if (chatHeight <= 0)
+ return; // disabled
+
+ if (cgs.secondaryChatLastPos != cgs.secondaryChatPos) {
+ if (cg.time - cgs.secondaryChatMsgTimes[cgs.secondaryChatLastPos % chatHeight] > cg_chatMsgTime.integer) {
+ cgs.secondaryChatLastPos++;
+ }
+
+ hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
+ hcolor[3] = 1.0f;
+
+ for (i = cgs.secondaryChatPos - 1; i >= cgs.secondaryChatLastPos; i--) {
+
+ CG_Text_Paint( SCHATLOC_X + TINYCHAR_WIDTH, SCHATLOC_Y - (cgs.secondaryChatPos - i)*20,
+ 0.4, hcolor, cgs.secondaryChatMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE );
+
+ }
+ }
+}
+
+/*
+=================
+CG_DrawSecondaryKill
+=================
+*/
+
+static void CG_DrawSecondaryKill( void ) {
+ int i, w;
+ vec4_t hcolor;
+ int chatHeight;
+
+#define SKILLLOC_Y 200 // bottom end
+#define SKILLLOC_X 500
+#define SKILLSCALE 0.4f
+
+ if (cg_killMsgHeight.integer < TEAMCHAT_HEIGHT)
+ chatHeight = cg_killMsgHeight.integer;
+ else
+ chatHeight = TEAMCHAT_HEIGHT;
+ if (chatHeight <= 0)
+ return; // disabled
+
+ if (cgs.secondaryKillLastPos != cgs.secondaryKillPos) {
+ if (cg.time - cgs.secondaryKillMsgTimes[cgs.secondaryKillLastPos % chatHeight] > cg_killMsgTime.integer) {
+ cgs.secondaryKillLastPos++;
+ }
+
+ hcolor[0] = hcolor[1] = hcolor[2] = 1.0f;
+ hcolor[3] = 1.0f;
+
+ //w = CG_Text_Width( cgs.secondaryKillMsgs[i % chatHeight], SKILLSCALE, 0 );
+
+ for (i = cgs.secondaryKillPos - 1; i >= cgs.secondaryKillLastPos; i--) {
+
+ CG_Text_Paint( SKILLLOC_X, SKILLLOC_Y - (cgs.secondaryKillPos - i)*20,
+ SKILLSCALE, hcolor, cgs.secondaryKillMsgs[i % chatHeight], 0, 0, ITEM_TEXTSTYLE_SHADOWED );
+
+ }
+ }
+}
+
+
+/*
 ===============================================================================
 
 LAGOMETER
@@ -3265,6 +3344,9 @@
   }
   else if( cg_drawStatus.integer )
     Menu_Paint( defaultMenu, qtrue );
+
+  CG_DrawSecondaryChat();
+  CG_DrawSecondaryKill();
 
   CG_DrawVote( );
   CG_DrawTeamVote( );
Index: src/cgame/cg_local.h
===================================================================
--- src/cgame/cg_local.h (revision 1117)
+++ src/cgame/cg_local.h (working copy)
@@ -1342,7 +1342,17 @@
   int           teamChatMsgTimes[ TEAMCHAT_HEIGHT ];
   int           teamChatPos;
   int           teamLastChatPos;

+  char          secondaryChatMsgs[ TEAMCHAT_HEIGHT ][ TEAMCHAT_WIDTH * 3 + 1 ];
+  int           secondaryChatMsgTimes[ TEAMCHAT_HEIGHT ];
+  int           secondaryChatPos;
+  int           secondaryChatLastPos;
 
+  char          secondaryKillMsgs[ TEAMCHAT_HEIGHT ][ TEAMCHAT_WIDTH * 3 + 1 ];
+  int           secondaryKillMsgTimes[ TEAMCHAT_HEIGHT ];
+  int           secondaryKillPos;
+  int           secondaryKillLastPos;

   int           cursorX;
   int           cursorY;
   qboolean      eventHandling;
@@ -1434,6 +1444,10 @@
 extern  vmCvar_t    cg_synchronousClients;
 extern  vmCvar_t    cg_teamChatTime;
 extern  vmCvar_t    cg_teamChatHeight;
+extern  vmCvar_t    cg_killMsgTime;
+extern  vmCvar_t    cg_killMsgHeight;
+extern  vmCvar_t    cg_chatMsgTime;
+extern  vmCvar_t    cg_chatMsgHeight;
 extern  vmCvar_t    cg_stats;
 extern  vmCvar_t    cg_forceModel;
 extern  vmCvar_t    cg_buildScript;
@@ -1731,6 +1745,7 @@
 //
 // cg_servercmds.c
 //
+void          CG_AddToSecondaryKill( const char *str );
 void          CG_ExecuteNewServerCommands( int latestSequence );
 void          CG_ParseServerinfo( void );
 void          CG_SetConfigValues( void );
Index: src/cgame/cg_servercmds.c
===================================================================
--- src/cgame/cg_servercmds.c (revision 1117)
+++ src/cgame/cg_servercmds.c (working copy)
@@ -472,9 +472,170 @@
     cgs.teamLastChatPos = cgs.teamChatPos - chatHeight;
 }
 
+/*
+=======================
+CG_AddToSecondaryChat
 
+=======================
+*/
 
+static void CG_AddToSecondaryChat( const char *str )
+{
+  int   len;
+  char  *p, *ls;
+  int   lastcolor;
+  int   chatHeight;
+
+  if( cg_chatMsgHeight.integer < TEAMCHAT_HEIGHT )
+    chatHeight = cg_chatMsgHeight.integer;
+  else
+    chatHeight = TEAMCHAT_HEIGHT;
+
+  if( chatHeight <= 0 || cg_chatMsgTime.integer <= 0 )
+  {
+    // team chat disabled, dump into normal chat
+    cgs.secondaryChatPos = cgs.secondaryChatLastPos = 0;
+    return;
+  }
+
+  len = 0;
+
+  p = cgs.secondaryChatMsgs[cgs.secondaryChatPos % chatHeight];
+  *p = 0;
+
+  lastcolor = '7';
+
+  ls = NULL;
+  while( *str )
+  {
+    if( len > TEAMCHAT_WIDTH - 1 )
+    {
+      if( ls )
+      {
+        str -= ( p - ls );
+        str++;
+        p -= ( p - ls );
+      }
+
+      *p = 0;
+
+      cgs.secondaryChatMsgTimes[ cgs.secondaryChatPos % chatHeight ] = cg.time;
+
+      cgs.secondaryChatPos++;
+      p = cgs.secondaryChatMsgs[ cgs.secondaryChatPos % chatHeight ];
+      *p = 0;
+      *p++ = Q_COLOR_ESCAPE;
+      *p++ = lastcolor;
+      len = 0;
+      ls = NULL;
+    }
+
+    if( Q_IsColorString( str ) )
+    {
+      *p++ = *str++;
+      lastcolor = *str;
+      *p++ = *str++;
+      continue;
+    }
+
+    if( *str == ' ' )
+      ls = p;
+
+    *p++ = *str++;
+    len++;
+  }
+  *p = 0;
+
+  cgs.secondaryChatMsgTimes[ cgs.secondaryChatPos % chatHeight ] = cg.time;
+  cgs.secondaryChatPos++;
+
+  if( cgs.secondaryChatPos - cgs.secondaryChatLastPos > chatHeight )
+    cgs.secondaryChatLastPos = cgs.secondaryChatPos - chatHeight;
+}
+
 /*
+=======================
+CG_AddToSecondaryKill
+
+=======================
+*/
+
+void CG_AddToSecondaryKill( const char *str )
+{
+  int   len;
+  char  *p, *ls;
+  int   lastcolor;
+  int   chatHeight;
+
+  if( cg_killMsgHeight.integer < TEAMCHAT_HEIGHT )
+    chatHeight = cg_killMsgHeight.integer;
+  else
+    chatHeight = TEAMCHAT_HEIGHT;
+
+  if( chatHeight <= 0 || cg_killMsgTime.integer <= 0 )
+  {
+    // team chat disabled, dump into normal chat
+    cgs.secondaryKillPos = cgs.secondaryKillLastPos = 0;
+    return;
+  }
+
+  len = 0;
+
+  p = cgs.secondaryKillMsgs[cgs.secondaryKillPos % chatHeight];
+  *p = 0;
+
+  lastcolor = '7';
+
+  ls = NULL;
+  while( *str )
+  {
+    if( len > TEAMCHAT_WIDTH - 1 )
+    {
+      if( ls )
+      {
+        str -= ( p - ls );
+        str++;
+        p -= ( p - ls );
+      }
+
+      *p = 0;
+
+      cgs.secondaryKillMsgTimes[ cgs.secondaryKillPos % chatHeight ] = cg.time;
+
+      cgs.secondaryKillPos++;
+      p = cgs.secondaryKillMsgs[ cgs.secondaryKillPos % chatHeight ];
+      *p = 0;
+      *p++ = Q_COLOR_ESCAPE;
+      *p++ = lastcolor;
+      len = 0;
+      ls = NULL;
+    }
+
+    if( Q_IsColorString( str ) )
+    {
+      *p++ = *str++;
+      lastcolor = *str;
+      *p++ = *str++;
+      continue;
+    }
+
+    if( *str == ' ' )
+      ls = p;
+
+    *p++ = *str++;
+    len++;
+  }
+  *p = 0;
+
+  cgs.secondaryKillMsgTimes[ cgs.secondaryKillPos % chatHeight ] = cg.time;
+  cgs.secondaryKillPos++;
+
+  if( cgs.secondaryKillPos - cgs.secondaryKillLastPos > chatHeight )
+    cgs.secondaryKillLastPos = cgs.secondaryKillPos - chatHeight;
+}
+
+
+/*
 ===============
 CG_MapRestart
 
@@ -987,6 +1148,7 @@
       trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND );
       Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT );
       CG_RemoveChatEscapeChar( text );
+   CG_AddToSecondaryChat( text );
       CG_Printf( "%s\n", text );
     }
 
@@ -1005,6 +1167,7 @@
     Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT );
     CG_RemoveChatEscapeChar( text );
     CG_AddToTeamChat( text );
+ CG_AddToSecondaryChat( text );
     CG_Printf( "%s\n", text );
     return;
   }
Index: src/cgame/cg_event.c
===================================================================
--- src/cgame/cg_event.c (revision 1117)
+++ src/cgame/cg_event.c (working copy)
@@ -44,6 +44,9 @@
   char          className[ 64 ];
   gender_t      gender;
   clientInfo_t  *ci;
+  char          secondaryMessage[ 96 ];
+  char          cleanTargetName[ 12 ];
+  char          cleanAttackerName[ 12 ];
 
   target = ent->otherEntityNum;
   attacker = ent->otherEntityNum2;
@@ -70,6 +73,16 @@
   Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2 );
   strcat( targetName, S_COLOR_WHITE );
 
+  //team color
+  Q_strncpyz( cleanTargetName, targetName, sizeof(cleanTargetName) - 2 );
+  Q_CleanStr( cleanTargetName );
+  if(cgs.clientinfo[ target ].infoValid && cgs.clientinfo[ target ].team == PTE_HUMANS)
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_BLUE, cleanTargetName);
+  else if(cgs.clientinfo[ target ].infoValid && cgs.clientinfo[ target ].team == PTE_ALIENS)
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_YELLOW, cleanTargetName);
+  else
+    Com_sprintf( cleanTargetName, sizeof( cleanTargetName ), "%s%s", S_COLOR_WHITE, cleanTargetName);
+
   message2 = "";
 
   // check for single client messages
@@ -177,7 +190,12 @@
 
   if( message )
   {

+    Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s-> %s", S_COLOR_WHITE, cleanTargetName);
+    CG_AddToSecondaryKill(secondaryMessage);
+
     CG_Printf( "%s %s.\n", targetName, message );
+
     return;
   }
 
@@ -186,6 +204,7 @@
   {
     attacker = ENTITYNUM_WORLD;
     strcpy( attackerName, "noname" );
+ strcpy( cleanAttackerName, "noname" );
   }
   else
   {
@@ -194,6 +213,17 @@
     // check for kill messages about the current clientNum
     if( target == cg.snap->ps.clientNum )
       Q_strncpyz( cg.killerName, attackerName, sizeof( cg.killerName ) );
+  
+ //team color
+ Q_strncpyz( cleanAttackerName, attackerName, sizeof(cleanAttackerName) - 2 );
+    Q_CleanStr( cleanAttackerName );
+    if(cgs.clientinfo[ attacker ].infoValid && cgs.clientinfo[ attacker ].team == PTE_HUMANS)
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_BLUE, cleanAttackerName);
+    else if(cgs.clientinfo[ attacker ].infoValid && cgs.clientinfo[ attacker ].team == PTE_ALIENS)
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_YELLOW, cleanAttackerName);
+    else
+      Com_sprintf( cleanAttackerName, sizeof( cleanAttackerName ), "%s%s", S_COLOR_WHITE, cleanAttackerName);
+  
   }
 
   if( attacker != ENTITYNUM_WORLD )
@@ -324,6 +354,9 @@
 
     if( message )
     {
+   Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s %s-> %s", cleanAttackerName, S_COLOR_WHITE, cleanTargetName);
+      CG_AddToSecondaryKill(secondaryMessage);
+  
       CG_Printf( "%s %s %s%s\n",
         targetName, message, attackerName, message2 );
       return;
@@ -331,6 +364,10 @@
   }
 
   // we don't know what it was

+  Com_sprintf( secondaryMessage, sizeof( secondaryMessage ) - 2, "%s-> %s", S_COLOR_WHITE, cleanTargetName);
+  CG_AddToSecondaryKill(secondaryMessage);

   CG_Printf( "%s died.\n", targetName );
 }
 
Index: src/cgame/cg_main.c
===================================================================
--- src/cgame/cg_main.c (revision 1117)
+++ src/cgame/cg_main.c (working copy)
@@ -168,6 +168,10 @@
 vmCvar_t  cg_synchronousClients;
 vmCvar_t  cg_teamChatTime;
 vmCvar_t  cg_teamChatHeight;
+vmCvar_t  cg_killMsgTime;
+vmCvar_t  cg_killMsgHeight;
+vmCvar_t  cg_chatMsgTime;
+vmCvar_t  cg_chatMsgHeight;
 vmCvar_t  cg_stats;
 vmCvar_t  cg_buildScript;
 vmCvar_t  cg_forceModel;
@@ -306,6 +310,10 @@
   { &cg_thirdPerson, "cg_thirdPerson", "0", CVAR_CHEAT },
   { &cg_teamChatTime, "cg_teamChatTime", "3000", CVAR_ARCHIVE  },
   { &cg_teamChatHeight, "cg_teamChatHeight", "0", CVAR_ARCHIVE  },
+  { &cg_killMsgTime, "cg_killMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_killMsgHeight, "cg_killMsgHeight", "5", CVAR_ARCHIVE  },
+  { &cg_chatMsgTime, "cg_chatMsgTime", "9000", CVAR_ARCHIVE  },
+  { &cg_chatMsgHeight, "cg_chatMsgHeight", "5", CVAR_ARCHIVE  },
   { &cg_forceModel, "cg_forceModel", "0", CVAR_ARCHIVE  },
   { &cg_predictItems, "cg_predictItems", "1", CVAR_ARCHIVE },
   { &cg_deferPlayers, "cg_deferPlayers", "1", CVAR_ARCHIVE },


(old screen shot messed up by jpeg compression, blue looks better in game, forced arrow to white)


the screenshot looks ugly but nice attempt.
Slackware64 13.1
SlackersQVM/

blowFish

  • Posts: 18
  • Turrets: +4/-1
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #23 on: March 26, 2009, 04:34:37 pm »
Nothing like reviving 'old' topics eh?

Anyways, I've been thinking of something that would make this more interesting.


Perhaps instead of '->' we use the actual weapon icon.

Code: [Select]
...

w = CG_Text_Width( killername, 1.0f, 0 );
CG_Text_Paint( x+screenX, y-screenY, 1.0f, colorWhite, killerName, 0, 0, ITEM_TEXTSTYLE_NORMAL );
x += w;

... Some Translation of MOD_* to WeaponIcon ...

cg_DrawPic( x+screenX, y-screenY, 16, 16, cg_weapon[ killers_weapon ].weaponicon );
x+=16;
CG_Text_Paint( x+screenX, y-screenY, 1.0f, colorRed, victimName, 0, 0, ITEM_TEXTSTYLE_NORMAL );


Unless my interpretation of CG_Text_Width ( UI_Text_Width in newer rev rite?? ) is wrong, something like this could draw the appropriate
icon between 'killer' and 'victim'.

Anyways, topic revival.

blowFish

  • Posts: 18
  • Turrets: +4/-1
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #24 on: March 26, 2009, 07:26:31 pm »


This is what I think it should look like, Note this is not a 'real' kill message just some drawing calls to get the offsets and such correct.

Maybe I will take some time this weekend to merge with posts patch to create a working one.


Edit: before you say anything, I know its a bit big. Its also a smidge to far to the right.
« Last Edit: March 26, 2009, 07:30:45 pm by blowFish »

blowFish

  • Posts: 18
  • Turrets: +4/-1
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #25 on: March 27, 2009, 05:07:38 pm »





Actual working 'ingame' shots.

I have a few bugs to fix before writing a patch, but its all there. And works mostly how you would expect it. multiple kills get stacked under the first, the oldest goes away after 3 seconds, etc.

Asvarox

  • Posts: 573
  • Turrets: +41/-35
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #26 on: March 27, 2009, 06:55:36 pm »
Great job, but those icons look pretty small. Also, what will happen if I tk someone? Will the icon turn red?
I MINE FULL WEREWOLFES
NOT SUCH HIPPIE THINGS  >:(

blowFish

  • Posts: 18
  • Turrets: +4/-1
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #27 on: March 28, 2009, 04:51:00 am »
EDIT: Links to my big pictures dont seem to be working :( So here is one of my galaries http://img13.imageshack.us/gal.php?g=shot0030k.jpg
Well, Unfortunately server snarfs all teamkill messages and just tosses them into chat box. so nothing will happen.

Although I do have it programmed so that in the event we do receive a kill that is a team kill it will look like:

'Killername' Icon "TEAMATE " 'victimname'

I have some more Pictures and code to post.



Currently does not display world kill messages in that area but it will before
I'm finished.

Another thing it is going to do is have the upgradeicon ( i.e. ' + '  ) to the right
of the alien class icon for Adv. aliens.

Another problem is that the server eats teamkill messages due to older
clients not having the code to do it themselves.

Now I've made a patched version of Google/Mercuries 966 derived cgame. Monday I will upload a Mercinaries guild patch against vanilla svn tremulous.
« Last Edit: March 28, 2009, 04:55:32 am by blowFish »

Amanieu

  • Posts: 647
  • Turrets: +135/-83
    • Amanieu
« Last Edit: March 28, 2009, 05:06:55 am by Amanieu »
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P

blowFish

  • Posts: 18
  • Turrets: +4/-1
Re: [REQ] Chat/kill message hud - Half-life style
« Reply #29 on: March 28, 2009, 05:56:27 am »
Oh neato, I hadn't realized we came that far with emoticons.

I'll finish what I have currently before taking a serious look into it but the weapon emoticons are superbly ideal for this.
« Last Edit: March 28, 2009, 05:59:02 am by blowFish »