Jump to content

[Solved] Adding custom sounds to battle animations


circleseverywhere
 Share

Recommended Posts

I would like to insert a custom sound as a 0x85 command for use in custom battle animations. Like instead of C49 to play a sage casting sound, I want to use C53-CFF to play whatever sound I insert.

I think I need to find the pointer table for battle animation commands, and point the empty commands to my sounds, but I have no idea how to find pointer tables. I was able to find the pointer table for spell animations in this thread: http://serenesforest.net/forums/index.php?showtopic=27569

I was also able to find this bit of code inside FEditor\src\Model\AnimationBuilder.java:

// For appending 0x85 commands onto the frame data to play any soundpublic void addSoundCommand(short musicID) {if (mode == MAX_MODE_COUNT)return;if (mode == 0 || mode == 2) {// NOP command to avoid anticipated issuesBGframeData.add(AnimationCommand.normal((byte)0, (byte)0));}add_helper(AnimationCommand.sound(musicID));if (hasLoop)wordCount++;}// addCommand method; tested and working!
so it seems like this is definitely possible. I just have no idea how to actually do it.

EDIT:

I managed to (sort of) get it working.

I used Sappy to find some of the sound effects. For my example I used Song 231 in FE8, which is the Brigand's war cry. I used Import Sample to put my WAV file at 0x0EA0000 and put in an instrument map at 0x0E80000: 00C00000 0000EA80 (pointer to WAV file) FF00FF00.

Then I made a MIDI with one note and inserted it in place of Song 231, using the instrument map at 0x0E80000.

Now when I use C33 in a battle animation it plays my WAV file instead of the Brigand war cry.

HOWEVER there is still a problem, because around 50% of the time the sound fails to play. Also even if I get that working, this will only work for a very limited number of sounds. Does anyone have any advice?

DOUBLE EDIT:

Discovered the SXXXX command which lets you play whatever sound you like, so I'm filling in the blank sounds on the music table. This means I can have a huge number of possible sound effects. You do have to go into the song table and change the 00 00 00 00 of blank songs to 06 00 06 00, otherwise it cuts the music.

But the sound still fails to play around half the time, seemingly without reason.

FINAL EDIT: Got my solution, in case anyone else has the same issue. http://feuniverse.us/t/playing-custom-sounds-in-battle-animations/1034/3

Edited by circleseverywhere
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...