Results 1 to 8 of 8

Thread: ActionImmediate_Ping

  1. #1
    Basic Member
    Join Date
    Oct 2016
    Posts
    170

    ActionImmediate_Ping

    Hey, does anyone know how we can get the location of a unit or simply a vector from X units infront of a unit for passing to the ActionImmediate_Ping function?
    eg. ActionImmediate_Ping(npcBot:GetLocation(), npcBot:GetLocation(), true) doesnt work for the obvious reason that it gives coords along both planes, but the function wants them seperated.
    the way it is set up you must use a table, etc with pre defined ping spots??

    Also, it is spelled wrong on the Wiki.

  2. #2
    Basic Member
    Join Date
    Jan 2017
    Posts
    25
    npcBot:GetLocation().x, npcBot:GetLocation().y ?

  3. #3
    Basic Member
    Join Date
    Oct 2016
    Posts
    170
    Ive never seen commands used like that before, except the .x for calling a table in another file.
    is that a theory or how would i use that if it works?
    simply as: ActionImmediate_Ping(npcBot:GetLocation().x, npcBot:GetLocation().y, true) ??

  4. #4
    Basic Member
    Join Date
    May 2014
    Posts
    227
    GetLocation() return Vector that consist of x,y,z coordinate. To access / get the x,y,or z value you simply doing that. Or you can use a variable like
    local bot_location = npcBot:GetLocation(). Then if you want to get the x value do like this bot_location.x, it' s the same.

  5. #5
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,678
    Quote Originally Posted by Yavimaya View Post
    is that a theory or how would i use that if it works?
    simply as: ActionImmediate_Ping(npcBot:GetLocation().x, npcBot:GetLocation().y, true) ??
    It is not a theory, it is the way it works. insraq is right. The signature of the function is:
    Code:
    Action_ImmedaitePing( fXCoord, fYCoord, bNormalPing )
    That means the first param must be a float as well as the second and the purpose of each is to be the X and Y coord of a 2D plane (third axis being the height which is irrelevant for a ping).
    Threfore, the correct way is to use GetLocation().x and .y, respectively.

    As for this:
    Quote Originally Posted by Yavimaya View Post
    Ive never seen commands used like that before, except the .x for calling a table in another file.
    You are prolly referring to nostrademous bot (or others that use that technique) which is not SOMETHING.X but X.SOMETHING and that is an alias which is a totally different thing altogether.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    609
    Quote Originally Posted by The Nomad View Post
    You are prolly referring to nostrademous bot (or others that use that technique) which is not SOMETHING.X but X.SOMETHING and that is an alias which is a totally different thing altogether.
    You can also do npcBot:GetLocation()[1] which is the same thing as npcBot:GetLocation().x (b/c they named the key values as well as numbering them).

  7. #7
    Basic Member
    Join Date
    Oct 2016
    Posts
    170
    Quote Originally Posted by The Nomad View Post
    It is not a theory, it is the way it works. insraq is right. The signature of the function is:
    Code:
    Action_ImmedaitePing( fXCoord, fYCoord, bNormalPing )
    That means the first param must be a float as well as the second and the purpose of each is to be the X and Y coord of a 2D plane (third axis being the height which is irrelevant for a ping).
    Threfore, the correct way is to use GetLocation().x and .y, respectively.

    As for this:

    You are prolly referring to nostrademous bot (or others that use that technique) which is not SOMETHING.X but X.SOMETHING and that is an alias which is a totally different thing altogether.
    ive looked through so many scripts i couldnt tell you who used it, but i have seen once the .x used, but yes x. gets used heaps in many peoples scripts.
    Thanks, thats all i was asking, i understood it needed a float but didnt know how to seperate each variable out of the location result and it wasnt made clear that .x and .y was the way to do it.... he posed it as a question to me, not a statement.

    Thanks again for the replies.
    just got to add "ping" to KOTLs recall so you get some warning of where you are going, etc. if you arent paying attention.
    Last edited by Yavimaya; 04-04-2017 at 05:28 PM.

  8. #8
    Basic Member
    Join Date
    Oct 2016
    Posts
    170
    Speaking of all thing Ping, is there a way to find out if "GetMostRecentPing()" was on a unit ?

    i have added "ping for ward placement" to my script but can not separate the on unit "attack this guy" ping from the on ground pings.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •