Author Topic: Single track to Soundtrack playback? =X  (Read 1541 times)

0 Members and 1 Guest are viewing this topic.

Offline asyikarea51

  • 210
  • -__-||
Single track to Soundtrack playback? =X
So I have a mission where the Music is turned off in the Mission Specs menu, and I'm trying to get the music going... in a way. Basically I'm trying to prevent the battle music from playing until the battle actually starts between an Arcadia and an enemy Icelus (Neutral IFF from mission start, and a wing launches from it 2 seconds into the mission, "No Arrival Music" for said wing is ticked). Then once the battle frenzy starts, I need the song to go as per normal (as though I had set the music in Mission Specs).

The moment the player starts, this happens:

Code: [Select]
$Formula: ( when
   ( has-time-elapsed 1 )
   ( play-sound-from-file
      "FS2_Amb_SW01.wav"
      20
   )
)
+Name: Arrival music
+Repeat Count: 1
+Interval: 1
+Team: 0

Once the Arcadia's fired off a shot, the Icelus fires. This happens moments before the Icelus shoots:

Code: [Select]
$Formula: ( when
   ( is-event-true-delay
      "Crunk initiates attack"
      3
   )
   ( close-sound-from-file ( true ) )
)
+Name: Music change 1
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( is-event-true-delay
      "Music change 1"
      1
   )
   ( play-sound-from-file
      "FS2_Btl_A01.wav"
      100
   )
)
+Name: Music change 2
+Repeat Count: 1
+Interval: 1
+Team: 0

When the Icelus and its escorting fighters are byebye, this happens:

Code: [Select]
$Formula: ( when
   ( is-destroyed-delay
      4
      "Metal Crunk"
      "MC Defense A"
      "MC Defense B"
      "MC Defense C"
      "MC Defense D"
      "MC Defense E"
   )
   ( close-sound-from-file ( true ) )
)
+Name: Music change 3
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( is-event-true-delay
      "Music change 3"
      1
   )
   ( play-sound-from-file
      "FS2_Amb_SW01.wav"
      1000
   )
)
+Name: Music change 4
+Repeat Count: 1
+Interval: 1
+Team: 0

I'm trying to change the "Music change 2" event so that it doesn't loop a single track - rather it plays the Genesis (or some other) soundtrack like in a normal situation (plays all three battle tracks). If anyone can help me out with this, I can omit the 3rd and 4th events completely (unless I intend to re-loop "FS2_Amb_SW01.wav" after the battle, and then make the mission play the entire Genesis soundtrack again for a second battle in the same mission).

How do I go around doing this? Or is it easier to just use a new music TBL (mine's still stock)?

P.S. don't ask why I came up with a name whose meaning doesn't fit the Icelus at all. The mission's akin to a rough sketch in progress, so it's hackjob names until it's done... :nervous:

EDIT: Title spelling error
« Last Edit: December 04, 2006, 09:57:52 am by asyikarea51 »

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Single track to Sountrack playback? =X
This is the best way to do it:

1: Set the mission's music to Genesis. Don't use the "no music" setting.
2: Make an event that changes the music to "no music" right at the beginning.
3: Add in a looping play-sound-from-file into the same event, using the ambient track you want.
4: Make an event that changes the music to Genesis about two seconds before the point you want it to switch to battle.
5: Make another event with a close-sound-from-file at exactly the point where it's supposed to change.
6: Add in a hostile Pegasus somewhere far away and make it arrive when the music is supposed to change, and have it depart a second later.

I've done this many times in my missions and it works very well. The only issue is a slight overlap at the change point, although if it's really noticeable you can make a copy of the soundtrack in music.tbl with the ambient track removed and that will get rid of it.

It's also possible to get rid of the enemy arrive music when the Pegasus comes in, but you have to do something a little more complicated. (basically, make two of them fight for a few seconds)

 

Offline asyikarea51

  • 210
  • -__-||
Re: Single track to Soundtrack playback? =X
Tested, verified, came across the overlap you mentioned (at least I think so :lol:), w00t, works like a charm. YEY! :D

Still need to see if that Genesis is looping right, but nothing big there... and maybe attempt to FRED a mission with more than 1 instance of the hackjob in it. :lol:

In case it matters, I applied "No Warp Effect" and "No Arrival Music" on the Pegasus.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Single track to Soundtrack playback? =X
Good to hear. :)

No warp effect is a good idea, but no arrival music will sometimes cause the game to not play the battle track. If you don't want the arrival music, you can make another Pegasus show up (neutral, invulnerable and disabled), and have the hostile one attack it for a few seconds before jumping out, which will always create a direct switch to the battle music. It takes a few tries to get the timing right with this though.

  

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Re: Single track to Soundtrack playback? =X
eh...I could have sworn I saw two more posts from you in here yesterday. :confused: