Users browsing this thread: 1 Guest(s)
Making a Command cast a single spell

#1
Posts: 6
Threads: 3
Thanks Received: 0
Thanks Given: 7
Joined: May 2020
Reputation: 0
Status
Twincast
Hello Hi everyone I'm new to FF6 hacking and I want to make a command that casts a spell similar to what the health and shock commands do. I made it so Control casts my spell but when a character uses it they: 
Walk forward, Walk forward again, Do the spell, and then not walk all the back.
I based the code on this thread (specifically C-Dude's first post) 

Is the double walk forward a bug or a specific issue with the spell I'm casting, If not is there anyway to fix it.
  Find
Quote  

#2
Posts: 138
Threads: 2
Thanks Received: 137
Thanks Given: 15
Joined: Apr 2015
Reputation: 18
Status
None
What are you using for your spell? Some animations have the step forward built in, so you would need to disable it.
  Find
Quote  
[-] The following 1 user says Thank You to Everything for this post:
  • Febreeze (08-11-2020)

#3
Posts: 6
Threads: 3
Thanks Received: 0
Thanks Given: 7
Joined: May 2020
Reputation: 0
Status
Twincast
(08-11-2020, 11:51 AM)Everything Wrote: What are you using for your spell? Some animations have the step forward built in, so you would need to disable it.

It's a custom spell animation I made FF3usMe it is built off of the shock animation.


I can't figure out how I would get rid of the built in step forward. Is there an easy to get rid of it.
  Find
Quote  

#4
Posts: 138
Threads: 2
Thanks Received: 137
Thanks Given: 15
Joined: Apr 2015
Reputation: 18
Status
None
This will be tricky because Shock uses a special animation for stepping forward. Right now you're using the generic step forward for a normal spell, followed by the Shock animation. So you get two steps forward but only one step back.

C-Dude's tutorial assumes that you're using a normal spell. Since you're using Shock you might want to take a different approach for the animation.

Which spell animation index did you modify in FF3usME for your custom spell? Was it 130 (Megahit/Shock) or something else? Did you just modify the values in FF3usME, or did you also modify the animation script in a hex editor?
  Find
Quote  
[-] The following 1 user says Thank You to Everything for this post:
  • Febreeze (08-11-2020)

#5
Posts: 6
Threads: 3
Thanks Received: 0
Thanks Given: 7
Joined: May 2020
Reputation: 0
Status
Twincast
(08-11-2020, 01:28 PM)Everything Wrote: This will be tricky because Shock uses a special animation for stepping forward. Right now you're using the generic step forward for a normal spell, followed by the Shock animation. So you get two steps forward but only one step back.

C-Dude's tutorial assumes that you're using a normal spell. Since you're using Shock you might want to take a different approach for the animation.

Which spell animation index did you modify in FF3usME for your custom spell? Was it 130 (Megahit/Shock) or something else? Did you just modify the values in FF3usME, or did you also modify the animation script in a hex editor?

Sorry for the late response I assigned Control to cast 129 (which was 7 Flush) Then modified 129. I modified the values in FF3usMe. In FF3usME 129 looks like this:

Idx: 8080       Pal. 0: 0
Idx: 01C9       Pal. 1: 238
Idx: FFFF       Pal. 2: 0
Idx: 0080
SFX: 80
Byte 10: 09
Speed: 16
  Find
Quote  

#6
Posts: 138
Threads: 2
Thanks Received: 137
Thanks Given: 15
Joined: Apr 2015
Reputation: 18
Status
None
Okay, here's something you can try. Instead of hijacking the normal spell animation code you're going to modify the code for Control to make it look more like Shock.

Follow everything in C-Dude's tutorial except the last step.

Code:
C1/B791:    54 BB        (0E)        (Control)

Leave this as 54 BB. Don't change it to EB AB like in C-Dude's tutorial.

Next, modify the animation code for Control to make it look just like Shock (for reference, the code for Shock is at C1/BB49).

Code:
Modify the code at C1/BB54 to this:

C1/BB54: 20 F7 BB     JSR $BBF7
C1/BB57: 90 05        BCC $BB5B    ; fix branch distance
C1/BB59: A9 39        LDA #$39
C1/BB5B: 20 E1 BB     JSR $BBE1    ; change subroutine to match Shock
C1/BB5E: 60           RTS          ; RTS and NOP for padding
C1/BB5F: EA           NOP
C1/BB60: EA           NOP
C1/BB61: EA           NOP

Last, change the animation data pointer for Control to instead point at 7-Flush.

Code:
C2/B530: 18 16       ; change this to 0E 07 (calculated from 129 * 14 = 1806 = 0x070E)

As an alternative to the last step, you can avoid overwriting the vanilla 7-Flush animation data and instead modify the animation data for Control to match what you put into FF3usME. I don't think this can be done in FF3usME though, you would have to do it with a hex editor (For some reason the animation editor in FF3usME only goes up to 255 and Control is at 404).

Code:
Modify animation data for Control to the following:

D0/95CA: 80 80                    sprite script $0080: Shock (sprite)
D0/95CC: C9 01                    bg1 script $01C9 Riot Blade (bg1)
D0/95CE: FF FF                    no bg3 script
D0/95D0: 00                       sprite palette 0
D0/95D1: EE                       bg1 palette 238
D0/95D2: 00                       bg3 palette 0
D0/95D3: 80                       default sound effect 128
D0/95D4: 09                       init function 9
D0/95D5: 80 00                    extra script $0080: Shock (sprite)
D0/95D7: 10                       delay 16

Hopefully I got all that right. Let me know how it works.
  Find
Quote  
[-] The following 2 users say Thank You to Everything for this post:
  • Febreeze (08-11-2020), xDaygo (08-11-2020)

#7
Posts: 6
Threads: 3
Thanks Received: 0
Thanks Given: 7
Joined: May 2020
Reputation: 0
Status
Twincast
It took me a little bit to do it but your code works thanks for the help! Victory

the control command still does control I'm not sure why though.
  Find
Quote  

#8
Posts: 242
Threads: 19
Thanks Received: 101
Thanks Given: 105
Joined: Dec 2018
Reputation: 18
Status
Moog
(08-11-2020, 04:14 PM)Febreeze Wrote: It took me a little bit to do it but your code works thanks for the help! Victory

the control command still does control I'm not sure why though.

Did you remember to re-point Control's battle function at C2/19E3 away from its original code to your new freespace code?  It sounds like you changed the animation and not the pointer.  Remember that it's little-endian, and that your new code has to be in C2.

EDIT: @Everything, I think that the animation called for Control might be in the FF3USME Battle Editor (the one with Terra swinging a sword on the button). That's where I found other command animations, like the one for Terra's Morph and the one for Possess.
  Find
Quote  
[-] The following 2 users say Thank You to C-Dude for this post:
  • Everything (08-11-2020), Febreeze (08-11-2020)

#9
Posts: 138
Threads: 2
Thanks Received: 137
Thanks Given: 15
Joined: Apr 2015
Reputation: 18
Status
None
(08-11-2020, 08:28 PM)C-Dude Wrote: EDIT: @Everything, I think that the animation called for Control might be in the FF3USME Battle Editor (the one with Terra swinging a sword on the button).  That's where I found other command animations, like the one for Terra's Morph and the one for Possess.

Aha, you're right! Control is number 45 under "Animations 2".

Make sure to do all the other steps in C-Dude's tutorial except the last one. That's what changes the actual effect of the attack.
  Find
Quote  
[-] The following 1 user says Thank You to Everything for this post:
  • Febreeze (08-11-2020)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite