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 


Not sure how to word this or search for it

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Retroboy85
How do I cheat?
Reputation: 0

Joined: 13 May 2022
Posts: 7

PostPosted: Sat Oct 28, 2023 2:25 am    Post subject: Not sure how to word this or search for it Reply with quote

Is it possible to have CE to automatically set to a value and keep it that way rather than it change depending on the in game value when the code isnt enabled.

Not sure how to word it exactly, so maybe I will try describe what I am doing.

I would like to have a Infinite Health Bar, but as you progress your health bar increases, so I would like to give the player the option to have Infinite Health or Infinite/Max Health.

But when you start a new game with nothing enabled, because it is the same address, the values default to its current in game value, as do every other cheat addresses.

How do you set CE it lock each cheat address' values to what you set them as and they not default back to the in game value when its not activated.

I thought this used to do this, save the values you put in each cheat address so that when you come to load your game up again and your CT file, your "cheat" values are remembered rather than defaulting back.

So I have sat and found values for every item in a game, added each item as an option to enable, but found now each single address now defaults back to FFFF rather than the ID value.

Wouldnt this be the main point of CE, to search for addresses and save them into a table and it remember the values you have set each cheat address as, so you can simply turn them on/off like for example an Action Replay or GameShark?
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1069
Location: 0x90

PostPosted: Sat Oct 28, 2023 5:15 am    Post subject: Reply with quote

You need to find the struct which holds both the current and maximum health for example, say RAX holds the player struct and at playerBase+0x8 is the maximum health, we just preserve the value in RBX whilst we use it to write the maximum health to it, then move the value from rbx to playerBase+0x4 which is the current health before finally restoring the RBX register:
Code:

...
newmem:
   push rbx
   mov rbx,[rax+8] // max health
   mov [rax+4],rbx // current health
   pop rbx
...


This way, no matter what your maximum health value, it will always write it as the current health.

As for your other question. Memory addresses are dynamic which change whether by loading a new level, or restarting the game. To combat this you can use AOB injection scripts or pointers.
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