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
396
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.
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    and then it was Thursday...
    +2
  • tom_mai78101 tom_mai78101:
    And then Monday
    +1
  • The Helper The Helper:
    I got the day off today!
    +1
  • tom_mai78101 tom_mai78101:
    How...? (T-T)
  • The Helper The Helper:
    I took the day off. I work for myself so I can do that.
    +1
  • Varine Varine:
    Well I'm already over summer
  • jonas jonas:
    varine! good to see you
  • jonas jonas:
    what's going on, what's got you going
  • The Helper The Helper:
    good to see you varine hope you are well my friend

    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