Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Prediction/Waypoints Library


  • Please log in to reply
5 replies to this topic

#1
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 621 posts
API:
WP_Moving(unit) - return boolean true/false - unit is moving or not

WP_Time(unit) - return number - last changed path, game time/ticks

WP_Path(unit) - return table with current path -WP_Path(unit)[1] - startpos,WP_Path(unit)[#WP_Path(unit)] - endpos

WP_DistOnPath(unit) - return number - current distance from startpos to unitpos ON PATH!

WP_TravelDist(unit) - return number - distance fromWP_Path(unit)[1] to WP_Path(unit)[2] + ... +WP_Path(unit)[#WP_Path(unit)-1] to WP_Path(unit)[#WP_Path(unit)]

WP_GetExtendedPointOnPath(unit, s) - return Extended Vector from unit to position on path

WP_InterceptionTime(source, startP, endP, unitspeed, spellspeed) - return Interception of Two Moving Objects, source - spell or player or ball etc. position, startp - unit position, endp - unit future position on path

WP_GetPredPointOnPath(source, unit, speed, width, delay) - return Predicted Position, source - object from, unit - object to

WP_ExtendedPosition(vec1, vec2, s) - return Extended Position from vec2 to vec1, s - distance

WP_NormalizeVector(vec) - return normalized Vector

WP_DistPointLineSegment(a, b, c) - return number - distance from segment line (a-b) to point (c)

WP_MCollision(source, castpos, range, speed, width, delay) - return table with collisionable minions, castpos - interception point. #WP_MCollision(source, castpos, range, speed, width, delay) -> collision count

WP_HCollision(source, unit, castpos, range, speed, width, delay) - return table with collisionable enemy heroes, unit - eliminate current target, castpos - interception point. #WP_HCollision(source, castpos, range, speed, width, delay) -> collision count
Examples:
-- EXTENDED MYHERO POSITION
require "gsopath"
OnDraw(function()
        local expos = WP_GetExtendedPointOnPath(myHero, 1000)
        if expos and expos.x then
                DrawCircle(expos, 30, 1, 1, GoS.White)
        end
end)

-- DRAW collisionable minions (red circle) + Predict Position for Ryze Q (white circle - if no collision)
require "gsopath"
local Q = { range = 1000, speed = 1700, width = 60, delay = 0.25 }
OnDraw(function()
        local unit = GetCurrentTarget()
        if unit and ValidTarget(unit, Q.range) then
                local predpos = WP_GetPredPointOnPath(myHero, unit, Q.speed, Q.width, Q.delay)
                if predpos and predpos.x then
                        if math.sqrt( (predpos.x-myHero.pos.x)^2 + (predpos.z-myHero.pos.z)^2 ) < Q.range - (Q.width/2) then
                                local mcolcount = WP_MCollision(myHero, predpos, Q.range, Q.speed, Q.width, Q.delay)
                                if #mcolcount > 0 then
                                        for i = 1, #mcolcount, 1 do
                                                DrawCircle(GetOrigin(mcolcount[i]), 30, 1, 1, GoS.Red)
                                        end
                                else
                                        DrawCircle(predpos, 30, 1, 1, GoS.White)
                                end
                        end
                end
        end
end)

-- CAST Ryze Q
require "gsopath"
local Q = { range = 1000, speed = 1700, width = 60, delay = 0.25 }
OnTick(function()
        CastQ()
end)
function CastQ()
        if not IsReady(_Q) then
                return
        end
        local unit = GetCurrentTarget()
        if unit and ValidTarget(unit, Q.range) then
                local predpos = WP_GetPredPointOnPath(myHero, unit, Q.speed, Q.width, Q.delay)
                if predpos and predpos.x then
                        if math.sqrt( (predpos.x-myHero.pos.x)^2 + (predpos.z-myHero.pos.z)^2 ) < Q.range - (Q.width/2) then
                                local mcolcount = WP_MCollision(myHero, predpos, Q.range, Q.speed, Q.width, Q.delay)
                                if #mcolcount == 0 then
                                        CastSkillShot(_Q, predpos)
                                end
                        end
                end
        end
end
 
Library: https://github.com/g...mon/gsopath.lua

Edited by gamsteron, 22 December 2016 - 04:26 .

  • 5

#2
OxideSon

OxideSon

    Advanced Member

  • Donator
  • 642 posts

when gamsteron pred release  Kappa


  • 0

#3
pleb

pleb

    still not banned :K

  • Donator
  • 426 posts
  • Locationlithuania

gj


  • 0

#4
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 621 posts

added Minion Collision, Enemies-Heroes Collision, Distance Point from line segment.

 

So now this is Prediction Library not only Waypoints :)


  • 1

#5
jouzuna

jouzuna

    Advanced Member

  • Contributor
  • 73 posts

gj dude :)


  • 0

#6
KevinVz09

KevinVz09

    Newbie

  • Members
  • 1 posts

gj


  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users