Jump to content

Convert mouse window X/Y to Diablo II world X/Y


 Share

Recommended Posts

Bump, again ;)

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

http://img183.imageshack.us/my.php?image=xydistbp8.jpg Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

I haven't played in almost a year, this is a nice blast from the past ;)

Thanks, best wishes to you too.

Posted Image

Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

Just because I was thinking about this during math class. We were talking about the Unit circle again.

The next edited screenshot makes more sense then yours. I don't know how Diablo II world coordinates are calculated, so I am still guessing in the dark.

Posted Image

Or with a 45 degree angle: ( Cos(Alpha+0.5*pi) , Sin(Alpha+0.5*pi) ) in radians.

Here is my futile attempt at calculating the angle from a non-zero center and an other position, using the mouse in this case. Does anyone know how to properly do this?

$pi = 3.14159265358979

$CenterX = @DesktopWidth/2
$CenterY = @DesktopHeight/2

While 1
    $MouseX = MouseGetPos(0)
    $DifferenceX = ( 0.5 - ( $MouseX / @DesktopWidth) ) * 2
    ToolTip(Int(ACos($DifferenceX)/$pi*180),$CenterX,$CenterY)
WEnd
Edited by Manadar
Link to comment
Share on other sites

Manadar, if you play USWest I can get you some better items; if you'd like ;)

EDIT:

Diablo II world coordinates work how I showed in the picture, that's how the grid system works.

Edited by Insolence
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

  • 2 weeks later...
Link to comment
Share on other sites

why dont you move the diablo window to 1,1 so it will be easyer 2 get cords? :lmao:

also dont forget that if your desktop pixels are most of the time are set bigger then diablos pixels...

800x600 or 600x480 :evil: this some times will cause the cords 2 to changes...

you also factor in: CaretCoordMode, MouseCoordMode

sry if i seem like im calling you a noob or anythin i just want to hlep you out ;)

Edited by Golbez
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...