Prioq Posted April 18, 2020 Share Posted April 18, 2020 Is it possible to toggle the hydra aim lock based on the targeted vehicle driver's team ? If so can you please link me all the needed functions and events. Thanks in advance. Link to comment
Moderators IIYAMA Posted April 18, 2020 Moderators Share Posted April 18, 2020 (edited) 3 hours ago, Prioq said: Is it possible to toggle the hydra aim lock based on the targeted vehicle driver's team ? If so can you please link me all the needed functions and events. Thanks in advance. Nope, unless you make the lock system yourself. I can give you a list of functions and events for that, if you so desire. But it is not a project for beginners. Edited April 18, 2020 by IIYAMA Link to comment
Prioq Posted April 18, 2020 Author Share Posted April 18, 2020 5 minutes ago, IIYAMA said: Nope, unless you make the lock system yourself. I can give you a list of functions and events for that, if you so desire. I'd be grateful. Link to comment
Moderators IIYAMA Posted April 18, 2020 Moderators Share Posted April 18, 2020 (edited) 2 hours ago, Prioq said: I'd be grateful. bindKey getElementMatrix getDistanceBetweenPoints3D findRotation3D --https://wiki.multitheftauto.com/wiki/FindRotation3D getTickCount createProjectile "onClientRender" "onClientPreRender" --(timeSlice benefit) function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end Just one of the concepts you can use: This function allows you to calculate the distance between a line and a point. This can be very powerful, when you combine that with getPositionFromElementOffset, because that function allows you create offset points from the vehicle. These offset points can be used to create a line in front of you, which you can use to compare the distance between all vehicles. Now you will able to exclude most of the vehicles behind you. Be creative, there a lot of options out there to do the same based on other mathematics calculations like rotation. (which you can also include as another layer) local getDistanceBetweenPointAndSegment3D = function (pointX, pointY, pointZ, x1, y1, z1, x2, y2, z2) -- vector1 -- local A = pointX - x1 local B = pointY - y1 local C = pointZ - z1 -- -- vector2 -- local D = x2 - x1 local E = y2 - y1 local F = z2 - z1 -- local point = A * D + B * E + C * F local lenSquare = D * D + E * E + F * F local parameter = point / lenSquare local shortestX local shortestY local shortestZ if parameter < 0 then shortestX = x1 shortestY = y1 shortestZ = z1 elseif parameter > 1 then shortestX = x2 shortestY = y2 shortestZ = z2 else shortestX = x1 + parameter * D shortestY = y1 + parameter * E shortestZ = z1 + parameter * F end local distance = getDistanceBetweenPoints3D(pointX, pointY,pointZ, shortestX, shortestY,shortestZ) return distance end Another concept: You can just simple use getDistanceBetweenPoints3D on a point in front of you. If you make the detection size 300 units and you do it 300 units in front of you. You will be able to capture all vehicles in front of you inside of a giant circle. > From that segment you can use getDistanceBetweenPoints3D again to compare the vehicle distance from the hydra and all other vehicles and this time you use a detection size of 150 units. Edited April 18, 2020 by IIYAMA 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now