ClientMessage

I’d like to get a messaging system set up. I’ll need it for game-related messages and also in-game chat, but I also need it now to help debugging.

APlayerController::ClientMessage and AGameMode::Broadcast sound like exactly what I want, but they’re not quite working as advertised. Broadcast just calls ClientMessage on all existing controllers, which is what I want. ClientMessage, however, is lacking. The documentation explicitly states “Outputs a message to HUD”. This is not happening. The message is visible if I open up the console, but not otherwise.

Looking at the source code suggests that this is exactly what should happen: The message is passed down to the console and inserted into a buffer, and never read outside of the console rendering.

Is the only option for rendering text without having the console open to basically copy all of the existing functions and change it to output the message to the HUD, and add rendering there myself? Only Broadcast appears to be virtual, so I can’t just override any of these either.

Looking on source code you will need to override ClientTeamMessage_Implementation to catch those messages, because they exclusively go to UConsole which is console implementation… which you can override too if you wish

https://github.com/EpicGames/UnrealEngine/blob/8a80b5541f69a79abf5855668f39e1d643717600/Engine/Source/Runtime/Engine/Private/PlayerController.cpp#L1321

Huh, intellisense is saying that override is invalid, but it actually compiles, and appears to be working. ClientTeamMessage_Implementation isn’t actually defined in the header - presumably it’s created as a result of the UFUNCTION replication directive. Do all _implementation functions automatically get the virtual tag?

Furthermore, is it actually safe to override these implicitly declared functions?