Page 1 of 1

LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:16 am
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

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:27 am
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.

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:32 am
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.

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:45 am
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.

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:47 am
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

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 11:54 am
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.

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 12:30 pm
by zweihard
ty ty, I shall give it a shot

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 1:14 pm
by ++METHOS
If you need any help, just ask. :mrgreen:

Re: LUA Script for Animation Cancels in Dark Souls I

Posted: Thu Mar 30, 2017 10:14 pm
by zweihard
I might have to take you up on that offer since I'm a complete noob!