 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
lamafao Expert Cheater
Reputation: 1
Joined: 17 Apr 2013 Posts: 130
|
Posted: Sat May 10, 2014 12:31 am Post subject: [Help] Add float to a float |
|
|
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 |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Sat May 10, 2014 4:00 am Post subject: |
|
|
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.) _________________
|
|
Back to top |
|
 |
lamafao Expert Cheater
Reputation: 1
Joined: 17 Apr 2013 Posts: 130
|
Posted: Sat May 10, 2014 9:15 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|