BJs

envenger

Active Member
Reaction score
3
there are sm BJs that are replaced by native but what about those like
CreateTextTagUnitBJ
JASS:
function CreateTextTagUnitBJ takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
    set bj_lastCreatedTextTag = CreateTextTag()
    call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
    call SetTextTagPosUnitBJ(bj_lastCreatedTextTag, whichUnit, zOffset)
    call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)

    return bj_lastCreatedTextTag
endfunction

its function also contains 3 of more BJs do i need to write a native for it ot just write as it is?
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
If you check the functions inside the function, you can see what they do. Hint all of it could be done in the same function. Although in some cases its just easier to use the BJ functions. This one isn't really the case but certain functions are quite long and complicated to recreate on your own.
 

tooltiperror

Super Moderator
Reaction score
231
You need to create a new, faster function or just do the actions yourself in the function every time.

(I.E.)

JASS:

 function CreateTextTagUnit takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
     bj_lastCreatedTextTag=CreateTextTag()
     call SetTextTagText(bj_lastCreatedTextTag,s,size)
     call SetTextTagPosUnit(bj_lastCreatedTextTag,whichUnit,zOffset)
     call SetTextTagColor(bj_lastCreatedTextTag, red, green, blue, transparency)
     return bj_lastCreatedTextTag
 endfunction
 

envenger

Active Member
Reaction score
3
You need to create a new, faster function or just do the actions yourself in the function every time.

(I.E.)

JASS:

 function CreateTextTagUnit takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
     bj_lastCreatedTextTag=CreateTextTag()
     call SetTextTagText(bj_lastCreatedTextTag,s,size)
     call SetTextTagPosUnit(bj_lastCreatedTextTag,whichUnit,zOffset)
     call SetTextTagColor(bj_lastCreatedTextTag, red, green, blue, transparency)
     return bj_lastCreatedTextTag
 endfunction

thanks i started learning jass yesterday and now i can make easy spells

what does bj_lastCreatedTextTag does?



any way i was faster in gui but jass is better if i practice few more days
 

luorax

Invasion in Duskwood
Reaction score
67
bj_lastCreatedTextTag is a variable. It's used by BJ's to set the values of GetLastCreatedTextTag(), or GetLastCreatedUnit(), and so on. You can use a local variable instead of it. For example:

JASS:
function CreateTextTagUnit takes string s, unit whichUnit, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
     local texttag tt = CreateTextTag()
     call SetTextTagText(tt,s,size)
     call SetTextTagPosUnit(tt,whichUnit,zOffset)
     call SetTextTagColor(tt , red, green, blue, transparency)
     return tt
endfunction
 

tooltiperror

Super Moderator
Reaction score
231
No reason to use a local, it's a linear function that will be executed in a line, would be better to use a global.
 
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