Qhimm.com Forums
Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Tenko Kuugen on 2012-08-30 20:40:52
-
I tried various things with DLTP yesterday and at least I think that somewhere has to be a table the game pulls IDs from
essentially it would look like this
to the left, a row of MAP ID ( has to be a 16 bit )
above, a row of Music ID ( the number called when Play Music # ) is used ot CMUSC forces a different music ( should be 8 bit )
where the two meet, the ID of the actual track ( there are less than 256, so it should only 8 bit )
opcode CMUSC can be used to force different music in places but apparently nothing that is not already pre-loaded on the map.
Most maps only have Play Music #0 ( BGM ) and Play Music #1 ( Normal Battle ) as music, so most maps have only loaded two tracks at a time
Since Music #1 is almost always the same track, the entry for that ID should be nearly the same for all fields where enemies can be encountered.
trying to mess around with AKAOs did absolutely nothing, regardless of what was done. so I can say for sure that AKAO does not set music.
-
AKAO was the music programming with PSX... and we know for sure that PC port uses midi...
so obviously they've worked a way around it. Perhaps the table is in the exe? Or hardcoded data there. I found nothing in flevel, and the tables that are there, luksy assures me are not related.
-
it could be in the .exe but it could be somewhere else entirely
I really have no clue beyond what I posted above
if someone else could take a look at it, that would be great
I'm stunned that this hasn't been traced down yet
-
I did some tests, and the music is played by AKAO, if there is a bug, it is in Makou Reactor. I'm sorry I have to fix it :-[. So I tried to swap AKAO 2 and 4 in blackbg2, and it works, the played music change.
-
yeah but some of the maps don't even have Akao and still play music....
-
A lot of maps don't have AKAOs, most in fact don't, and still have a regular opcode "play music #0" in the group 0, s0 int, set.
you should try to swap out the music in a non-debug field
-
Aali said there are AKAO blocks that arent inside the field script but the files
maybe you'll want to look into that, Myst6re
-
Luksy pointed me to this http://forums.qhimm.com/index.php?PHPSESSID=062673c9ab8bc696cb85c0b1f9c913d3&topic=13358.msg186033#msg186033
And he was right. The music is set in the field files (not part of script though as Aali said). After the AKAO text there are 2 bytes for the ID. The ID sets the music for the map (it is the music ID, see Data\Music\music.idx). For example gldgate has 4 musics set. The 4th music has an ID of 56. See music.idx, this is Gold1 (Gold Saucer music). You can see in script that normally Music #3 (the 4th music, given 0 is 1st) is set to play this. If you take 1 to be line 1 in the index, the actual music is ID+1. (See code section below). Make a note of that.
Hopefully Mystere will undertake creating a tool to set the musics? or add ability to Makou? :-P It is really simple.
1. Find akao blocks and look at the ID which is the first entry (the entry straight after the AKAO text). The ID is a 2 byte value (even though there are nowhere near 65535 musics! So really just take the 1st byte.)
2. Cross reference this value with the entry list in music.idx to get the name of the music set for this akao block. The music in the first block is played in script with "play music #0".
3. Update makou to tell user the music that is being played rather than "play music #0". It may be possible to set the music here too in makou.
oa
ob
dun2
guitar2
fanfare
makoro
bat
fiddle
kurai
chu
ketc
Example.
The first entries in music.idx. As you can see fanfare is the 5th music
Therefore the ID in field file will be 6.
-
I did the editor, and it works, great job DLPB! But KuugenTheFox spoke of music that were played when there is no AKAO in the field, and I found that the music was not always played.
-
I'm no expert on this so if this is the solution, I must have done something wrong.
any chance we'll see the ability to change which music is loaded into a level into MR?
-
any chance we'll see the ability to change which music is loaded into a level into MR?
Sure.
-
I did the editor, and it works, great job DLPB! But KuugenTheFox spoke of music that were played when there is no AKAO in the field, and I found that the music was not always played.
Luksy and vehek deserves more credit than me for pointing out that it may be the solution and Luksy explaining akao to me. Good to see this is solved! 8)
-
And we're one step closer to mapping all of FF7.