| 01-09-2006, 04:05 AM | #1 |
What's so great about using BJDebugMsg over, say, DisplayTextToForce? |
| 01-09-2006, 04:29 AM | #2 |
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 |
DisplayTextToForce leaks a playergroup... even if you're saying,... call DisplayTextToForce( GetPlayersAll(), "My Message!") ?? |
| 01-09-2006, 05:47 AM | #4 |
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 | |
Quote:
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 | |
Quote:
|
| 01-09-2006, 11:04 AM | #7 |
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 |
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: 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 | |
Quote:
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 |
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 |
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 |
yeah that's completelly true, but it is just a debugging funtion anyways |
