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 


(SOLVED) Teleporting to waypoint script

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

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Dec 22, 2020 3:37 am    Post subject: (SOLVED) Teleporting to waypoint script Reply with quote

Hi experts, i managed to successfully do a teleport to waypoint.
The way i find the coordinates is by doing an injection, write the X coord into a symbol "coordswaypoint" then add 4 to get Y and another 4 to Z.

This is all fine and well as normal, but the issue is that, in order to teleport to those coordinates, i need to manually copy/paste the values in "coordswaypoint" into "[coordsplayerpointer]+50" and 54.
Then i have to lock the value, and only when i move i get teleported.

Im looking for help to do a script to copy the values from
"coordswaypoint" into "coordsplayerpointer". Z is ignored because waypoint gives an invalid (always 20) value.

Going to try to represent in pseudo code what i would like to do:
Code:

[ENABLE]
[coordsplayerpointer]+50:
dd (float)[coordswaypoint]
[coordsplayerpointer]+54:
dd (float)[coordswaypoint]

[DISABLE]


Thanks.


Last edited by careca777 on Wed Dec 23, 2020 8:05 am; edited 1 time in total
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3329

PostPosted: Tue Dec 22, 2020 4:29 am    Post subject: Reply with quote

To do this right, you need to do a few things.

1. Find a hook.
Prefer one that reads the coordinates the most frequently.

2. Set up hotkeys
Jump to your codecave from your hook and create placeholders for a number of actions like: save and restore.

3. Fill in the actual code
Flesh out the instructions to save and restore coordinates.

Since you already have the coordinates, you can probably omit 'save' feature unless of course you would like to save your current coordinates for easy return.
Back to top
View user's profile Send private message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Tue Dec 22, 2020 9:17 am    Post subject: Reply with quote

Hi, thanks for the reply.

As far as the hook goes, i tried to find one that would only write into these addresses, i used some that were heavily used and it caused crashes and stuff.

I understand your point, i think i do, but im failing to see how that approach automates the placing of the waypoint coordinates into the addresses for the player or whatever.
This is my problem, i don't know enough to be able to write a script in such a way that it would use the symbols.

So basically i need to set the value from a symbol into another symbol.
Symbol CoordPlayer = 1234(float)
Symbol CoordWaypoint = 567(float)

Lets say I got those, now how do i make it so the value 567 gets written into coordplayer? I was thinking a script that writes it until i unfreeze it.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3329

PostPosted: Tue Dec 22, 2020 11:09 am    Post subject: Reply with quote

Make sure the code you hook is running only for the player.
Or, make sure to implement a valid player check to filter out everything else.

This is how I am doing it in Death Standing:
1. Have the coding competed (as directed above).
2. Have the locations added in an array, something like this:
Code:
pDestinations:
//////////////////////////////////////////////////////////
// Set your destination coordinate triplets below.      //
//////////////////////////////////////////////////////////
// 0:Last saved coordinates
dd 0
dd 0
dd 0
// 1:Capital Knot City
dd (float)1443.239258
dd (float)772.6335449
dd (float)148.1146545

3. Have the location indexes added to the cheat table into a combobox, so user can select the one they want.
E.g.
Code:
0:Last saved coordinates
1:Capital Knot City

4. Back in your code, you read/write the coordinates from/to the appropriate index when a hotkey is hit.


Last edited by Csimbi on Wed Dec 23, 2020 8:14 am; edited 1 time in total
Back to top
View user's profile Send private message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Wed Dec 23, 2020 8:01 am    Post subject: Reply with quote

Im very close to getting this done, i feel the issue now is probably syntax or something like that. So i got 2 codes, one works, the other doesn't, the one that doesn't is the one that i would like to get working because would be dynamic.

What works? addresses that are the result of coordsplayerpointer+50 and coordswaypoint+10 copied into this script:

Code:
[ENABLE]
24B5CD3D540:
readmem(24B62CACA60, 12)
[DISABLE]


What should work? Code that gets the addresses dynamicaly:

Code:
[ENABLE]
coordsplayerpointer+50:
readmem(coordswaypoint+10, 12)
[DISABLE]


Hope this makes my query clearer.

EDIT: Exactly after posting i figured it out, it was the brackets!

This works as expected, retrieves the addresses from the right places and writes into the right place:

Code:
[ENABLE]
[coordsplayerpointer]+50:
readmem([coordswaypoint]+10, 12)
[DISABLE]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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