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 


Add offset to teleport script

 
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: Sat Sep 18, 2021 3:45 am    Post subject: Add offset to teleport script Reply with quote

Hi, how would you add an offset to this teleport script?
When i teleport, i'd like to be a bit offset to the actual coordinates.

Code:
[PlayerX]:
readmem([[["game.exe"+23F06C0]+38]+7E48]+90, 4)
[PlayerX]+4:
readmem([[["game.exe"+23F06C0]+38]+7E48]+94, 4)
[PlayerX]+8:
readmem([[["game.exe"+23F06C0]+38]+7E48]+98, 4)


Thanks in advance
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 Sep 18, 2021 4:33 am    Post subject: Reply with quote

Let me explain:
Code:

readmem([[["game.exe"+23F06C0]+38]+7E48]+90, 4)


The code above reads and or writes 4-bytes at the address defined by the pointer chain:
Code:

[[["game.exe"+23F06C0]+38]+7E48]+90


There is likely to be another section or entry of the script or cheat able which is responsible for deciding which value to write.
Back to top
View user's profile Send private message
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 124
Location: Migrating

PostPosted: Sat Sep 18, 2021 4:42 am    Post subject: Reply with quote

Assuming that the symbol PlayerX is just an address you're storing and teleporting to (old location?), just add what you want to those values after using readmem.

In this, 'my_offset' can just be another symbol the end user may alter in the table, if that's your goal instead of a definition. If you just want a static amount, this should work fine.

You can also use sub/other definitions considering this is coordinate-based, do what you need.

Code:

define(my_offset,3E8) //+1000
...

add [PlayerX],my_offset
add [PlayerX+8],my_offset
add [PlayerX+10],my_offset

_________________
Trying to learn!

Add me on Discord if you want hands-on help:
Birdi.
Back to top
View user's profile Send private message Visit poster's website
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

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

PostPosted: Sat Sep 18, 2021 5:12 am    Post subject: Reply with quote

Birdi, I believe the OP wants the value written to be a bit further. Not to be misconstrued with the actual term offset which is a value that is offset from a specific address. Only the OP can clarify on this since the post is somewhat ambiguous.
Back to top
View user's profile Send private message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Sat Sep 18, 2021 5:34 am    Post subject: Reply with quote

Hi experts, yes, i can see how it can be ambiguous.
I would like to add some points to the value itself in (float).
So instead of teleporting to, say Coord X 1000 float, i want to teleport always a couple more points to that, like 1000 + 30 float, this way i won't get stuck in the middle of stuff.
So i will try this

Code:
add [PlayerX],(float)30


and report back.
Thank you.

EDIT: adding

Code:
dd (float)50


did the trick, don't know why i didn't think of this before.
Thank you for the help fellas
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 Sep 18, 2021 8:17 am    Post subject: Reply with quote

Glad you resolved it Smile.
Back to top
View user's profile Send private message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Mon Sep 20, 2021 5:51 pm    Post subject: Reply with quote

Ended up using lua.

Code:
local PlayerXCoord = getAddress"[PlayerX]"
local PegXCoord = getAddress"[PegCoords]"
writeFloat(PlayerXCoord, readFloat(PegXCoord)+2)
[/code]
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 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