Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Delta Force (https://novahq.net/forum/forumdisplay.php?f=101)
-   -   [DFX] [MED] [SO MOD] Playing Music (https://novahq.net/forum/showthread.php?t=47560)

flamerboy67664 05-07-2014 08:53 PM

[MED] [SO MOD] Playing Music
 
How to I put music to my maps?

MAJWIZ 05-08-2014 10:02 AM

All music must be in wave form or the music won't play. Also most full songs run around 3-4 megs each. i use POWER SOUND EDITOR to make my sound waves. also read the comment STOMPEM posted below this one. have fun. :)

Guest001 05-08-2014 08:02 PM

Quote:

Originally Posted by flamerboy67664 (Post 383573)
How to I put music to my maps?

First you may need to understand how the WAC works with sound files.

Dave61's DFX/DFX2 Website

You may use various script methods to achieve it.

The most simple way is to use the waveready command in the WAC but there are other more complex methods and there are limitations.

FORMAT: 16bit PCM Wave
CHANNELS: x1 Mono recommended
BITS PER SAMPLE: 16
FREQUENCY: 41100Hz - 8000Hz


// plays once
if waveready() and never() then
wave("yourwavefile.wav")
endif


//plays as loop
if waveready() then
loop
wave("yourwavefile.wav")
end
endif

flamerboy67664 05-08-2014 11:06 PM

stompem please check this

WARN: THIS NEEDS SO MOD



Permissions:
You are not allowed to alter anything in the map except modifying the WAC file and if the thing you modify is important to make the music
You are allowed to play the mission

Link: https://dl.dropboxusercontent.com/u/...Evacuation.rar

Guest001 05-09-2014 12:22 AM

Quote:

Originally Posted by flamerboy67664 (Post 383577)
stompem please check this

WARN: THIS NEEDS SO MOD



Permissions:
You are not allowed to alter anything in the map except modifying the WAC file and if the thing you modify is important to make the music
You are allowed to play the mission

Link: https://dl.dropboxusercontent.com/u/...Evacuation.rar

Basically it means the map is made for the SO Mod and you may add sounds to the mission by editing the WAC.

Also it's generally considered OK to modify maps in the process of learning how to map yourself but morally it's wrong to publish them as your own.

flamerboy67664 05-09-2014 12:28 AM

Have you found something wrong in my WAC file?

Guest001 05-09-2014 01:00 AM

Quote:

Originally Posted by flamerboy67664 (Post 383579)
Have you found something wrong in my WAC file?

What WAC file is that?

flamerboy67664 05-09-2014 01:28 AM

Evac.WAC

flamerboy67664 05-09-2014 01:35 AM

// plays once
if elapse(1) then
text("Music: Top Gun: Hard Lock soundtrack 13")
wave("topgun13.wav")
endif

//rain
if elapse(1) then
rain(100)
overcast(70,30)
skyspeed(80)
endif

Contents of my WAC

Guest001 05-09-2014 01:35 AM

Here is your WAC corrected and the wave file converted in the attached ZIP file.

It was in the wrong format and too large.

All working now.

Looks like the file didn't upload. Still too large, I got it down to 2.8MB

You need to compress the sound file and make it mono.

Just wait a minute I will upload it to my server for you.


// plays once
if past(1) and waveready() and never() then
text("Music: Top Gun: Hard Lock soundtrack 13")
wave("TGHLTRACK_13.wav")
endif

//rain
if ontick() and never() then
rain(100)
overcast(70,30)
skyspeed(80)
endif

Guest001 05-09-2014 01:43 AM

Download your sound file here...

TGHLTRACK_13.zip

Please let me know when you get it so I can clear the file.

flamerboy67664 05-09-2014 03:44 AM

Done stompem, thanks for the help, all working now. :)

Guest001 05-09-2014 05:11 AM

Quote:

Originally Posted by flamerboy67664 (Post 383582)
// plays once
if elapse(1) then
text("Music: Top Gun: Hard Lock soundtrack 13")
wave("topgun13.wav")
endif

//rain
if elapse(1) then
rain(100)
overcast(70,30)
skyspeed(80)
endif

Contents of my WAC

// plays once
if elapse(1) then // This will repeat the wave file every 1 seconds and most likely fail
text("Music: Top Gun: Hard Lock soundtrack 13")
wave("topgun13.wav")
endif

//rain
if elapse(1) then // In this the weather will work but the WAC will be firing every 1 seconds
rain(100)
overcast(70,30)
skyspeed(80)
endif

You need to use and never() then to make it fire once.

If you want it to repeat it, the elapsed time must be of longer duration than the period of execution.

IE a 2 minute wave (=120 seconds) the recommended elapsed time would be 121 - IE:

if past() and elapse(121) and waveready() and never() then

if past() start playing immediately the player enters the game
elapse(121) wait 121 seconds
waveready() tells the engine to wait until there is no other sound playing.
never() then execute once


All times are GMT -5. The time now is 01:33 PM.

Powered by vBulletin®