View previous topic :: View next topic |
Author |
Message |
MindCaged Newbie cheater Reputation: 0
Joined: 25 Apr 2013 Posts: 10
|
Posted: Tue Apr 28, 2015 8:52 am Post subject: Override a table entires value change/display. |
|
|
Okay, so say you're playing a game where a given value is say the actual value + 10 to prevent cheaters or something, is there a way to maybe put code in the cheat table where even though the value in that address is say 110, it'll display 100? And vice versa, where if somebody changes it to 100 it'll set the value in the address to 110? I realize a custom type could maybe do this, but is there a way to make one specific to a cheat list and not globally defined, or just not use a custom type and like have events or something? So it'll call certain functions to figure out what to display and call another function when the value is attempted to be set. I'm not sure if there's any events for this because there's quite a few details of CE that aren't properly documented and if they are documented it's hard to find the documentation.
Idealiy it'd be cool if you could assign a getValue and setValue function to a cheat entry or something.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Apr 28, 2015 2:50 pm Post subject: |
|
|
Right-click the address and click select Set/Change dropdown selection options
Enable:
Disallow manual user input
Only show the description part
Make the record display values like the dropdown list
The all you have to do is add every possible value
Code: | 100:110
101:111
102:112 |
|
|
Back to top |
|
|
MindCaged Newbie cheater Reputation: 0
Joined: 25 Apr 2013 Posts: 10
|
Posted: Tue Apr 28, 2015 7:39 pm Post subject: |
|
|
Okay, all I can say is /ouch/, that'd be really tedious, also what if it was like a 4 byte integer? That'd be pretty much impossible to set every value.
Zanzer wrote: | Right-click the address and click select Set/Change dropdown selection options
Enable:
Disallow manual user input
Only show the description part
Make the record display values like the dropdown list
The all you have to do is add every possible value
Code: | 100:110
101:111
102:112 |
|
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Apr 28, 2015 7:43 pm Post subject: |
|
|
Yea, it was more a joke.
Only way I know of would be to create a custom form and use Lua.
Add 10 before writing the value to memory.
Subtract 10 before displaying the value to the user.
Edit: You know, I've never actually heard of CE's custom types before.
But, this seems like it should work if you do decide to go with that approach.
Code: | typename="My Type"
bytecount=4
functionbasename="mytype"
function mytype_bytestovalue(b1,b2,b3,b4)
return byteTableToDword({b1, b2, b3, b4}) - 10
end
function mytype_valuetobytes(i)
return unpack(dwordToByteTable(i + 10))
end
return typename,bytecount,functionbasename |
Edit 2: And I see your problem. The custom type isn't saved to the table.
I'm not even certain where it was saved. Not seeing any other modified files in CE's folder.
|
|
Back to top |
|
|
MindCaged Newbie cheater Reputation: 0
Joined: 25 Apr 2013 Posts: 10
|
Posted: Wed Apr 29, 2015 9:03 am Post subject: |
|
|
It's saved in the registry I believe.
Edit:There's a regsiterCustomTypeLua function for registering a custom type, I'm not sure if it only works in the main file or if you could put it in a table, and I'm not sure how it'd react to the code not being there when you start CE. I don't know if it could save just those functions to the registry, or if it'd expire when the table was closed or CE was restarted.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Apr 29, 2015 10:59 pm Post subject: |
|
|
That function appears to only register the custom type until you close Cheat Engine.
So if you execute the Lua script on load or in some table script, you can provide your users with the type.
Code: | registerCustomTypeLua("CustType", 4,
function(b1,b2,b3,b4)
return byteTableToDword({b1, b2, b3, b4}) - 10
end,
function(i)
return unpack(dwordToByteTable(i + 10))
end) |
|
|
Back to top |
|
|
|