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


  • This topic is locked This topic is locked
9 replies to this topic

#1
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 931 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://pastebin.com/3FWSZb73


Edited by gamsteron, 21 September 2018 - 07:37 .

  • 4

#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
  • 931 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

#7
Kypo

Kypo

    Advanced Member

  • Members
  • 400 posts

ty ;)


  • 1

#8
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 931 posts

ty ;)

 

Hello Kypo :)

https://pastebin.com/3FWSZb73


  • 1

#9
Kypo

Kypo

    Advanced Member

  • Members
  • 400 posts

Yo ;) you're doing good. Sad I don't have much time to help the community :(


  • 0

#10
gamsteron

gamsteron

    Advanced Member

  • Scripts Developer
  • 931 posts

Yo ;) you're doing good. Sad I don't have much time to help the community :(

 

I have time :)

Last 3 days i was working 12 hours per day on prediction. L# port on my pc.

https://pastebin.com/raw/h1cxbmT5

https://i.imgur.com/KOlnckE.png

 

i need to get all slow, stun, dash buffs/spells -> gos ext buff types broken

 

example irelia E used on dummy target:

myHero Buff 6 ireliapassivestacks
myHero Buff 3.5167236328125 IreliaE
enemy BUFF: 0.75 Stun
enemy BUFF: 5 ireliamark


  • 1




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users