Skip to content

Combining BCS top-extending with BCS replacement (for music)

chimericchimeric Member Posts: 1,163
edited January 2017 in General Modding
I'm following Talon's tutorial on adding new music, and what he says is that Weidu can add tunes but chooses tune ids dynamically, like it does most things, so that proper tunes are played no matter what the installation. Thus, if I want to change the daytime music for the Nashkel Fair, I need to put this bit of code in the tp2 file:
MKDIR ~music/FDAY~
COPY ~Fair/FDAY/FDAY1_#.acm~ ~music/FDAY/FDAY1_#.mus~
ADD_MUSIC ~FDAY1_#~ ~Fair/FDAY/FDAY1_#.mus~
COPY ~Fair/AR4900.bcs~ ~override~
REPLACE TEXTUALLY MUSIC ~%FDAY1_#%~ 
My question is, can I use the REPLACE TEXTUALLY command with an EXTEND_TOP instead? I don't want to override the area script for the Fair entirely with my own, I want to add my bit to it, with a SetMusic action, and then do the text substitution.

Comments

  • ArdanisArdanis Member Posts: 1,736
    You may need to EVAL the EXTEND_TOP action so that music variable is resolved, but otherwise yes, you can extend existing scripts with whatever your BAF contains instead of overwriting.
  • chimericchimeric Member Posts: 1,163
    How? IF_EVAL... what?

    So, right now I have:
    EXTEND_TOP ~AR4900.bcs~ ~Fair/AR4900_#.bcs~
    REPLACE TEXTUALLY MUSIC ~%FDAY1_#%~ 
    Also, just to make sure: the BAF thing is only important if adding particular entries to 2DA and IDS files that I don't want mixed up, right? That's the impression I got from the discussion at G3. If a mix-up in strings is not an issue, then I can append a normal BCS. Correct?
  • ArdanisArdanis Member Posts: 1,736
    edited January 2017
    Off the top of my head, but iirc it's
    EXTEND_TOP ~AR4900.bcs~ ~Fair/AR4900_#.baf~ EVAL
    This should automatically resolve ~%FDAY1_#%~ in the baf.

    the BAF thing is only important if adding particular entries to 2DA and IDS files that I don't want mixed up, right? That's the impression I got from the discussion at G3. If a mix-up in strings is not an issue, then I can append a normal BCS. Correct?

    More or less, although I find it easier to write/edit bafs with notepad, rather than do it in NI/DLTCEP. Matter of taste, really.
  • chimericchimeric Member Posts: 1,163
    edited January 2017
    Okay, I used the abbreviated version of the code you gave me. The installation log said the music had been added, but it doesn't actually sound in the game - the music is absent - and the SONGLIST.IDS, when opened in Near Infinity, doesn't have my new record. The script extension reads "No music" and resists recognizing FDAY1_#. Contrary to this, the ARE file does let me pick the new song by hand, showing it under no. 92 - what would have been the next entry in SONGLIST.IDS. So I have a songlist without a song and an area that recognizes the song.
  • ArdanisArdanis Member Posts: 1,736
    Looking at this more closely
    COPY ~Fair/FDAY/FDAY1_#.acm~ ~music/FDAY/FDAY1_#.mus~
    ADD_MUSIC ~FDAY1_#~ ~Fair/FDAY/FDAY1_#.mus~
    I think you meant to do
    COPY ~Fair/FDAY/FDAY1_#.mus~ ~music/FDAY/FDAY1_#.mus~
    ADD_MUSIC ~FDAY1_#~ ~music/FDAY/FDAY1_#.mus~
    or just
    
    ADD_MUSIC ~FDAY1_#~ ~Fair/FDAY/FDAY1_#.mus~
    Note that .mus is not a sound file extention, it is a tracklist. How exactly it functions, I've very little idea, however, as I never bothered with media files.
  • chimericchimeric Member Posts: 1,163
    edited January 2017
    You are right, I overlooked an error here. It's in another place, though. Should be:
    COPY ~Fair/FDAY/FDAY1_#. -> acm~ ~music/FDAY/FDAY1_#. - > acm~
    ADD_MUSIC ~FDAY1_#~ ~music/FDAY/FDAY1_#.mus~
  • chimericchimeric Member Posts: 1,163
    All right, I finally got the music to install. :) I set it with SetMusic, and that's a new function, so may not be known through and through. Anyway, it started playing, but before it could run through, a couple of kobolds showed up. Music changed to the combat tune, and then the daytime tune came back, from the beginning, and this time reached the end. But I expected in vain for it to start playing all over again, even when I entered a tent and came out again to "reset" it. What gives?

    Another question, for those who've done this music-swapping thing, is whether there is a ready scheme for a combination of SetMusic actions, something convenient and smart that'll spare me the effort of inventing it whole-cloth. You see, I can set the daytime tune directly for the area in Near Infinity, but that way there is no swapping of tunes, if I want to have several; thus I need to use a few Set Music commands. What's more, the music is supposed to be actually played by a band of musicians in the center of the area, and these NPC are busy (not talking) when performing a tune. For the player to start a conversation with one of them, he needs to catch them in an interval between tunes. I'm thinking of doing it through SetMusic actions that set a global, and then timing the reset of the global to the length of the tunes. But what's going to happen if a fight breaks out? I suppose I could hang the globals on ActuallyInCombat()...

    But if there is a simpler way, go ahead and tell me.

    P.S. Trees. Who has replaced or redrawn tree bams? What are their filenames?
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    edited January 2017
    chimeric said:

    P.S. Trees. Who has replaced or redrawn tree bams? What are their filenames?

    The trees are in the TIS files. They are part of the background art. Your characters can pass behind a tree thanks to clever use of wallgroups in the .WED file.

    Editing a tree would require editing the TIS file and the wall polygons in the .WED file.

    http://www.simpilot.net/~sc/dltcep/areamaking/wallgroups.htm

    This is what you see when you turn the wall polygons on in Near Infinity:


  • chimericchimeric Member Posts: 1,163
    Funky. So they are not BAMs. Any way to animate them?
  • chimericchimeric Member Posts: 1,163
    Okay, about music. I got a tune to work once, but then I did something wrong again... Now I want to add three tunes, and it's just easier if someone points out my error here, because I can't find it. The problem is, Weidu reports "added music," but then it says "[SetMusic] argument not found in SONGLIST.IDS. That ids file just doesn't get updated.

    Here is the tp2 entry for the first of the three tunes for the Fair's daytime (tune A):
    MKDIR ~music/FairdA~
    COPY ~Fun_at_the_Fair/FairdA/FairdA.acm~ ~music/FairdA/FairdA.acm~
    ADD_MUSIC ~FairdA~ ~Fun_at_the_Fair/FairdA/FairdA.mus~
    Here are the contents of the same tune's MUS file, FairdA.mus:
    FairdA
    1
    A @TAG END
Sign In or Register to comment.