Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


problem with player angle

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Project Eula
How do I cheat?
Reputation: 0

Joined: 16 Jan 2019
Posts: 7

PostPosted: Tue Oct 20, 2020 2:36 pm    Post subject: problem with player angle Reply with quote

Good afternoon everyone, please someone so kind explain to me why the following problem occurs, I am creating a trainer and the problem is that when the chicken moves the angle is distorted a minimum of 1 to 2 degrees, so it is impossible target the chicken why does this problem occur? Is the formula for calculating the distance not correct? I leave you my formula to calculate angle and distance. Someone so kind to explain.
The player's Z sight position has a minimum of (float -60) and a maximum of (float 60)
The position of the player's X sight has a rotation of 360º minimum 0 maximum 360º
floating values

j_x =readFloat(x.player);-- jugador X
j_y =readFloat('y.player');-- jugador Y
j_z =readFloat('z.player');-- jugador Z
---------------------------
e_x =readFloat('x.chiken');-- enemigo X
e_y =readFloat(y.chiken);-- enemigo Y
e_z =readFloat(z.chiken');-- enemigo Z

sus_X = ((j_x)-(e_x))-- Calculate the distance X between the player and the chicken
sus_Y = ((j_y)-(e_y))--Calculate the distance Y between the player and the chicken
angle = -math.atan2 ( -sus_X,-sus_Y)* (180 / 3.14159265359)

print(angle)--- calculate angle X

=====================================
============= calculate player Z angle

Raiz_Z =math.sqrt(((j_x - e_x) * (j_x - e_x)) + ((j_y - e_y) * (j_y - e_y)) + ((j_z - e_z) * (j_z - e_z)))
angulo_Z =-math.atan2( (j_z)-(e_z),Raiz_Z)* (180/ 3.14159265359)
print(angulo_Z )--get the Z angle of the player
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites