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 


Possible Bug - writeFloat

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Oct 05, 2021 3:16 pm    Post subject: Possible Bug - writeFloat Reply with quote

Hi, im experiencing a possible bug, where this code:

Code:
[ENABLE]
{$lua}
if syntaxcheck then return end
local PlayerXCoord = getAddress"[PlayerX]"
local WaypointXCoord = getAddress'[["Game.exe"+1CD8EB8]+D0]+4B8'
writeFloat(PlayerXCoord+0, readFloat(WaypointXCoord+0))
writeFloat(PlayerXCoord+4, readFloat(WaypointXCoord+4))
writeFloat(PlayerXCoord+8, -200)
local PlayerX=AddressList['X PTR']
PlayerX.Active=true
local PlayerY=AddressList['Y PTR']
PlayerY.Active=true
local PlayerZ=AddressList['Z PTR']
PlayerZ.Active=true
local t=createTimer()
t.Interval=3000
t.OnTimer=function()
  memrec.Active=false
  t.destroy()
end
PlayerX.Active=false
PlayerY.Active=false
PlayerZ.Active=false
[DISABLE]


Grabs a coordinate from the waypoint, for example:
-1699.386475
and writes that value into PlayerX+4
which becomes
386475

It's like it only copies the value past the decimal point.
Only i restart CE it works fine again.
What could cause this? Is it an error in the code?
X coordinate acts up too, sometimes.



Screenshot 2021-10-05 220544.png
 Description:
 Filesize:  18.69 KB
 Viewed:  1192 Time(s)

Screenshot 2021-10-05 220544.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Tue Oct 05, 2021 5:55 pm    Post subject: Reply with quote

try cleaning your code first.
e.g all the addresslist part can go as you activate and imeadiately deactivate

and try using writeInteger(xxxx,readInteger(xxx)) instead. Both types are 4 bytes anyhow


it's also possible the write happens at the same time the game is writing

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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