HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

What is "BJ"

06-26-2006, 04:23 AM#1
darkwulfv
I've seen in people sig's "say Yes/no to BJ" or whatever it is. But what IS BJ anyways? I know it starts off certain things in JASS, but that's about it.
06-26-2006, 04:26 AM#2
harshateja
BJ functions are just wrappers of natives that Blizzard threw in there for GUI (or so it was presumed). There are few cases if at all you would want to use BJ functions. Here is an exmaple:

Code:
 function helloWorldBJ takes string s, integer i returns nothing
       call helloWorld(i,s)
endfunction

One case where you might use BJ functions are when creating floating text because it does it all for you in a neat little package which makes reading your code a little bit easier.

As you can tell, it is much more efficient to just call the native and sometimes, the BJ functions even leak!
06-26-2006, 04:31 AM#3
darkwulfv
Thx. Just wondering. So sometimes its good to use BJ, and other times it's not?
06-26-2006, 06:51 AM#4
Captain Griffen
Basically the only decent BJs are for the most part PolledWait and BJDebugMsg, with the last one only being for debugging, and just easier to write.

Natives are faster. They also often give more functionality. Most BJs are completely useless and just swap over the order (some don't even do that). Don't use them.
06-26-2006, 06:59 AM#5
PipeDream
PolledWait leaks =)
06-26-2006, 07:13 AM#6
Captain Griffen
Doesn't nullify the timer, true. Very minor leak though (does Vex's optimiser fix that?).
06-26-2006, 07:47 AM#7
Jacek
I use BJs and all that shit until I'm sure everything works, then I optimize tthe code with natives etc... :D
06-26-2006, 08:01 AM#8
Captain Griffen
That's a silly way to do it for most functions, as most BJs take longer to write out, make less sense, and do exactly the same thing.
06-26-2006, 10:03 AM#9
Rising_Dusk
Actually...

TriggerRegisterAnyUnitEventBJ() is a good one too.
That's one I toss around all of the time just to save lines of code.

Also I use the CountPlayersInForce() BJ as well out of convenience.
I also use MultiboardSetItemValueBJ() since the alternative of coding it out is just a waste of space.
To be quite fair, in actual mapmaking using one or two won't destroy your map.
It's good to try to be as efficient as possible, but for me, as long as it runs and doesn't lag it's efficient enough in a WC3 map.
06-26-2006, 12:32 PM#10
iNfraNe
Quote:
Originally Posted by Captain Griffen
Basically the only decent BJs are for the most part PolledWait and BJDebugMsg, with the last one only being for debugging, and just easier to write.
Hell no... BJDebugMsg sux... it loops trough players and it is like.. really hard to write anyway.. A better one would be
Collapse JASS:
function Echo takes string msg returns nothing
  call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,msg)
endfunction

Almost all the BJ functions that make a little sense leak something so u'll have to rewrite the functions anyway :)
06-26-2006, 12:39 PM#11
BertTheJasser
@ Captain Griffen: Polled wait leaks a timer being not nullified.
@ iNfraNe: Oh that is actually very good and I am using this since about 2 years.
06-26-2006, 12:48 PM#12
Captain Griffen
How about you read first, then critise?

Quote:
@ Captain Griffen: Polled wait leaks a timer being not nullified.

Quote:
Originally Posted by Captain Griffen
Doesn't nullify the timer, true. Very minor leak though (does Vex's optimiser fix that?).

Quote:
Hell no... BJDebugMsg sux... it loops trough players and it is like.. really hard to write anyway.. A better one would be

Quote:
Originally Posted by Captain Griffen
Basically the only decent BJs are for the most part PolledWait and BJDebugMsg, with the last one only being for debugging, and just easier to write. [i](emphasis added)
06-26-2006, 12:54 PM#13
Rising_Dusk
You always get so defensive, Griff.
It's ok, we're not questioning your judgement or your jass skills, we're just making out own comments and stating our own opinions.
That's why we're on a forum in the first place. :P
06-26-2006, 01:00 PM#14
Thunder_Eye
I'm here to learn
06-26-2006, 04:18 PM#15
Chuckle_Brother
I'm here to spam.

And I think we all know what BJ ought to stand for.