Home   Help Search Login Register  

Author Topic: Music from Radio  (Read 1214 times)

0 Members and 1 Guest are viewing this topic.

marcus3

  • Guest
Music from Radio
« on: 02 Oct 2006, 22:41:03 »
How to I get music to play from a radio? ???

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Music from Radio
« Reply #1 on: 02 Oct 2006, 22:51:21 »
Insert into the editor 10 triggers, each one type "None", activated by radio Alpha for first trigger, Beta for second and so. All triggers activated repeatedly. Edit each trigger, click on its effects button and select the track you want to play. You may also edit the "Text" field of each trigger with the name of each song.

marcus3

  • Guest
Re: Music from Radio
« Reply #2 on: 02 Oct 2006, 23:17:13 »
That is sorta like a radio. But I ment like. Have the radio as a object and when u walk up to it, it should be playing music. So, that when u walk away from it. the music fades

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Music from Radio
« Reply #3 on: 02 Oct 2006, 23:32:00 »
Then you need to create an ogg file with your song (mono), copy that file into a "Sound" folder created into your mission folder, configure it in description.ext file and make your radio to "Say" that sound in a loop using a simple script.

For example, lets say your ogg file is named song1.ogg (a 15 seconds small song).
for your description.ext:
Code: [Select]
//=================================================================
//sounds
//=================================================================

class CfgSounds
{
sounds[] = {song1};

class song1
{
name = "song1";
sound[] = {"song1.ogg", db-0, 1.0};
titles[] = {0};
};
};

Now, lets suppose your radio object is named radio1, the script should look like:
Code: [Select]
#playmusic
;We dont want any music if farther than 100m, for example
@player distance radio1 < 100
radio1 say "song1"
;wait for the duration of the song
~15
goto "playmusic"

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Music from Radio
« Reply #4 on: 02 Oct 2006, 23:35:55 »
Or, you could define the song in the description.ext so that it can be selected from a trigger..
Can't remember how this was be done or is it even possible..  :sorry:

Anyway, once that is done (if it can be) then you would open the trigger window, click on the 'Effects' button and from the Sounds section select the song from the drop down menu next to the text Trigger:..

Then make trigger something like one meter in diameter, change the text this in the condition field to true and place the trigger directly on the radio object..

No need for looping script(s) to hog resources :P
That is of course if it can be actually done..  :whistle:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: Music from Radio
« Reply #5 on: 03 Oct 2006, 14:51:05 »
Quote
Can't remember how this was be done or is it even possible.. 
I believe giving it a name in description.ext does this - though I have not tested it.  Eg:
Quote
name = "song1";

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Music from Radio
« Reply #6 on: 03 Oct 2006, 15:29:26 »
Playing a sound from the effects menu in a trigger works.

Just make the description.ext file like above and then find the song in the trigger (under the trigger sound list I think). Make the trigger have 0 radius. Put the trigger on the radio and then make the trigger true (in the condition put true).