x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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.

Product Version: UE 4.8
Tags:
more ▼

asked Jun 25 '15 at 11:08 PM in C++ Programming

avatar image

dstreb
46 14 16 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Jun 26 '15 at 02:18 AM

avatar image

Shadowriver
36.6k 930 169 1111

avatar image dstreb Jun 26 '15 at 03:53 AM

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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question