Jump to content

Patching (entry "0") to songlist.2da - unify across mods?


jastey

Recommended Posts

A lot of mods add an entry 0 to songlist.2da.

This is a selection of some randomly chosen mods and their songlist.2da patching.

1. What is this "xyzblank.mus" entry in songlist.2da actually for? I thought it's a muted sound, but I use a wav for Ajantis which works fine without patching anything.

2. Do I see it right that the last mod is the winner, and that it would be useful to unify this?

3. If yes, is there a smarter way to do this? I also included what the BG2Fixpack does, for reference.

Adrian:

COPY_EXISTING ~songlist.2da~ ~override~
    SET_2DA_ENTRY 0 2 3 ~rh#blank.mus~

Ajantis BGII - not active yet, but could get reactivated:

ACTION_IF GAME_IS ~BG2 ToB BGT~ THEN BEGIN
  COPY ~AjantisBG2/Sound/blank.mus~ ~music~

  COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 2 1 2 ~Blank~
  SET_2DA_ENTRY 2 2 2 ~Blank.mus~
END

Amber:

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~m#blank.mus~

Angelo:

COPY_EXISTING ~songlist.2da~ ~override~
  REPLACE_TEXTUALLY ~^\(0[ %TAB%]+No_music[ %TAB%]+\)\*\*\*\*$~ ~\1BLANK.MUS~

Arath:

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~lk#blk.mus~
BUT_ONLY

Ascalon's Breagar:

COPY_EXISTING ~songlist.2da~         ~OVERRIDE~
SET_2DA_ENTRY 0 2 3 ~acblank.mus~

Auren Aseph:

COPY_EXISTING ~songlist.2da~ ~override~
SET_2DA_ENTRY 0 2 3 ~K#BLANK.MUS~

BG1NPC:

ACTION_IF GAME_IS ~tutu tutu_totsc~ THEN BEGIN
  COPY ~bg1npc/Core/MUS/x#blank.mus~ ~music~
  COPY_EXISTING ~songlist.2da~ ~override~
    SET_2DA_ENTRY 0 2 3 ~X#BLANK.MUS~
  BUT_ONLY_IF_IT_CHANGES
END

BG2Fixpack:

COPY_EXISTING ~songlist.2da~ ~override/songlist.2da~
  SET_2DA_ENTRY 2 1 2 ~G3Blank~
  SET_2DA_ENTRY 2 2 2 ~G3Blank.mus~

Branwen BGII:

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~Blank.mus~

Fading Promises:

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~Blank.mus~

Gavin BG1:

ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.are~ THEN BEGIN
  /* Music File .2da patching, Tutu only */
  COPY ~GAVIN/B!Blank.mus~ ~music~
  COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~B!Blank.mus~
  BUT_ONLY_IF_IT_CHANGES
END

Iylos:

    COPY_EXISTING ~songlist.2da~ ~override~
      SET_2DA_ENTRY 0 2 3 ~lk#blank.mus~

Keldorn_rom:

    COPY ~keldorn_rom/song/b_blank.mus~ ~music/blank~
    SET_2DA_ENTRY 0 2 3 ~b_blank.mus~

Xan BGII:

COPY_EXISTING ~songlist.2da~ ~override~
  SET_2DA_ENTRY 0 2 3 ~blank.mus~

 

Link to comment

Unmodified EE: G3Blank in BG2EE, No_music in BGEE. The former is a playlist consisting of a silent sound file (clearly inherited from the BG2 Fixpack), while the latter is literally nothing; the 2DA row has **** for its resource.

There's a consistent convention here that the 0 songlist entry is silence. Which does get used, such as the area music for the Elfsong Tavern. A song entry that doesn't correspond to anything in the 2DA, such as -1 for the area music in Firebead Elvenhair's house, instead results in inheriting behavior from elsewhere. In the case of areas, this means using the master area's music; that home in Beregost actually just has the same music as the Beregost exterior.

So ... if you're developing a mod for the EE, you don't need to do anything. There's already a "silence" entry at song #0. Non-EE, you might need to add something there. Whether that has to point to an actual playlist or whether it can just be nothing ... I don't know. Nothing certainly works in the EE, at least.

