+ Reply to Thread
Results 1 to 11 of 11

  Click here to go to the first Rift Team post in this thread.   Thread: Out of range detection question

  1. #1
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default Out of range detection question

    I have a problem while writing the out of range detection for my addon, the only thing that I can write is line of sight detection, you can say that's a buggy out of range detection because the environment is complex and most of the times there is something in the way that triggers the line of sight event so is it seems that my non existent out of range detection works but it isn't (of course, it doesn't exists!, you can say).

    I can't use the "Inspect.Ability.Detail" because i don't always have a target selected and probably won't be the correct unit

    Just to explain why i need that, i wrote an healbot clone and knowing the out of range status is an useful thing to have

    Also i can see that the default raid frame shows that the player is out of range, but way far from 35m which is the maximum range of the healing spells, i can prove that if needed, but is not a big problem, knowing that someone is out of range is more than enough, i need only that

    I can wait patch 1.8 (when i will have coordinates) but if someone knows how to do that on 1.7 would be great
    Last edited by Rompa; 03-19-2012 at 04:41 PM.

  2. #2
    Plane Touched
    Join Date
    Jan 2011
    Posts
    281

    Default

    I've only played very little with the system so far, but shouldn't Event.Ability.Range give you exactly what you need?

  3. #3
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default

    Thanks but,For that to work you have to target the unit you want to find if it's in range, i can't target everyone to see if it's in range

  4. #4
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    What about using your coords, the unit's coords, and a bit of Pythagoras?

    If you are at {px, py, pz}, and the unit is at {ux, uy, uz}, then something like:

    math.sqrt( (ux-px) * (ux-px) + (uy-py) * (uy-py) + (uz-pz) * (uz-pz) )

    Should give you the range to the unit...

    This is off the top of my head, but something roughly like that should work. Square root is a very expensive operation, so you'd actually want to drop that and compare the squared value against (35*35) in code, but the basic idea should work.

    I've been meaning to knock up a simple target range finder addon, but haven't got round to it yet.
    Last edited by DoomSprout; 03-20-2012 at 04:20 AM.

  5. #5
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default

    Quote Originally Posted by DoomSprout View Post
    What about using your coords, the unit's coords, and a bit of Pythagoras?

    If you are at {px, py, pz}, and the unit is at {ux, uy, uz}, then something like:

    math.sqrt( (ux-px) * (ux-px) + (uy-py) * (uy-py) + (uz-pz) * (uz-pz) )

    Should give you the range to the unit...

    This is off the top of my head, but something roughly like that should work. Square root is a very expensive operation, so you'd actually want to drop that and compare the squared value against (35*35) in code, but the basic idea should work.

    I've been meaning to knock up a simple target range finder addon, but haven't got round to it yet.
    Yes, i'm sorry but my question was... can i do that in 1.7?

  6.   This is the last Rift Team post in this thread.   #6
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by Rompa View Post
    Yes, i'm sorry but my question was... can i do that in 1.7?
    No, but you can do that in 1.8.

    There's no good way to accomplish what you're looking for in 1.7, but the new functionality is live on the PTS right now. Develop your addon there and it will work when 1.8 is released.

  7. #7
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Rompa View Post
    Yes, i'm sorry but my question was... can i do that in 1.7?
    Ah, OK. I answered before you edited your question to specify that. I don't think there is a way to do it until 1.8 unfortunately (though it's so close now, I'd just wait myself )

    Edit: and Zorba confirmed while I was still typing... I'm obviously getting too old and slow for this ;)
    Last edited by DoomSprout; 03-20-2012 at 04:49 AM.

  8. #8
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default

    Quote Originally Posted by ZorbaTHut View Post
    No, but you can do that in 1.8.

    There's no good way to accomplish what you're looking for in 1.7, but the new functionality is live on the PTS right now. Develop your addon there and it will work when 1.8 is released.
    Yes thanks a lot, i was planning to wait for 1.8 api, i was only wondering if there was a way to do it in 1.7 that I was missing.
    Thanks for the response, sorry to bother you, in the end was only a curiosity

  9. #9
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default

    Quote Originally Posted by DoomSprout View Post
    Ah, OK. I answered before you edited your question to specify that. I don't think there is a way to do it until 1.8 unfortunately (though it's so close now, I'd just wait myself )

    Edit: and Zorba confirmed while I was still typing... I'm obviously getting too old and slow for this ;)
    the question from the start was :
    I can wait patch 1.8 (when i will have coordinates) but if someone knows how to do that on 1.7 would be great
    It's the last line

    Sorry for not explaining more my question like i must have done

  10. #10
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    Quote Originally Posted by Rompa View Post
    the question from the start was :
    I can wait patch 1.8 (when i will have coordinates) but if someone knows how to do that on 1.7 would be great
    It's the last line
    Oops, my bad then, sorry. I guess I didn't read it properly first time. I think I need more coffee ;)

    Your healbot addon sounds interesting - are you planning to publish it, or is it a personal project?

  11. #11
    Shadowlander Rompa's Avatar
    Join Date
    Apr 2011
    Posts
    37

    Default

    Quote Originally Posted by DoomSprout View Post
    Oops, my bad then, sorry. I guess I didn't read it properly first time. I think I need more coffee ;)

    Your healbot addon sounds interesting - are you planning to publish it, or is it a personal project?
    For now it's on riftui, it's called RiftHbot http://riftui.com/downloads/info213-RiftHbot.html,

    Minervah and I are working on that to make it like vuhdo, that is the goal

+ Reply to Thread

Bookmarks

Posting Permissions

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