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 


I need help making a script for Spyro 2

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Unicorngoulash
Newbie cheater
Reputation: 0

Joined: 19 Apr 2018
Posts: 19
Location: Netherlands

PostPosted: Wed Oct 24, 2018 10:08 pm    Post subject: I need help making a script for Spyro 2 Reply with quote

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
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Thu Oct 25, 2018 12:26 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Unicorngoulash
Newbie cheater
Reputation: 0

Joined: 19 Apr 2018
Posts: 19
Location: Netherlands

PostPosted: Thu Oct 25, 2018 4:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Unicorngoulash
Newbie cheater
Reputation: 0

Joined: 19 Apr 2018
Posts: 19
Location: Netherlands

PostPosted: Wed Oct 31, 2018 7:39 am    Post subject: Reply with quote

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&#255 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
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Wed Oct 31, 2018 8:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Unicorngoulash
Newbie cheater
Reputation: 0

Joined: 19 Apr 2018
Posts: 19
Location: Netherlands

PostPosted: Wed Oct 31, 2018 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Wed Oct 31, 2018 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4297

PostPosted: Wed Oct 31, 2018 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Thu Nov 01, 2018 4:20 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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