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 


Set Enemy Position by Charakter Position and Rotation

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

Joined: 21 Aug 2016
Posts: 9

PostPosted: Thu Aug 24, 2017 2:19 pm    Post subject: Set Enemy Position by Charakter Position and Rotation Reply with quote

Hey Everyone Smile i have a problem.. a made a "Moblock" hack with ASM.
(All mob x & y are set to player POS.)

But that gives me a big problem.

I can't attack them..
So i want to set there pos in front of my charakter.

But i don't know how.
I have my POS (X,Y) and my view angle. (0-360 float).

How can i calculate the position where the mobs have to be (see image)

Hope you unterstand.. Smile

Thanks for any help! Smile

(Should be posible in ASM XD)



cheatengine.png
 Description:
Example
 Filesize:  7.1 KB
 Viewed:  5927 Time(s)

cheatengine.png


Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Thu Aug 24, 2017 3:48 pm    Post subject: Reply with quote

sounds like basic trig. cos angle = X, sin angle = Y based on a circle with a radius of 1, to make them further away you just multiply by whatever factor you want, since cos(45) = ~0.7 to get a distance of 3 you'd need to use a factor of 3/0.7=~4.3 eg. 4.3 * cos A = X, 4.3 * sin A = Y

If you can use library functions for cos / sin then that's simple enough (example I made up via googling (so may not be optimal/perfect but seemingly working), based on the tutorial: dropbox github), otherwise googling "x86 assembly cos sin" should get you some code


of course you could just arbitrarily subtract 3 from the x position which should place them 3 to the left of the player and just require you to turn left to kill them instead of always having them in front of wherever the player is looking.
Back to top
View user's profile Send private message
Dereta
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 9

PostPosted: Fri Aug 25, 2017 4:58 am    Post subject: Reply with quote

Thanks a lot! I was thinking that i need something like this..

But i was always scared of this (con, sin) because i thinking that there are to hard to learn.. (in the other hand math is my favorite subject area)

I'll try a little bit and watch how it works Smile thx a lot! Very Happy

Great
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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