Page 1 of 1

[CSGO] New Custom HUD (game_text)

Posted: Wed Mar 22, 2017 3:38 am
by decompile
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

Re: [CSGO] New Custom HUD (game_text)

Posted: Thu Mar 23, 2017 3:03 am
by satoon101
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)

Re: [CSGO] New Custom HUD (game_text)

Posted: Thu Mar 23, 2017 12:19 pm
by marcowmadeira
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:

Re: [CSGO] New Custom HUD (game_text)

Posted: Thu Mar 23, 2017 12:52 pm
by VinciT
It seems that bit is still broken, but at least they're working on it: https://github.com/ValveSoftware/csgo-o ... ssues/1351