Cheat Engine
The Official Site of Cheat Engine

Author Message
Dereta
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 9

Posted: Thu Aug 24, 2017 2:19 pm    Post subject: Set Enemy Position by Charakter Position and Rotation

Hey Everyone 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..

Thanks for any help!

(Should be posible in ASM XD)

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

FreeER
Grandmaster Cheater
Reputation: 32

Joined: 09 Aug 2013
Posts: 770

 Posted: Thu Aug 24, 2017 3:48 pm    Post subject: 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.
Dereta
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 9

 Posted: Fri Aug 25, 2017 4:58 am    Post subject: 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 thx a lot! Great
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 6 Hours Page 1 of 1

 Jump to: Select a forum Cheat Engine----------------Cheat EngineCheat Engine Lua ScriptingCheat Engine TutorialsGeneral GamehackingAuto Assembler tutorialsPointer tutorialsGame specific tutorialsWebbrowser stuff related tutorialsConsole ModdingLUA TutorialsLua Extensions General Discussions----------------General DiscussionsArtComputer TalkRandom spamArt RequestsArt TutorialsWillekeurige RotzooiGuestsHorse Excrement Cheat Requests----------------Single player cheat request Cheat Engine Downloads----------------TablesTrainersAuto Assemble scripts Coding----------------Cheat Engine SourceCETC Server and ClientsDBVMPlugin developmentGeneral programmingBinariesCrackmesGeneral programming+Game Development2D Graphics3D ModelingGameplay designWeb Development Games----------------Flash GamesGaia OnlineStick Arena
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