Link to comment

Ah, right. So what mods add is a muted "song" so the mod can play it's own wav file without it mixing with the area music.

Does it mean this is working for all mods, as long as the mod that wrote the entry also provides the muted .mus file, because all mods just point to this 0. entry? (So this is not as grave an issue as I thought?)

Link to comment

I'm quite sure that it doesn't matter which silent song you use, when you need silence. As for the use case ... no, songs mixing isn't a problem. Whenever the game starts playing a song, it stops playing whatever it was playing before. And then it keeps playing that song until either it finishes without looping, or something tells the game to play something else.

As far as I can tell, the most common use case for silence is simply to have an area with no music.

Link to comment
1 hour ago, jmerry said:

As for the use case ... no, songs mixing isn't a problem. Whenever the game starts playing a song, it stops playing whatever it was playing before.

A lot of NPC mods do not add their music as a music, but as a sound file. The mute song is used to mute the area music, and the lovetalk music is played as a wav:

PlaySong(0)
PlaySound("dyrom1")

I understand now that the mods themselves do not point to the .mus file but the position in songlist.2da, so the actual name of the mute song is not important.

Which slots are the one BGFixapck patches?

COPY_EXISTING ~songlist.2da~ ~override/songlist.2da~
  SET_2DA_ENTRY 2 1 2 ~G3Blank~
  SET_2DA_ENTRY 2 2 2 ~G3Blank.mus~

 

Link to comment

OK, I stand corrected on the layering. Yes, music added as sound effects does need the silent countersong. And there might be a real difference between "blank" and "none". Testing with some chapter saves ... console C:Eval("PlaySong(0)") silences Jaheira's romance music in BG2EE, doesn't silence Nashkel area music in BGEE. For the interrupt effect to work, you do need the actual silent playlist.

In the Fixpack code, that looks like it reads from all rows with two or more entries, which includes the "2DA V1.0" row and the " Name Resource" header row as rows 0 and 1. Then it takes row 2 - the first actual data row - and sets entries 1 and 2 in it to the data for the new playlist. Entry 0 in the row is left the same, and is presumably a zero.

The other mods are doing things more sensibly and skipping the header by only reading rows with three or more entries. And then they still assume that the first data row is song zero, which is the initial state but isn't actually required by anything. You could break all of these by reordering the 2DA table so it didn't start at zero.

Link to comment

There seems to be another problem I don't understand yet, mentioned (here).

Indeed, when I look at BG2:EE with NI I see an existing blank.mus which, indeed, plays the tavern music. This is the same for my BGT install.

Copying the blank.mus file included in the Branwen BGII mod into the override does not seem to replace this blank.mus file from the original game. Looking at it with NI, the custom blank.mus file is listed in a newly created category "mus" in NI, and trying to open it leads to an error message.

So, did the "insert blank music file" in mods only work because most have a unique name? What I don't understand is why the blank.mus file in the override does not replace the exiting one. (And why copying over a mus file that gives error message in NI works for other mods.)

7 hours ago, jmerry said:

The other mods are doing things more sensibly and skipping the header by only reading rows with three or more entries. And then they still assume that the first data row is song zero, which is the initial state but isn't actually required by anything. You could break all of these by reordering the 2DA table so it didn't start at zero.

Thanks. I'd assume chances of the file getting restructures are very low, though.

Link to comment

Music doesn't go in the override, period. The .mus playlist file (a text format) goes in the "music" folder, and so does the associated subfolder with the actual sound files in it.

It's also not necessarily a one to one relation; the first entry in the .mus file is which subfolder to draw from. You could have multiple playlists reference the same base files.

Link to comment
7 hours ago, jmerry said:

Music doesn't go in the override

Ah, of course. That makes sense.

So the ACTUAL fault is that the Branwen mod copies its blank.mus to the override, not the music folder. If it's copied to the music folder, it would replace the original blank.mus which is a tavern music?

Or is there something else I missed?

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...