View previous topic :: View next topic |
Author |
Message |
Unicorngoulash Newbie cheater Reputation: 0
Joined: 19 Apr 2018 Posts: 19 Location: Netherlands
|
Posted: Wed Oct 24, 2018 10:08 pm Post subject: I need help making a script for Spyro 2 |
|
|
Ok, here's the deal. I finally found the no collision address for Spyro 2 but only want to activate it when Spyro is gliding.
Spyro gliding is 16
Spyro No Collision is 1
Whenever this address ePSXe.exe+AEC060 =16
I want this address ePSXe.exe+AEC115 to become 1
What would be the easiest and simplest way to do this ?
It'd be really useful for me to have an example of this.
|
|
Back to top |
|
|
OldCheatEngineUser Whateven rank Reputation: 20
Joined: 01 Feb 2016 Posts: 1587
|
Posted: Thu Oct 25, 2018 12:26 am Post subject: |
|
|
Code: | newmem:
push eax
mov eax,dword ptr [ePSXe+AEC115]
cmp dword ptr [ePSXe+AEC060],10
cmovz eax,[newvalue]
mov dword ptr [ePSXe+AEC115],eax
pop eax
jmp return
code:
// ...
newvalue:
dd 1
return: |
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
|
Unicorngoulash Newbie cheater Reputation: 0
Joined: 19 Apr 2018 Posts: 19 Location: Netherlands
|
Posted: Thu Oct 25, 2018 4:17 am Post subject: |
|
|
You're a lifesaver. Took me years to find this particular code. I'm very persistent at finding stuff haha. However.., I'm not so good at scripting.
I had to tweak it to make it work but after many trials and errors with the script you posted I now got it to work.Thank you!
|
|
Back to top |
|
|
Unicorngoulash Newbie cheater Reputation: 0
Joined: 19 Apr 2018 Posts: 19 Location: Netherlands
|
Posted: Wed Oct 31, 2018 7:39 am Post subject: |
|
|
Hey, is there a way to specify two values in one adress instead of writing an entire new line?
Code:
newmem:
push eax
mov eax,dword ptr [ePSXe+AEC115]
cmp dword ptr [ePSXe+AEC060],10 <---- (10&11ÿ for example)
Instead of
newmem:
push eax
mov eax,dword ptr [ePSXe+AEC115]
cmp dword ptr [ePSXe+AEC060],10
cmp dword ptr [ePSXe+AEC060],11
cmp dword ptr [ePSXe+AEC060],255
or cmp dword ptr [ePSXe+AEC060],activate on anything between 10&255 or higher than 10.
I think I'm making things way harder than they should be, there should be a simple way to do this.
|
|
Back to top |
|
|
predprey Master Cheater Reputation: 24
Joined: 08 Oct 2015 Posts: 486
|
Posted: Wed Oct 31, 2018 8:00 am Post subject: |
|
|
If I understand correctly you want to compare the DWORD at [ePSXe+AEC060]?
Code: |
newmem:
push eax
push ebx
mov eax,dword ptr [ePSXe+AEC115]
mov ebx,[ePSXe+AEC060]
sub ebx, 10
cmp ebx, 245
pop ebx
ja @f
//Do whatever you want to activate your cheat here
@@:
//Original Code here/Exit code cave
|
|
|
Back to top |
|
|
Unicorngoulash Newbie cheater Reputation: 0
Joined: 19 Apr 2018 Posts: 19 Location: Netherlands
|
Posted: Wed Oct 31, 2018 8:35 am Post subject: |
|
|
newmem:
push eax
mov eax,dword ptr [ePSXe+AEC115]
I'd like to have these 3 lines be 1 single line
cmp dword ptr [ePSXe+AEC060],1
cmp dword ptr [ePSXe+AEC060],2
cmp dword ptr [ePSXe+AEC060],3
cmovz eax,[newvalue for ePSXe+AEC115]
mov dword ptr [ePSXe+AEC115],eax
pop eax
jmp return
newvalue for ePSXe+AEC115:
dd #10
return:
[ePSXe+AEC060] controls what happens to [ePSXe+AEC115]
So if [ePSXe+AEC060]=,1,2,3 it should change [ePSXe+AEC115] to 10.
But instead of writing and copying 3 lines to do that I think I'm missing a simple symbol to make it easy.
I'm now doing this which does work but doesn't seem practical.:
cmp dword ptr [ePSXe+AEC060],1
cmp dword ptr [ePSXe+AEC060],2
cmp dword ptr [ePSXe+AEC060],3
Instead I'd like to see something like if cmp dword ptr [ePSXe+AEC060] is 1 or 2 or 3 turn [ePSXe+AEC115] to 10
|
|
Back to top |
|
|
predprey Master Cheater Reputation: 24
Joined: 08 Oct 2015 Posts: 486
|
Posted: Wed Oct 31, 2018 8:54 am Post subject: |
|
|
Using cmp consecutively erases the flags from the previous cmp, so probably some bugs in your code there.
If all you want is for the code to activate when 10<=[ePSXe+AEC060]<=255, that is what the code posted above does. Fill in the activation part yourself.
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4297
|
Posted: Wed Oct 31, 2018 10:56 am Post subject: |
|
|
That can't be encoded in a single instruction, and as predprey said, you need to test the flags immediately after each comparison.
However, if the values are contiguous (i.e. 1-3), you could do something like this:
Code: | mov eax,[ePSXe+AEC060]
sub eax,1
cmp eax,2
jbe @f |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
OldCheatEngineUser Whateven rank Reputation: 20
Joined: 01 Feb 2016 Posts: 1587
|
Posted: Thu Nov 01, 2018 4:20 am Post subject: |
|
|
do what the users mentioned, in other words ... use more conditions.
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
|
|