Jump to content

Range between two players


Ordush

Recommended Posts

Hey all

I have been looking through the ObjectManager, i can't seem to find anything.

Is there a way to check range between two units? i.e. Party1 and Party2?

I know that a player has to be near them to check their range, but i just want it to do this:
if range between Party1 and Party2 < 5 return true else return false.
Obviously it will return false if the player can't see party1 and party2. ?

Perhaps @Droidz knows if the units party1-4 is implemented in the ObjectManager? I know that his fightclass editor, can heal party. ?

Edited by Ordush
Link to comment
Share on other sites

2 hours ago, Ordush said:

Hey all

I have been looking through the ObjectManager, i can't seem to find anything.

Is there a way to check range between two units? i.e. Party1 and Party2?

I know that a player has to be near them to check their range, but i just want it to do this:
if range between Party1 and Party2 < 5 return true else return false.
Obviously it will return false if the player can't see party1 and party2. ?

Perhaps @Droidz knows if the units party1-4 is implemented in the ObjectManager? I know that his fightclass editor, can heal party. ?

            WoWPlayer one = new WoWPlayer();
            WoWPlayer two = new WoWPlayer();

            // Get distance between 2 objects
            float distance = one.Position.DistanceTo(two.Position);

If you are looking for party stuff take a look at "wManager.Wow.Helpers.Party"
Hope i understood the question right ?

Do you want to be able to check if the whole group is near or just one of them?

Edited by iMod
Link to comment
Share on other sites

1 minute ago, iMod said:

            WoWPlayer one = new WoWPlayer();
            WoWPlayer two = new WoWPlayer();

            // Get distance between 2 objects
            float distance = one.Position.DistanceTo(two.Position);

If you are looking for parts stuff take a look at "wManager.Wow.Helpers.Party"
Hope i understood the question right ?

cool so use GUID which i get with Party and then check position between the two GUIDs?

Link to comment
Share on other sites

7 minutes ago, Ordush said:

cool so use GUID which i get with Party and then check position between the two GUIDs?

The Party namespace offers you a whole object list of the player so you just need to select 2 player and use the DistanceTo property of the position property.of the WoWPlayer object you selected.

But yeah you also can use the guid.

Edited by iMod
Link to comment
Share on other sites

6 minutes ago, iMod said:

The Party namespace offers you a whole object list of the player so you just need to select 2 player and use the DistanceTo property of the position property.of the WoWPlayer object you selected.

But yeah you also can use the guid.

I can't seem to be able to get the units from the Party namespace ?

I am on Vanilla, not sure if it makes a difference. ?

Link to comment
Share on other sites

2 minutes ago, Zan said:

@iMod are you getting errors in VS using DistanceTo? My projects are all red when I use it. Even using it inside .Order it gives an error.

Nah i'm lucky i don't had to update any of my projects after updates since yet and DistanceTo is working for me (WOTLK)
What kind of error do you get?

Edited by iMod
Link to comment
Share on other sites

20 minutes ago, iMod said:

Nah i'm lucky i don't had to update any of my projects after updates since yet and DistanceTo is working for me (WOTLK)
What kind of error do you get?

It just shows up in Red. I do use resharper but I thought I put ignore error for it. I'll screen shot it after I get home from work. I use it on 7.1.5 private server btw.

Link to comment
Share on other sites

4 minutes ago, Zan said:

It just shows up in Red. I do use resharper but I thought I put ignore error for it. I'll screen shot it after I get home from work. I use it on 7.1.5 private server btw.

Just hover with your mouse over the red text and tell me the error message wich should pop up ?

Link to comment
Share on other sites

1 hour ago, Zan said:

It just shows up in Red. I do use resharper but I thought I put ignore error for it. I'll screen shot it after I get home from work. I use it on 7.1.5 private server btw.

I had the same issue until i used WoWPlayer. ?

Link to comment
Share on other sites

20 hours ago, iMod said:

Nah i'm lucky i don't had to update any of my projects after updates since yet and DistanceTo is working for me (WOTLK)
What kind of error do you get?

I went through and referenced other versions of WRobot' s wManager and found Wrath was good, Cata, MoP, WoD, and Legion were all red. The error I'm getting is "cannot resolve symbol". I changed .net versions but that didn't help either. I even tried every suggestion online to possibly correct it. But it does compile for me. It's odd.

17 hours ago, Ordush said:

I had the same issue until i used WoWPlayer. ?

I get the error using DistanceTo with WowPlayer and WowUnit. Basically anytime DistanceTo is used.

Edited by Zan
Link to comment
Share on other sites

Just now, Zan said:

I went through and referenced other versions of WRobot' s wManager and found Wrath was good, Cata, MoP, WoD, and Legion were all red. The error I'm getting is "cannot resolve symbol". I changed .net versions but that didn't help either. I even tried every suggestion online to possibly correct it. 

I get the error using DistanceTo with WowPlayer and WowUnit. Basically anytime DistanceTo is used.

Weird.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...