LUA Script for Animation Cancels in Dark Souls I

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
zweihard
Noobzor
Noobzor
Posts: 10
Joined: Thu Mar 30, 2017 10:55 am
Reputation: 0

LUA Script for Animation Cancels in Dark Souls I

Post by zweihard »

Hi,

I'd like to know if this is possible and would ideally like a hand in making this script. There's a script which flags up animation ids when they're being played. It can also play out animations if you put in the specific animation id. This will override any animation currently being performed. What I'd like to achieve is a script that when a specific animation plays, it gives you the chance to override that specific animation with a dummy animation so you can cancel the animation.

Thanks

User avatar
++METHOS
Administration
Administration
Posts: 275
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 94

Re: LUA Script for Animation Cancels in Dark Souls I

Post by ++METHOS »

zweihard wrote:
Thu Mar 30, 2017 11:16 am
when a specific animation plays, it gives you the chance to override that specific animation with a dummy animation
-Gives you a chance in what way?

If you want the animation ID to automatically change to something else when the animation ID matches a value that you have predetermined, then that is easy enough. If you are wanting the game to pause while a window pops up, allowing the user to choose the animation (or something similar), then that is more involved, but still doable...albeit, probably not very practical.

zweihard
Noobzor
Noobzor
Posts: 10
Joined: Thu Mar 30, 2017 10:55 am
Reputation: 0

Re: LUA Script for Animation Cancels in Dark Souls I

Post by zweihard »

This essentially: [Link]

When I do a gesture, I cancel it with a roll. As it stands I can cancel any animation at any time. I want the ability to cancel the gesture animations at any time with another animation but only gestures.

So yes, the first method that you mention is what I want to do.

User avatar
++METHOS
Administration
Administration
Posts: 275
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 94

Re: LUA Script for Animation Cancels in Dark Souls I

Post by ++METHOS »

[enable]
//stuff
label(animation_id)
registersymbol(animation_id)

newmem:
cmp [register+offset],#gestureID1 //compare against gesture ID values...
je @f
cmp [register+offset],#gestureID2
je @f
cmp [register+offset],#gestureID3
je @f
cmp [register+offset],#gestureID4
je @f
jmp originalcode

@@:
cmp dword ptr [animation_id],0 //for 4 byte value
je originalcode
push edi
mov edi,[animation_id]
mov [register+offset],edi
pop edi
jmp originalcode

//originalcode

animation_id:
dd 0 //for 4 byte value

//stuff

[disable]
//stuff
unregistersymbol(animation_id)
Once script is activated, add an address to your table, manually, and put animation_id in the address field. Assign hotkeys for the various animation ID's.

User avatar
++METHOS
Administration
Administration
Posts: 275
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 94

Re: LUA Script for Animation Cancels in Dark Souls I

Post by ++METHOS »

If you want the value to automatically change, you can set it up like this:
[enable]
//stuff

newmem:
cmp [register+offset],#gestureID1 //compare against gesture ID values...
je @f
cmp [register+offset],#gestureID2
je @f
cmp [register+offset],#gestureID3
je @f
cmp [register+offset],#gestureID4
je @f
jmp originalcode

@@:
mov [register+offset],#whateverID

//originalcode

//stuff

[disable]
//stuff

User avatar
++METHOS
Administration
Administration
Posts: 275
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 94

Re: LUA Script for Animation Cancels in Dark Souls I

Post by ++METHOS »

By the way, these are for assembly scripts, no Lua...but the same can be done with Lua. If you require Lua, someone else will have to chime in.

zweihard
Noobzor
Noobzor
Posts: 10
Joined: Thu Mar 30, 2017 10:55 am
Reputation: 0

Re: LUA Script for Animation Cancels in Dark Souls I

Post by zweihard »

ty ty, I shall give it a shot

User avatar
++METHOS
Administration
Administration
Posts: 275
Joined: Thu Mar 02, 2017 9:02 pm
Reputation: 94

Re: LUA Script for Animation Cancels in Dark Souls I

Post by ++METHOS »

If you need any help, just ask. :mrgreen:

zweihard
Noobzor
Noobzor
Posts: 10
Joined: Thu Mar 30, 2017 10:55 am
Reputation: 0

Re: LUA Script for Animation Cancels in Dark Souls I

Post by zweihard »

I might have to take you up on that offer since I'm a complete noob!

Post Reply

Who is online

Users browsing this forum: No registered users