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 


[Help] Add float to a float

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sat May 10, 2014 12:31 am    Post subject: [Help] Add float to a float Reply with quote

This saves my x, y and z coordinates.
How do i change my script so that it saves lets say my coordinates +10
(current Z = 1234.235555 add +10 = 1244.235555)
I've tried add [z],(float)10 but that just changes my coordinates to something weird like -2.54846917E-35

Code:
mov [save],0
push ecx
mov ecx,[[[["game.exe"+0182E124]+120]+10]+98]
mov [x],ecx
mov ecx,[[[["game.exe"+0182E124]+120]+10]+9C]
mov [y],ecx
mov ecx,[[[["game.exe"+0182E124]+120]+10]+A0]
mov [z],ecx
pop ecx
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sat May 10, 2014 4:00 am    Post subject: Reply with quote

If you operate with float values, use float instructions.

First you should allocate 4 bytes to store float 10, eg

inc:
dd (float)10

Then your code should look like

fld [originalvalue]
fadd [inc]
fstp [originalvalue]

If you want to see a working example, just look up one of my Angry Birds scripts where I have made cheats to increased/decrease the co-ordinates.

(Btw this section is for tutorials, not questions.)

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
lamafao
Expert Cheater
Reputation: 1

Joined: 17 Apr 2013
Posts: 130

PostPosted: Sat May 10, 2014 9:15 am    Post subject: Reply with quote

Quote:
(Btw this section is for tutorials, not questions.)

Didn't know that sorry.
Also your example works, thanks!

Code:
mov ecx,[[[["game.exe"+0182E124]+120]+10]+A0]
mov [z],ecx
fld [z]
fadd [inc]
fstp [z]
pop ecx
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 Gamehacking 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