Locked Home » Forums » Legacy & Archived » Archived Content » Vanguard » VGExtreme Requests

GetBehind() for rogues : VGExtreme Requests

Posted: May 29th, 2007
User avatar
Total Posts:21 Joined:2007
I've tried numerous methods of getting behind a target reliably, and the best I've come up with is breaking the compass into quadrants (0-90, 90-180, 180-270, 270-360) and change my math based on approach vector. It has been suggested to just get mob heading, and player heading then compare the two and run through the target, but this isn't very effective due to no report of your target size, stealth breaking and some targets being treated like a wall in game physics.

Stealth has more of a chance of being detected if you're in front of the target. So even utilizing quadrants and applying X-Sin(Direction) * quadrant_dynamic_calc, Y-Cos(Direction) * 100 sometimes you'll end up running directly through the front of the target and appear/get attacked immediately. My loop of course exits if this happens (by calculating startHP and endHP variables to make sure we aren't being hit), but I lose a lot of damage without having ravage as my opener. I'm not mathematically inclined enough to plot a course to approach on a curve away from my target, nor do I think it'd be a smart idea because of cliffs and other objects that you can jump off of, but not climb back up.

Any ideas welcome, even the most far-out ones like adding a third dimension and calculating azimuth/elevation. Making this thread a think tank would be splendid.

Easiest way, for people to improve on:

Code: Register to unlock hidden link

RunScript "includes\VGService.vbs"
RunScript "includes\navigation.vbs"

Sub MoveToMoreAccurate(x,y) ' ripped from navigation.vbs
    'Attempt to move to mob for 5 seconds
    for i = 1 to 67 'Short move to target will abort if we get stuck
        if (VG.navigation.MoveTo (X, Y,100,true) = true) then ' changed to 100 from 400
            exit for
        end if
        sleep 75
    next
    VG.navigation.StopMovement(&H26)
end Sub

Function GetMobHeading(mob)
    on error resume next
        GetMobHeading = Mob.Heading
    on error goto 0
End Function

VGWindow = Windows.FindWindowByTitle("Vanguard: Saga of Heroes")
ShowWindow VGWindow
Sleep 500
FocusWindow VGWindow
Sleep 500

TX = GetTargetX - Sin(GetMobHeading(GetTarget)) * 100 ' needs revising -- not always absolutely "behind"
TY = GetTargetY - Cos(GetMobHeading(GetTarget)) * 100

Log.DebugLog "Target is at:" & GetTargetX & ", " & GetTargetY & " facing " & Int(GetMobHeading(GetTarget))
Log.DebugLog "Our destination is:" & Int(TX) & ", " & Int(TY)

Call MoveToMoreAccurate(TX,TY)

Ready to join the community? Click here and see all of the benefits!
blue large dotWho is online
Users browsing this forum: No registered users and 2 guests