HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

BJDebugMsg?

01-09-2006, 04:05 AM#1
PCPharaoh
What's so great about using BJDebugMsg over, say, DisplayTextToForce?
01-09-2006, 04:29 AM#2
AnarkiNet
Well, you use BJDebugMsg only for debugging purposes...thats why its called "BJDebugMsg". It doesnt leak a player group like DisplayTextToForce.
01-09-2006, 05:03 AM#3
PCPharaoh
DisplayTextToForce leaks a playergroup... even if you're saying,...
call DisplayTextToForce( GetPlayersAll(), "My Message!")

??
01-09-2006, 05:47 AM#4
Blade.dk
No, it doesn't. But using BJDebugMsg is just easier for lazy people that have to debug since it's faster to write and that the result doesn't disappear from the screen so fast.
01-09-2006, 08:24 AM#5
AnarkiNet
Quote:
Originally Posted by Blade.dk
No, it doesn't. But using BJDebugMsg is just easier for lazy people that have to debug since it's faster to write and that the result doesn't disappear from the screen so fast.

Are you stating that DisplayTextToForce( GetPlayersAll(), "Hello World") doesnt leak? 'Cause as far as I know, that would definatly leak the force returned by GetPlayersAll().
01-09-2006, 08:36 AM#6
Anitarf
Quote:
Originally Posted by AnarkiNet
Are you stating that DisplayTextToForce( GetPlayersAll(), "Hello World") doesnt leak? 'Cause as far as I know, that would definatly leak the force returned by GetPlayersAll().
In that case, it would be the GetPlayersAll() that leaks, not the DisplayTextToForce(). But it doesn't. GetPlayersAll() doesn't generate a new force, it always returns the same force.
01-09-2006, 11:04 AM#7
Nantuko Husk
GetPlayersAll ( ) returns a force created on map initialization which contains all the players,so it doesn't leak.

bj_FORCE_ALL_PLAYERS

I'd say to use that bj Global variable instead of GetPlayersAll () , just performance.
01-09-2006, 11:34 AM#8
Starcraftfreak
In most cases you don't need to display debug info to all players, so DisplayTextToPlayer should be enough.

For offline debugging I use something like this:
Collapse JASS:
function Out takes string msg returns nothing
    call DisplayTextToPlayer(Player(0), 0, 0, msg)
endfunction

Don't tell me that Player(0) leaks a player now...
01-09-2006, 10:09 PM#9
PCPharaoh
Quote:
Originally Posted by Starcraftfreak
In most cases you don't need to display debug info to all players, so DisplayTextToPlayer should be enough.

For offline debugging I use something like this:
Collapse JASS:
function Out takes string msg returns nothing
    call DisplayTextToPlayer(Player(0), 0, 0, msg)
endfunction

Don't tell me that Player(0) leaks a player now...

Well that leads me to another question. DisplayTextToPlayer works fine, unless you supply non-zero values for the two real arguments. Then it makes the whole trigger not work. Any idea why they're there, then?
01-09-2006, 10:16 PM#10
Vexorian
the values you supply to it are very high. I think it only accepts values from 0 to 1, and it moves the text to another position of the screen, the problem is that negative numbers don't work. It also moves ALL the text including previous text messages.

BJDebugMsg simply has a smaller function name and no arguments makes it easy for temp debugging. You can always make a debug system like Debmsg("whatever") and only show the text if a variable is true.
01-10-2006, 12:33 PM#11
iNfraNe
I've always wondered why blizzard looped trough players with bjdebug.
Displaying a text to LocalPlayer wouldnt desync and would reach all players and would be faster, correct? not that it matters. Just always wondered.
01-10-2006, 04:01 PM#12
Vexorian
yeah that's completelly true, but it is just a debugging funtion anyways