[STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
2 Attachment(s)
i made this function cuz i want make skills like a league of legends.
Thanks to javalia. (helped to solve my question) Update log 03 07 2013 - Changed function name, add to negativeangle Code:
stock bool:IsTargetInSightRange(client, target, Float:angle=90.0, Float:distance=0.0, bool:heightcheck=true, bool:negativeangle=false) |
Re: [STOCK] Target is exist in client's angle and distance
cool, good job
|
Re: [STOCK] Target is exist in client's angle and distance
Nice, very useful
|
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
it's pretty cool! but it doesn't check whether there is an obstacle between the two players or not, does it? well, since cassiopeia's ult doesn't do that too, i guess it's fine.
@edit: oh, since i think that you would be using this several times to detect all the players that are in range of someone, you would like to have it optimized. so, i recommend you using the third parameter of GetVectorDistance set as true, which will return a value without square rooting and, then, square the distance of your function. square rooting isn't as easy as a multiplication. also, checking the distance vector between the two players before doing anything else would be nice too, because it wouldn't do the angle calculation unnecessarily. if resultdistance(squared) is > distance(squared), nothing else matters, return it false right away. |
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
Should make it draw tes too o:
|
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
Quote:
i'll be fix. i'm a trial period now. :( so i don't have a many times. |
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
Thanks for this
Found this by google'ing client view cone |
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
I've made a stock like this too. The only problem with this and mine is that it does not take into account the different yaw and pitch angles of a clients fov which will lead to false positives. (e.g. A players fov might be 70 degrees but due to their resolution their yaw angle will be different thus they do not truly see 70 degrees in both axis)
I've had a couple ideas to increase the accuracy but none were satisfactory for me. I guess it all depends on how accurate you want it to be. There's even obstruction by models to consider where as using its bounding box to check if there is true obstruction may not even work if the model in question has collision via vphysics. GGWP Summoner. |
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
Not sure if this thread is still alive, I was thinking that if someone would able to code it that it look on sight correctly that is not behind the walls, and also while not looking up or downwards
|
Re: [STOCK] Target is exist in client's angle and distance (03/07/2013 Ver 1.1)
Thank you very much. Was very useful for me.
|
All times are GMT -4. The time now is 15:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.