Users browsing this thread: 1 Guest(s)
Harp Weapon Tutorial
(06-28-2020, 01:10 AM)SSJ Rick Wrote: oh wow, that's a pretty interesting outcome
well I can tell you that a lot of weapons tend to reuse and recycle frames/tiles
and strangely enough, a few weapons even share a few pixels as well , like an outline of one of shadow's weapons shares an outline with a misc sword (I don't remember off the top of my head)
I certainly wasn't expecting to get the harp in one piece. I just need to figure out how to get it in the right place, and I should be good. I also managed to use the GP Rain as a projectile as well (though it fires like a dart) but it's almost looking like a legitimate weapon from the game!
06-28-2020, 11:12 AM
I'm glad you got the graphics working. A lot of times trial and error is the best way to figure out how something works! You can get the "Battle Animation Scripts" file here: https://www.ff6hacking.com/wiki/doku.php...s:doc:game
Here's the script at D0/7EF9
You can edit the bytes at D0/7F01 and D0/7F03 to change the harp's position. Here's another doc on the wiki that gives better descriptions of most of these commands: https://www.ff6hacking.com/wiki/doku.php...ion_script
Here's the script at D0/7EF9
Code:
D0/7EF9: 00 20 speed 1, align to center of character/monster
D0/7EFB: 8E 01 show animation on weapon-hand side of character/monster sprites
D0/7EFD: 81 12 06 change attacker graphic to 18 (walking forward, frame 2) if facing left or 6 (walking forward, frame 3) if facing right
D0/7F00: 83 68 move forward 9
D0/7F02: 83 2B move down 12
D0/7F04: 8F 61 move forward 2 if mirrored
D0/7F06: BF 03 71 jump to subroutine $7103
D0/7F09: C9 00 play default sound effect
D0/7F0B: 89 08 loop start (8 times)
D0/7F0D: 83 81 move back 2
D0/7F0F: 00 [$00]
D0/7F10: 83 61 move forward 2
D0/7F12: 00 [$00]
D0/7F13: 8A loop end
D0/7F14: 81 04 06 change attacker graphic to 4 (walking forward, frame 1) if facing left or 6 (walking forward, frame 3) if facing right
D0/7F17: FF end of script
You can edit the bytes at D0/7F01 and D0/7F03 to change the harp's position. Here's another doc on the wiki that gives better descriptions of most of these commands: https://www.ff6hacking.com/wiki/doku.php...ion_script
(06-28-2020, 11:12 AM)Everything Wrote: You can edit the bytes at D0/7F01 and D0/7F03 to change the harp's position. Here's another doc on the wiki that gives better descriptions of most of these commands: https://www.ff6hacking.com/wiki/doku.php...ion_scriptThank you very much for your help, Everything! I may not be able to understand the Battle Animation commands (I don't know how to translate "$" into bytes so I can edit them in the hex editor) but relying on my improvisational skills. I changed the first byte of D0/7F01 from 83 to A4 and that put the harp in the desired position. It did indeed change the punch animation as well, but I'm not concerned with learning how to fix that (It's not distracting to the gameplay anyway)
I also used FFusME and used the attack animation of 39, which is the coin in GP Rain and set it to Atma wpn. Gfx (because the note was transparent otherwise)
Thank you for showing me where the scripts are. I barely can understand it, but here are the codes I found for GP and Music Note
Code:
; [ Animation Script $0039: GP Rain (sprite) ]
D0/65D4: 00 20 speed 1, align to center of character/monster
D0/65D6: 85 move to attacker position
D0/65D7: DB 06 branch to $65DF if character already stepped forward to attack
D0/65D9: 83 77 move forward 24
D0/65DB: 89 07 loop start (7 times)
D0/65DD: 1F [---]
D0/65DE: 8A loop end
D0/65DF: 80 72 01 branch to $65E3 if attack hit
D0/65E2: FF end of script
D0/65E3: C9 00 play default sound effect
D0/65E5: 94 93 calculate vector from attacker to a random location on target
D0/65E7: 08 [$08]
D0/65E8: 00 [$00]
D0/65E9: 92 08 03 move along vector at speed 8, branch to $65E8
D0/65EC: 89 07 loop start (7 times)
D0/65EE: 87 81 move target back 2
D0/65F0: 00 [$00]
D0/65F1: 87 61 move target forward 2
D0/65F3: 00 [$00]
D0/65F4: 8A loop end
D0/65F5: FF end of script
; [ Animation Script $0270: Music Note Hit (bg1) ]
D0/0635: 00 20 speed 1, align to center of character/monster
D0/0637: D1 01 invalidate character/monster sprite priority
D0/0639: 85 move to attacker position
D0/063A: 95 calculate vector from attacker to target
D0/063B: C9 00 play default sound effect
D0/063D: 80 5D command $80/$5D
D0/063F: 98 04 02 increment frame offset every 4 loops (0..2)
D0/0642: 00 [$00]
D0/0643: 92 02 08 move along vector at speed 2, branch to $063D
D0/0646: 80 4E clear frame offset
D0/0648: 80 5D command $80/$5D
D0/064A: BF 2F 07 jump to subroutine $072F
D0/064D: FF end of script
In a pure guess, I just copied the coding from the Music Note Hit to GP Rain (and adding "FF"s to fill in the extra space) and I indeed have attack animation working for the note!
However I do have a couple issues with the animation:
- The note animates before my character steps forward to attack. It is a slight annoyance, but I was hoping to find a way to delay the attack just fraction of a second so the character has time to get ready before the note comes out the first time.
- My other problem is the sprite flickers (Most likely due to the fact that it needs TWO sprites, and GP rain only has ONE) Is there a way to either load the note graphic from the Music Note Hit animation, or perhaps load a sprite from somewhere else and combine that with the graphic that I used for GP Rain?
06-28-2020, 05:50 PM
The "$" prefix just means that the number is in hexadecimal. That's the symbol that assembly language compilers usually use, but it's the same as the prefix "0x" or the suffix "h" (i.e. $3F, 0x3F, and 3Fh all mean 63 in decimal). They're just different conventions.
If you need the animation to pause for a fraction of a second, you can insert an empty loop. I think the best place to do this will probably be either before or after "play default sound effect" command at D0/063B. An empty loop consists of four bytes, 89 xx 1F 8A, where xx is the number of frames to wait. There is an example of this in the GP Rain script at D0/65DB. There's another way to add a pre-animation delay, but it's a little more complicated so try this first. You also might need to change 1F to 0F.
I think the flickering might be coming from the command "increment frame offset every 4 loops (0..2)". Try changing the third byte from 02 to 01 (at D0/0641). That's kind of a sloppy way to fix it but it might work.
If you need the animation to pause for a fraction of a second, you can insert an empty loop. I think the best place to do this will probably be either before or after "play default sound effect" command at D0/063B. An empty loop consists of four bytes, 89 xx 1F 8A, where xx is the number of frames to wait. There is an example of this in the GP Rain script at D0/65DB. There's another way to add a pre-animation delay, but it's a little more complicated so try this first. You also might need to change 1F to 0F.
I think the flickering might be coming from the command "increment frame offset every 4 loops (0..2)". Try changing the third byte from 02 to 01 (at D0/0641). That's kind of a sloppy way to fix it but it might work.
(06-28-2020, 05:50 PM)Everything Wrote: The "$" prefix just means that the number is in hexadecimal. That's the symbol that assembly language compilers usually use, but it's the same as the prefix "0x" or the suffix "h" (i.e. $3F, 0x3F, and 3Fh all mean 63 in decimal). They're just different conventions.
If you need the animation to pause for a fraction of a second, you can insert an empty loop. I think the best place to do this will probably be either before or after "play default sound effect" command at D0/063B. An empty loop consists of four bytes, 89 xx 1F 8A, where xx is the number of frames to wait. There is an example of this in the GP Rain script at D0/65DB. There's another way to add a pre-animation delay, but it's a little more complicated so try this first. You also might need to change 1F to 0F.
I think the flickering might be coming from the command "increment frame offset every 4 loops (0..2)". Try changing the third byte from 02 to 01 (at D0/0641). That's kind of a sloppy way to fix it but it might work.
Ohhh, I see. It's definitely a language that takes getting used to. Thank you for helping me understand it.
I made the adjustment you suggested and the flickering has ceased.
As for the animation, I can see the animation loop working, between attacks (when using the Offering) However it's the first attack that doesn't seem to be doing anything. What happens is the animation starts behind the character as he is moving forward. (Probably because it is trying to catch up to the faster moving character.) Only when he is standing in place during the 2nd/3rd/4th attacks (with the offering) that the animation is loaded in the right place. I tried editing the 2nd byte at D065D4 from 20 to C0 and then to 00, to maybe change the alignment and neither did anything. I also tried to speed up the note to maybe catch up to the faster moving character, but I guess speed 1 is the fastest setting and the other speeds make the lag behind even more apparent.
Would you know how to fix this and get the note to load closer to the player during this step forward?
06-28-2020, 08:42 PM
I'm not totally sure how to fix that. You may need to add "branch to $xxxx if character already stepped forward to attack" and "move forward 24" right before "calculate vector from attacker to target", similar to the GP rain script.
(06-28-2020, 08:42 PM)Everything Wrote: I'm not totally sure how to fix that. You may need to add "branch to $xxxx if character already stepped forward to attack" and "move forward 24" right before "calculate vector from attacker to target", similar to the GP rain script.
I tried, but I didn't seem to make any sort of difference. I'm not sure if I'm just confused by how to code branches properly, but I must have played with those codes for hours and nothing happened.
Code:
D0/65D4: 00 20 speed 1, align to center of character/monster
D0/65D6: D1 01 invalidate character/monster sprite priority
D0/65D8: 85 move to attacker position
D0/65D9: DB 06 branch to $65DF if character already stepped forward to attack
D0/65DB: 83 77 move forward 24
D0/65DD: 89 07 loop start (7 times)
D0/65DF: 0F [---]
D0/65E0: 8A loop end
D0/65E1: 95 calculate vector from attacker to target
D0/65E2: C9 00 play default sound effect
D0/65E4: 80 5D command $80/$5D
D0/65E6: 98 04 01 increment frame offset every 4 loops (0..1)
D0/65E9: 00 [$00]
D0/65EA: 92 02 08 move along vector at speed 2, branch to $063D
D0/65ED: 80 4E clear frame offset
D0/65EF: 80 5D command $80/$5D
D0/65F1: BF 2F 07 jump to subroutine $072F
D0/65F4: FF FF end of script
06-29-2020, 09:14 AM
That looks correct to me. The branch command bytes DB 06 means that it will skip the next 6 bytes in the script, so it will branch to D0/65E1 in this case. You can try it without the branch and see what happens. Or maybe try changing "move forward 24" to something else to make sure it's actually moving.
(06-29-2020, 09:14 AM)Everything Wrote: That looks correct to me. The branch command bytes DB 06 means that it will skip the next 6 bytes in the script, so it will branch to D0/65E1 in this case. You can try it without the branch and see what happens. Or maybe try changing "move forward 24" to something else to make sure it's actually moving.
Actually removing the branch DID in fact load the animation correctly, just adding the "move 24" code fixed the error.
Thank you so much for helping me along with this. I really appreciate all the help you did. (As well as everyone else on here) I know I was very clueless about what I was doing. I never would have thought that I could make a working harp in this game, but it actually looks like a convincing weapon. Maybe someday I'll be ambitious enough to attempt to code it to function like Edward's harp, but I'm very satisfied with these results.
I'll be sure to put together all the work I did into making this harp later and post it so everyone can make their own too.
07-03-2020, 01:53 PM
impressive work, very nicely done
"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"
-HNIC
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)