native for select player single?

Matrixboy

New Member
Reaction score
1
!= native.


You give it a unit, and you give it a player. The player you choose will then select that unit.

call SelectUnitForPlayerSingle(u,p)


where unit is the unit you want, and p is the player you want to select the unit.
 

jomik

New Member
Reaction score
17
@Jesus; maybe he didn't understand them, since it seems like he atleast misunderstood something :O So don't see why it's a problem to ask here...
 

Jesus4Lyf

Good Idea™
Reaction score
397
Hmm. Fair enough, it's just he's been asking a lot of simple questions, and it seems he hasn't read a few tutorials first. :(

Not that there's anything wrong with asking questions, but the consensus in the other threads is that he should read some tutorials. :)

I understand that he is new to JASS, also.
 

shiFt

Member
Reaction score
8
Ive done that matrix but it is highlighted in red, I thought it could be further converted to natives
 

Matrixboy

New Member
Reaction score
1
Ive done that matrix but it is highlighted in red, I thought it could be further converted to natives


A non-native is just a function that goes about calling a few other natives.

So, in our case, when you type call SelectUnitForPlayerSingle(u,p)
It's BASICALLY (no one with experience hark me down for this, I'm trying to explain it in non-technical, albeit technically wrong words) is "the line you just wrote" with "the line it stands for"

SelectUnitForPlayerSingle() STANDS for
JASS:
 if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call ClearSelection()
        call SelectUnit(whichUnit, true)
    endif


So, if you wanted to NOT use SelectUnitForPlayerSingle(), and instead "inline" it (a term we use for 'getting rid of the non-natives by "entering what they mean") you would "copy and paste" what "it stands for" and fill in the variables. (i.e. it says that "player whichplayer unit whichunit" in the function name when you copied it... right?)

So, you setup the variables
JASS:
player whichplayer = heyThisIsTheplayerIWantItToBe
unit whichunit =heyThisIsTheUnitIWantItToBe

And THEN place the code in.


____________________________________________

Almost all of the "non-natives" can be optimized in a way specific for you. They're built very generally and you can take many shortcuts for your specific uses-- but if you're new to this, I don't recommend trying that, and if you want to "Just Inline" then follow the above method.

Once you get a little better with your JASS, you'll end up optimizing it a lot for yourself, or leaving it the way it is (if you're satisfied.. believe it or not, some are okay! :p)
 
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