[CSGO] New Custom HUD (game_text)

All other Source.Python topics and issues.
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

[CSGO] New Custom HUD (game_text)

Postby decompile » Wed Mar 22, 2017 3:38 am

So, the latest update fixes game_text for CS:GO, after almost 5 years. Hammer still doesn't support the newline in game_texts though and crashes out.

But you can use a hex editor on the bsp to insert a newline character in texts, and they work just fine in-game!

Source: https://www.reddit.com/r/csmapmakers/comments/609roe/game_text_works_for_csgo_including_multiline/?st=j0go5mfc&sh=0e748dfc
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: [CSGO] New Custom HUD (game_text)

Postby satoon101 » Thu Mar 23, 2017 3:03 am

Nice find! Glad they finally got this working. The following is a working example using the messages package:

Syntax: Select all

from colors import BLUE, RED
from events import Event
from messages import HudMsg
from players.entity import Player


team_messages = {
2: HudMsg(
message='HudMsg test message for Terrorists',
x=0.2,
y=0.2,
color1=RED,
),
3: HudMsg(
message='HudMsg test message for CTs',
x=0.2,
y=0.2,
color1=BLUE,
),
}


@Event('player_say')
def _test_hudmsg(game_event):
player = Player.from_userid(game_event['userid'])
if player.team in team_messages:
team_messages[player.team].send(player.index)
Image
marcowmadeira
Junior Member
Posts: 11
Joined: Wed Apr 27, 2016 11:54 am

Re: [CSGO] New Custom HUD (game_text)

Postby marcowmadeira » Thu Mar 23, 2017 12:19 pm

Is there a way to change the size of the font? Based on valve's wiki, the size would be different based on the channel, but it might not work on csgo. :frown:
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [CSGO] New Custom HUD (game_text)

Postby VinciT » Thu Mar 23, 2017 12:52 pm

It seems that bit is still broken, but at least they're working on it: https://github.com/ValveSoftware/csgo-o ... ssues/1351

Return to “General Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 22 guests