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

Min/Max Range for Spells & Casting spells that require Channeling.


  • Please log in to reply
14 replies to this topic

#1
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

I'm working on a Varus script - And I can't quit figure out how to do his Q. IE: Should I find the mean? Another issue - Is actually "channeling" his Q to cast at max range.

I've attempted to look at other peoples scripts - And nothing seems to fit how his Q works. I've gotten a basic shell.

And form of assistance would be much appreciated. Thanks!


  • 0

#2
SMOOT

SMOOT

    Advanced Member

  • Members
  • 85 posts
  • LocationTurkey

http://gamingonstero...-documentation/


  • -1

#3
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

Yeah. I've read through the API. It doesn't have anything in it in regards to Min/Max Range (Just .range).   :(

Varus's Q has a minRange of 925 and a maxRange of 1625. But I'm only getting a ".range" of 925 period.


  • 0

#4
SMOOT

SMOOT

    Advanced Member

  • Members
  • 85 posts
  • LocationTurkey

I cant tell. Because my bad english.


  • 0

#5
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

So - At:

http://leagueoflegen....com/wiki/Varus

You can see right next to Piercing Arrow TARGET RANGE: 925 / 1625

 

Make sense?

In essence - You charge up his Q to deal more damage - And hit targets from further away.


  • 0

#6
Amnesie

Amnesie

    Advanced Member

  • Trial Developer
  • 259 posts
  • LocationParis

Doesn't his Q have a changing state you can use ?


  • 0

#7
SMOOT

SMOOT

    Advanced Member

  • Members
  • 85 posts
  • LocationTurkey
İ can do example tomorrow ( maybe ) İ'm in out of city.
  • 0

#8
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

Is it correct to assume that Spell Data can automatically be parsed with:

Q = { range = myHero:GetSpellData(_Q).range, delay = myHero:GetSpellData(_Q).delay, speed = myHero:GetSpellData(_Q).speed, width = myHero:GetSpellData(_Q).width }
E = { range = myHero:GetSpellData(_E).range, delay = myHero:GetSpellData(_E).delay, speed = myHero:GetSpellData(_E).speed, width = myHero:GetSpellData(_E).width }
R = { range = myHero:GetSpellData(_R).range, delay = myHero:GetSpellData(_R).delay, speed = myHero:GetSpellData(_R).speed, width = myHero:GetSpellData(_R).width }

I found this in a post from Proerd and I wanted to make sure.


  • 0

#9
Tocsin

Tocsin

    Advanced Member

  • Trial Developer
  • 476 posts

Cant you just do it time based? I mean it grows at a fixed rate on time right? it has a min and max distance and then cancels after a period of time

Min dist + x * t  ??

 

 

Just a thought while sitting here at work planning on what to eat for lunch lol


  • 2

#10
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

Cant you just do it time based? I mean it grows at a fixed rate on time right? it has a min and max distance and then cancels after a period of time

Min dist + x * t  ??

 

 

Just a thought while sitting here at work planning on what to eat for lunch lol

I was actually thinking that here today. Establish a local "qMinRange" and "qMaxRange" or something like that - And * by 4 (I think that is the time it takes to fully charge in secs).

That being said - I'm not entirely sure if/how attack speed effects that.

I'm new to coding Lua (I have SOME experience with Python, Java and the C platforms). So this is a new venture for me in learning. I took Pluralsights Lua course (linked below) - It didn't really teach me more than I already knew from other languages though. Lol

https://app.pluralsi...ble-of-contents

Either way - Ty for the assistance so far!


  • 0

#11
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

Note: I'm using "AlqoholicSkeleton.lua" and "EduAnnie.lua" as guidance. I also tried to use "LazyXerath.lua"'s Q logic. But it doesn't seem that they are similar in function to each other.


  • 0

#12
InsidiousQuack

InsidiousQuack

    Advanced Member

  • Contributor
  • 138 posts
  • LocationLondon

Taken directly from varus sourcecode for int that I didn't finish and didn't release:

 

local QCastData = {casting, starttime}

function CalcQRange(timer)
	local rangediff = skills.Q.maxRange - skills.Q.minRange
	local min = skills.Q.minRange

	local total = rangediff / 1.4 * timer + min

	if total > skills.Q.maxRange then total = skills.Q.maxRange end

	return total
end

function DrawQRange()
	if QCastData.casting then
		local timecasting = GetGameTimer() - QCastData.starttime
		local range = CalcQRange(timecasting)

		DrawCircle(GetOrigin(myHero), range, 1, 10, GoS.White)
	else
		DrawCircle(GetOrigin(myHero), skills.Q.minRange, 1, 10, GoS.White)
	end
end

OnUpdateBuff(function(unit, buff)
	if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
		QCastData.casting = true
		QCastData.starttime = GetGameTimer()
	end
end)

OnRemoveBuff(function(unit, buff)
	if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
		QCastData.casting = false
	end
end)


idk if it works anymore but it did at the time, i havent used int in months.

You'll also have to port it to EXT but that isn't hard.


  • 1

#13
Crazie

Crazie

    Advanced Member

  • Members
  • 48 posts

Taken directly from varus sourcecode for int that I didn't finish and didn't release:

 

local QCastData = {casting, starttime}

function CalcQRange(timer)
	local rangediff = skills.Q.maxRange - skills.Q.minRange
	local min = skills.Q.minRange

	local total = rangediff / 1.4 * timer + min

	if total > skills.Q.maxRange then total = skills.Q.maxRange end

	return total
end

function DrawQRange()
	if QCastData.casting then
		local timecasting = GetGameTimer() - QCastData.starttime
		local range = CalcQRange(timecasting)

		DrawCircle(GetOrigin(myHero), range, 1, 10, GoS.White)
	else
		DrawCircle(GetOrigin(myHero), skills.Q.minRange, 1, 10, GoS.White)
	end
end

OnUpdateBuff(function(unit, buff)
	if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
		QCastData.casting = true
		QCastData.starttime = GetGameTimer()
	end
end)

OnRemoveBuff(function(unit, buff)
	if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
		QCastData.casting = false
	end
end)


idk if it works anymore but it did at the time, i havent used int in months.

You'll also have to port it to EXT but that isn't hard.

Once things get smooth again with Ext - I'm going to try this! Thanks!


  • 0

#14
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

if activeSpell works as intended, here is an example :

math.min(1625, 925 + growth * (Game.Timer()-activeSpell.startTime))

growth is how much it grows for each sec and you would probably also remove the windupTime from the calculation as idk how startTime works.


  • 0

#15
LantusXR

LantusXR

    Advanced Member

  • Members
  • 43 posts
How to use API within GoS?
 
How to use API wHow to use API within GoS?

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users