Info Message

Please post any questions about developing your plugin here. Please use the search function before posting!
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Info Message

Postby nullable » Sun Nov 09, 2014 7:47 am

Hello. I want a message like "Match started" on the top center of screen.
But HintText, SayText2 not what I need. Please help me of code example.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Sun Nov 09, 2014 10:28 am

Syntax: Select all

from events import Event
from messages import TextMsg

game_started = TextMsg(message='Game started',
destination=TextMsg.HUD_PRINTCENTER)

@Event
def round_start(game_event):
game_started.send()
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Sun Nov 09, 2014 6:55 pm

Thanks, but this code to crash my csgo :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 10, 2014 2:49 pm

I can confirm that using TextMsg crashes my client (not the server). I also tried using HintText and KeyHintText, which I know used to work a long time ago. While neither of the two crashed the server or my client, no message was printed.
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 10, 2014 4:26 pm

Ok, so I figured out the crashing issue. The parameters for TextMsg were incorrect. I will commit the fixes here in a few. However, even after doing so, I still do not receive any message on my screen...
Image
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Mon Nov 10, 2014 5:46 pm

Actually, there is no "msg_name" for TextMsg:

Syntax: Select all

message CCSUsrMsg_TextMsg
{
optional int32 msg_dst = 1;
repeated string params = 3;
}
It seems that the first string wrote to "params" is the main string and others are just formated to it.

EDIT: HintText and KeyHintText both works on my side. I think I know why they didn't, on your side. Like I commented here, ResetHud is sent every round start to clean players' hud so you need to delay any HintText/KeyHintText if you want to send them on round_start.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 10, 2014 5:59 pm

I noticed that too. However, I also noticed this post of your's from a while back (dev eyes only):
http://forums.sourcepython.com/showthread.php?202&p=1260&viewfull=1#post1260

The link in your second edit led me to the conclusion that maybe we needed another value. Through all my testing, the only one that does not crash my client is when I have both msg_name and params. Though, again, nothing is printed.

I will continue to test, and see if I can figure this out.
Image
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Mon Nov 10, 2014 7:03 pm

Not sure if this has something to do with this issue. https://github.com/Source-Python-Dev-Team/Source.Python/issues/4
I never had the motivation to take a look at it.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Mon Nov 10, 2014 7:14 pm

Actually, I got it working with the following:

Syntax: Select all

from events import Event
from filters.recipients import RecipientFilter
from _messages import UserMessage

@Event
def player_jump(game_event):
x = RecipientFilter() # Need to keep it alive the time send_message gets called.
msg = UserMessage(x, 'TextMsg')
msg.set_byte('msg_dst', 4)
msg.set_string('params', 'Hello!', 1)
msg.send_message()
However, this is the same result as HintText and KeyHintText. They all three prints the message at this area: http://img15.hostingpics.net/pics/5258302014111000001.jpg
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 10, 2014 7:21 pm

Even though it is the same, we still need to support it within our messages package with the TextMsg class. When you get the chance, please update the data or package to fix this issue. And yes, Ayuto, we do still need to go back through and fix any other issues that exist within the messages package, especially in relation to CS:GO.
Image
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Postby nullable » Mon Nov 10, 2014 9:05 pm

I need message like: "PLAYING ON TEAM COUNTER-STRIKE" on image http://img15.hostingpics.net/pics/5258302014111000001.jpg
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Nov 10, 2014 10:12 pm

I don't know that we have access to that, but we will attempt to find out. I do know that toptext doesn't work, as none of the Dialog messages work in CS:GO.
Image
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Nov 11, 2014 8:41 pm

Actually, using the exact script L'In20Cible has shown with player_jump, my client crashes...
Image

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 134 guests