• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] How to hide messages generated by DisplayTextToForce and keep them in message log?

Level 5
Joined
May 10, 2024
Messages
60
I use DisplayTextToForce function to print values of my variables in combination with incresed message log. I want to hide or completely remove chat messages that appear at the left corner of the screen while developing a map. Messages should be visible in the message log.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,924
You can customize the UI yourself, creating your own message log or modifying the existing one.
Otherwise, you can use "Clear Text Messages" to remove the printed values from the screen. Of course this removes chat messages as well.
 
I'm not sure if you can hide just game messages specifically (although, someone correct me if I'm wrong! I can't find a way to access those frames), but if you are willing to use a different function for all your debug messages, then you could always just append that text to the message log (the "LogArea" frame). I recommend making a helper function or small library to use throughout your map:
JASS:
library Logger
    globals
        private framehandle logTextFrame = null
    endglobals

    /**
     * Logs a string into the message log without displaying it on-screen.
     * Note: this will not record messages logged during map initialization,
     * as the log frame will not have been loaded yet.
     */
    function LogSilent takes string s returns nothing
        if logTextFrame == null then
            set logTextFrame = BlzGetFrameByName("LogArea", 0)
        endif
        call BlzFrameAddText(logTextFrame, s)
    endfunction    
endlibrary

In general, I always recommend adding a separate logging layer (like the one above) into your map instead of using the "display..." messages directly! You'll find it super useful down the road, for any software project really. For example, you could:
  • Introduce some methods that print to the screen and some that don't (e.g. LogDebug vs. LogSilent)
  • Add log "categories", so you can suppress/selectively display certain logs (e.g. you can configure your logger to only display messages with the "Spells" category for when you're trying to debug an issue with your custom spell logic)
  • Add levels of log severity (e.g. verbose, debug, warning, error), so only the most important logs get surfaced as you're developing
And it also helps provide a separate layer you can hide if you want to display messages on the screen for game-logic in the future (e.g. to display in-game hints and any other text).
 
Level 5
Joined
May 10, 2024
Messages
60
I'm not sure if you can hide just game messages specifically (although, someone correct me if I'm wrong! I can't find a way to access those frames), but if you are willing to use a different function for all your debug messages, then you could always just append that text to the message log (the "LogArea" frame). I recommend making a helper function or small library to use throughout your map:
JASS:
library Logger
    globals
        private framehandle logTextFrame = null
    endglobals

    /**
     * Logs a string into the message log without displaying it on-screen.
     * Note: this will not record messages logged during map initialization,
     * as the log frame will not have been loaded yet.
     */
    function LogSilent takes string s returns nothing
        if logTextFrame == null then
            set logTextFrame = BlzGetFrameByName("LogArea", 0)
        endif
        call BlzFrameAddText(logTextFrame, s)
    endfunction   
endlibrary

In general, I always recommend adding a separate logging layer (like the one above) into your map instead of using the "display..." messages directly! You'll find it super useful down the road, for any software project really. For example, you could:
  • Introduce some methods that print to the screen and some that don't (e.g. LogDebug vs. LogSilent)
  • Add log "categories", so you can suppress/selectively display certain logs (e.g. you can configure your logger to only display messages with the "Spells" category for when you're trying to debug an issue with your custom spell logic)
  • Add levels of log severity (e.g. verbose, debug, warning, error), so only the most important logs get surfaced as you're developing
And it also helps provide a separate layer you can hide if you want to display messages on the screen for game-logic in the future (e.g. to display in-game hints and any other text).
I use default world editor version 1.26. There must be the way to hide this messages. Remove UI element, make it invisible, move element outside of the screen, make text size = 0, and so on.
2.png
 

Attachments

  • hide-chat-messages.w3m
    16 KB · Views: 0

Rheiko

Spell Reviewer
Level 27
Joined
Aug 27, 2013
Messages
4,225
There must be the way to hide this messages. Remove UI element, make it invisible, move element outside of the screen, make text size = 0, and so on.
There is none. You can only clear the screen. The text should stay visible inside the log even if you cleared the screen. Something like this should work.

JASS:
call DisplayTextToForce( GetPlayersAll(), "Your String here" )
call ClearTextMessagesBJ( GetPlayersAll() )
 
Top