Raised This Month: $51 Target: $400
 12% 

HLStatsx CSGO [no color]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-24-2013 , 15:47   HLStatsx CSGO [no color]
Reply With Quote #1

In other servers I play in, it shows in green text the amount of points you gain and stuff.

Why does my server just have plain text for all the events happening? Any fix on this?

Thanks!
taRik is offline
Walliski
Senior Member
Join Date: May 2013
Old 11-25-2013 , 17:57   Re: HLStatsx CSGO [no color]
Reply With Quote #2

In the gameserver settings, what settings do you have for the BroadcastEvents?
Also do you have the sourcemod plugin correctly installed?
Walliski is offline
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-25-2013 , 22:46   Re: HLStatsx CSGO [no color]
Reply With Quote #3

BroadCastEvents is set to 1.

BroadCastEventsCommand is hlx_sm_psay
BroadCastEventsCommandAnnounce is hlx_sm_csay
BroadCastPlayerActions is 1


Yes I am sure I have the mod setup correctly, everything works fine. I used the auto-installer on my server provider.

Last edited by taRik; 11-26-2013 at 00:05.
taRik is offline
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-26-2013 , 00:21   Re: HLStatsx CSGO [no color]
Reply With Quote #4

Is there a setting I need to change for colors?

Last edited by taRik; 11-26-2013 at 16:31.
taRik is offline
Walliski
Senior Member
Join Date: May 2013
Old 11-27-2013 , 09:15   Re: HLStatsx CSGO [no color]
Reply With Quote #5

If you installed the plugin with autoinstaller it could be that you have an old version of it. Download the newest here from the forum, and replace the old one with it. Only the .smx file should suffice.
Walliski is offline
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-27-2013 , 18:56   Re: HLStatsx CSGO [no color]
Reply With Quote #6

Quote:
Originally Posted by Walliski View Post
If you installed the plugin with autoinstaller it could be that you have an old version of it. Download the newest here from the forum, and replace the old one with it. Only the .smx file should suffice.
Just did this, literally nothing changed.
taRik is offline
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-28-2013 , 18:06   Re: HLStatsx CSGO [no color]
Reply With Quote #7

Does anyone else have any other ideas?
taRik is offline
VitrescentTortoise
Junior Member
Join Date: Nov 2013
Old 11-29-2013 , 05:18   Re: HLStatsx CSGO [no color]
Reply With Quote #8

Edit: I was right, there was incorrect stuff in here! Striking it out.
Disclaimer: Plenty of the stuff I say/speculate about in here could be completely wrong. Take it with a pinch of salt.

I've been doing some digging around, here are my results and what I was doing.

There are two methods I was looking at, hlx_sm_psay (will be referred to as psay) and hlx_sm_psay2 (referred to as psay2). psay description states that it sends a private message. psay2 states it sends a private message in green.

I spent a while reading these methods, and I'm pretty sure I've got this right, however I could be incorrect about some things in this next part.

Speculation based what I read in code:
psay has two potential color parameters that it can be given from the hlstatx:ce code along with the message. One first sets the text to white. It then loops through all the players on the server and checks if their names are in the message. It takes the name with the lowest occurrences (but still occurring at least once) and makes it white. All other names are made green.(It sets one name to green, and loops through the rest setting them to a different color.) It than sends this message to the recipients. The 2nd color parameter value sets the text to white and ships it to the recipients.

psay2 strips the text of its' color, sets it to green, and sends it to the recipients.

Minimal amounts of crappy testing:
I went and tested a couple of configurations on the server and how they affected text color. I only tested the message "HlStatsX:CE disabled! Need at least...". I could not test other messages w/ names in them because I have no friends willing to get on the server and help me out. The only change I found that did anything was changing PlayerEventsCommand from psay to psay2. Psay is the default setting. On psay, it would print that message in olive or blue, depending on your team. On psay2, it prints it in white.

What I think:
I think that the text defaults to either blue or olive. The code in psay2 is successfully stripping the color, however it fails to set it green, so it ends up being sent out white. I suppose the next step will be trying to make it set it to green. Psay has coloring issues of its own though.

The part about sending the data to the client confused me, it uses a usermessage, sending the data in bytes, I'm going to have to study up on usermessages and some other crap to figure this out. There is a comment in the code stating that the method used is to hackishly add 'printable' character (says to be an unused control code, I presume it is invisible and that's why it is used), because CS:GO needs it. It also says that the message must preface with the standard color. CS:GO appears to be absolute crud when it comes to coloring the text.

I'm gonna start hacking at this part of the code and seeing how things changed. Might also hunt down some plugins with working colors and observe them. I have read some stuff before, and it seems that normally colors are denoted with crap like \x01. It's done a bit differently here.

I should probably leave this to people who know what they're doing, but I got kind of intrigued and ending up where I am now.



p.s. Sorry if my thoughts seem kind of scattered or if I have typos everywhere. I'm writing this in the middle of the night.

Last edited by VitrescentTortoise; 11-30-2013 at 01:47.
VitrescentTortoise is offline
taRik
AlliedModders Donor
Join Date: Apr 2010
Old 11-29-2013 , 12:32   Re: HLStatsx CSGO [no color]
Reply With Quote #9

Looks really good man I'm glad someone is trying to figure it out. Let us know what your progress is.
taRik is offline
VitrescentTortoise
Junior Member
Join Date: Nov 2013
Old 11-29-2013 , 12:52   Re: HLStatsx CSGO [no color]
Reply With Quote #10

I found where the problem originated. In this thread someone fixes the SayText2, but breaks the coloring along the way.
https://forums.alliedmods.net/showthread.php?t=206537

Another thread about the update:
https://forums.alliedmods.net/showthread.php?t=205993


There's some nice info on the protobuf, but other than that, nothing too new here.


EDIT:
I think I was incorrect in saying that the hlx_sm_psay sets a player's name to white, I believe it is actually setting it to the player's corresponding team color. Not sure
how this fits into anything else. I also now realize that when I wrote that long post, I was looking at the 1.6.19 hlstatx.smx release, not the hlxce.smx from the thread I
previously linked. The hlxce.smx has the protobuff implemented, It doesn't look like coloring was attempted to be added, but I could be wrong. That doesn't mean I
have any idea how to add it, but I'm trying to get there...

EDIT2:
Just so you know, if you'd prefer your messages in white and not the teamcolor, you can set BroadCastEventsCommand to hlx_sm_psay2 and PlayerEventsCommand to hlx_sm_psay2.
EDIT3, POST-SOLUTION:Don't do what I said to do in EDIT2. That will only work with the broken plugin. Install the new plugin and your messages will be white/green.

Last edited by VitrescentTortoise; 11-30-2013 at 03:43.
VitrescentTortoise is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode