Do DebugMsgs show ingame?

PurgeandFire

zxcvmkgdfg
Reaction score
509
Yeah. Unless you put the keyword [ljass]debug[/ljass] before it, then it will only show up when debug mode is enabled.
 

shiFt

Member
Reaction score
8
So this will not show on bnet games? BJDebugMsg, shows for me obv in testmap mode
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
BJDebugMsg's show in game and on BNet. They are just like normal messages if you see what it is composed of. :)
JASS:
function BJDebugMsg takes string msg returns nothing
    local integer i = 0
    loop
        call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYERS
    endloop
endfunction


If you add the [ljass]debug[/ljass] keyword before it, it will only appear when debug mode is enabled and you are testing the map from the editor.
 

Romek

Super Moderator
Reaction score
964
You should only use [ljass]BJDebugMsg[/ljass] for debugging any problems in your code, and checking if things are running well. Once you're happy with the code, you should remove them. Any messages to be shown to players should be done with the other natives with more options.
Any release versions of your map shouldn't use it.
 

Sevion

The DIY Ninja
Reaction score
413
I choose to do this:

JASS:
debug function DebugMsg takes string s returns nothing
    debug call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, s)
debug endfunction


A bit cleaner and more efficient.

Also a little easier to type ;)

Then, whenever you are developing, save and test in Debug mode. When you're publishing? Save and distribute in default mode.
 

Romek

Super Moderator
Reaction score
964
> A bit cleaner and more efficient.
Efficiency matters in displaying a debug message?

> Also a little easier to type
It doesn't work with Autocomplete. BJD + Enter is easier, I think. :p

You should always delete debug messages when they're no longer needed, even if they're in 'debug mode'. You don't want to get swarmed with unnecessary debug messages whilst debugging something important, do you?
 

Sevion

The DIY Ninja
Reaction score
413
1. Yus. I cares about efficiency in debug :3 It could throw off your efficiency tests when testing efficiency for other things in Debug Mode :3 (lolz jk jk)

2. Meh. Make it Msg then :p The name is changeable.

3. True. But I usually use this more for showing errors and warnings when making systems. I.E. passing null arguments or out of bounds.
 

DioD

New Member
Reaction score
57
NEVER remove debug information from your code, you must keep comments and debug info permanently.

You cannot be 100% sure, is code free from any errors.

Debug keywork is useless in most cases, since you cant ON\OFF debug more runtime, better use function with option to display or not display messages, but track event anyway, this does not drain performance, but will help you if you encounter problems, since you can turn debug display at any time.
 

Sevion

The DIY Ninja
Reaction score
413
Having trouble understanding parts of your post.

"cant ON\OFF debug more runtime"??
 

Romek

Super Moderator
Reaction score
964
> True. But I usually use this more for showing errors and warnings when making systems. I.E. passing null arguments or out of bounds.
Ahh, that's fine.

> NEVER remove debug information from your code, you must keep comments and debug info permanently.
Comments, yes. Debug stuff, no. There comes a point at which you probably don't care whether or not a unit spawned successfully every 0.6 seconds, or what angle X unit is facing. Unless you're talking about this in a similar context to Sevion (finding potential causes of errors (eg. null structs being passed around), and displaying that); In which case I agree.
 

DioD

New Member
Reaction score
57
JASS:
set displaydebug = true
set displaydebug = false

this is runtime on\off

if you encounter something strange ingame, you able to turn debug on at any time.

if you are using debug keywork, you have no chance to do it.

also with a bit of skill, you may always force debug output for replays, or debug output for yourself only (by nickname).
There is no reason to keep debug on unit creation or something similar, but struct fails, null handles and similar stuff MUST always provide debug output.

JASS:
function DebugMsg takes string s returns nothing
if displaydebug then
     call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, s)
endif
endfunction

if localplayer = triggerplayer
set displaydebug = true
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top