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 


Values always truncated when using lua custom types.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Smellyhobo101
Newbie cheater
Reputation: 0

Joined: 21 Sep 2014
Posts: 23

PostPosted: Fri May 20, 2016 10:42 pm    Post subject: Values always truncated when using lua custom types. Reply with quote

If my bytestovalue function is like this:

Code:

function customvaluetype3_bytestovalue(b1,b2,b3,b4,address)
return 5.5
end


Cheat engine table will display the value "5" instead of "5.5". Any way to make it not truncate the value?

Edit:

Ended up using an auto assembler custom type instead with "UsesFloat" on.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat May 21, 2016 5:01 am    Post subject: Reply with quote

you have to add this way:

Code:
function myType_bytestovalue(b1,b2,b3,b4,address)
  return 5.5
end

function myType_valuetobytes(f,address)
  return 0,0,0,0
end

registerCustomTypeLua('myType', 4, myType_bytestovalue, myType_valuetobytes, true)



CE won't save it, you have to re-add this type every time (you can use autorun folder for this) you launch CE.

_________________
Back to top
View user's profile Send private message MSN Messenger
Smellyhobo101
Newbie cheater
Reputation: 0

Joined: 21 Sep 2014
Posts: 23

PostPosted: Sat May 21, 2016 5:41 pm    Post subject: Reply with quote

Thanks. Thats a lot easier than using AA types.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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