What is the difference?

Azlier

Old World Ghost
Reaction score
461
[ljass]StringHashBJ[/ljass] simply calls the native, using an extra function call.
 

Hatebreeder

So many apples
Reaction score
381
StringHasBJ just calls StringHash.

It's a useless function. Like all BJ related functions, Exept for TriggerRegisterAnyUnitEvent(...)..
 

quraji

zap
Reaction score
144
i really dont get these things, also when they say
JASS:
native StringHash takes string s, returns integer


what does this do?
1st it doesnt have a return value
2nd it does nothing :S

>1st it doesnt have a return value
Yes it does...it returns integer.

>2nd it does nothing :S
Yes it does. We just can't see the code because 'native' functions are hard-coded JASS functions. They're part of the game engine which isn't exposed to us.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Natives are functions, well, 'native' in Warcraft III. Think about what BJ and user-created functions do; they use other functions and goodies to get stuff done. Well, somewhere in there, there have to be functions which don't just call other functions. Functions that actually do something on their own. Those are the natives. The reason that don't have a bunch of stuff inside them and an endfunction is that they're programmed directly into Warcraft III.

As such, all Jass needs to know about them is their name, what they take, and what they return. Hence the 1-line function declaration.

You see, it does have a return value and it does do something. It just has no reason or way to display itself in the same way that functions that call other functions do.

This function relies on the use of various other stuffs to do what it wants done, and relies on Jass syntax to do so. It is a BJ:
JASS:
function CreateNUnitsAtLoc takes integer count,integer unitId,player whichPlayer,location loc,real face returns group
    call GroupClear(bj_lastCreatedGroup)
    loop
        set count = count - 1
        exitwhen count < 0
        call CreateUnitAtLocSaveLast(whichPlayer, unitId, loc, face)
        call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
    endloop
    return bj_lastCreatedGroup
endfunction


This function just does something. It's a native:
JASS:
native CreateUnitAtLoc takes player id,integer unitid,location whichLocation,real face returns unit



Note that the BJ in this case calls another BJ which then calls the above native. Lullz.

edit: Beaten to it!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top