Jump to content

Music not playing during talks


berelinde

Recommended Posts

Found the perfect music for my mod. The only problem is that it is too quiet to hear using PlaySound(). Quadruple amplification renders the song loud enough to hear, but introduces unacceptable crackles and pops. So, I'm giving players a choice of whether to add it to songlist.2da or not. No problems with installation, everything there works as it should.

 

The problem I'm having is with playback using PlaySong() in the script. It worked precisely once, probably dumb luck, and hasn't worked since. The first few notes will play and then the song will end abruptly.

 

This is the tp2 segment:

BEGIN ~Add Keldorn's romance theme to songlist.2da
(recommended for smaller installations - music will be more audible)~ 
REQUIRE_COMPONENT ~setup-keldorn_rom.tp2~ ~0~ ~This component requires berelinde's Keldorn Romance~ 
FORCED_SUBCOMPONENT ~Music~ 
MKDIR ~music/mxbkel~ 
COPY ~keldorn_rom/song/mxbkel/mxbkela.acm~ ~music/mxbkel~ 
COPY ~keldorn_rom/song/mxbkel.mus~  ~music~ 
MKDIR ~music/blank~ 
COPY ~keldorn_rom/song/blank/blanka.acm~ ~music/blank~ 
COPY ~keldorn_rom/song/b_blank.mus~ ~music~ 
SET_2DA_ENTRY 0 2 3 ~b_blank.mus~
ADD_MUSIC  ~Keldorn~	~music/mxbkel.mus~ 

EXTEND_TOP ~keldorn.bcs~ ~keldorn_rom/script/with_music/b!keldorn_rom.baf~ 
	EVALUATE_BUFFER 
EXTEND_TOP ~keldord.bcs~ ~keldorn_rom/script/with_music/b!keldorn_rom_d.baf~ 

COPY_EXISTING ~keldorn.bcs~ ~override~ 
	DECOMPILE_BCS_TO_BAF 
		REPLACE_TEXTUALLY 98765 ~%Keldorn%~ 
	COMPILE_BAF_TO_BCS 

COPY_EXISTING ~keldord.bcs~ ~override~ 
	DECOMPILE_BCS_TO_BAF 
		REPLACE_TEXTUALLY 98765 ~%Keldorn%~ 
	COMPILE_BAF_TO_BCS 

BEGIN ~Do not add Keldorn's romance theme to songlist.2da
(suggested for larger installations - music will be softer)~ 
REQUIRE_COMPONENT ~setup-keldorn_rom.tp2~ ~0~ ~This component requires berelinde's Keldorn Romance~ 
FORCED_SUBCOMPONENT ~Music~ 
MKDIR ~music/blank~ 
COPY ~keldorn_rom/song/b_blank.mus~ ~music/blank~ 
SET_2DA_ENTRY 0 2 3 ~b_blank.mus~ 

EXTEND_TOP ~keldorn.bcs~ ~keldorn_rom/script/b!keldorn_rom.baf~ 
	EVALUATE_BUFFER 
EXTEND_TOP ~keldord.bcs~ ~keldorn_rom/script/b!keldorn_rom_d.baf~

This is mxbkel.mus, copied straight from mxAnom.mus (with the necessary changes).

MXBKEL
1
A   @TAG END

This is the override script block that calls the song

IF 
InParty(Myself) 
RealGlobalTimerExpired("B!KelTime","GLOBAL") 
Global("B!KeldornRA","GLOBAL",1) 
!AreaType(DUNGEON) 
!Global("Chapter","GLOBAL",5) 
!StateCheck(Myself,CD_STATE_NOTVALID) 
!StateCheck(Player1,CD_STATE_NOTVALID) 
CombatCounter(0) 
!See([ENEMY]) 
OR(31) 
	Global("B!KelLT","GLOBAL",2) 
	Global("B!KelLT","GLOBAL",4) 
	Global("B!KelLT","GLOBAL",6) 
	Global("B!KelLT","GLOBAL",8) 
	Global("B!KelLT","GLOBAL",10) 
	Global("B!KelLT","GLOBAL",14) 
	Global("B!KelLT","GLOBAL",18) 
	Global("B!KelLT","GLOBAL",20) 
	Global("B!KelLT","GLOBAL",22) 
	Global("B!KelLT","GLOBAL",24) 
	Global("B!KelLT","GLOBAL",26) 
	Global("B!KelLT","GLOBAL",28) 
	Global("B!KelLT","GLOBAL",30) 
	Global("B!KelLT","GLOBAL",32) 
	Global("B!KelLT","GLOBAL",34) 
	Global("B!KelLT","GLOBAL",36) 
	Global("B!KelLT","GLOBAL",38) 
	Global("B!KelLT","GLOBAL",40) 
	Global("B!KelLT","GLOBAL",42) 
	Global("B!KelLT","GLOBAL",44) 
	Global("B!KelLT","GLOBAL",46) 
	Global("B!KelLT","GLOBAL",48) 
	Global("B!KelLT","GLOBAL",50) 
	Global("B!KelLT","GLOBAL",52) 
	Global("B!KelLT","GLOBAL",56) 
	Global("B!KelLT","GLOBAL",58) 
	Global("B!KelLT","GLOBAL",60) 
	Global("B!KelLT","GLOBAL",62) 
	Global("B!KelLT","GLOBAL",64) 
	Global("B!KelLT","GLOBAL",66) 
	Global("B!KelLT","GLOBAL",70) 
THEN 
RESPONSE #100 
	PlaySong(98765) 
	StartDialogueNoSet(Player1) 
END

This the one script block where the song actually played. It's followed by a morning after dialogue, if that has anything to do with it.

IF 
InParty(Myself) 
RealGlobalTimerExpired("B!KelTime","GLOBAL") 
TimeOfDay(NIGHT) 
Global("B!KeldornRA","GLOBAL",1) 
!AreaType(DUNGEON) 
!Global("Chapter","GLOBAL",5) 
!StateCheck(Myself,CD_STATE_NOTVALID) 
!StateCheck(Player1,CD_STATE_NOTVALID) 
CombatCounter(0) 
!See([ENEMY]) 
Global("B!KelLT","GLOBAL",67) 
THEN 
RESPONSE #100 
	IncrementGlobal("B!KelLT","GLOBAL",1) 
	PlaySong(98765) 
	StartDialogueNoSet(Player1) 
END

Is there some special flag I have to put on dialogues to get them to play music?

 

I notice that the dream script block I posted second, the one that actually played, is the only one that does not contain an OR(). Could that be relevant?

 

What I've tried that *didn't* work:

Taking away @TAG END

Adding a loop after A

 

 

Anyway, I'd appreciate any help.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...