Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: jedione on March 06, 2017, 07:40:40 AM

Title: music only in display-menu ? HELP
Post by: jedione on March 06, 2017, 07:40:40 AM
not sure if this is a general or scripting Q:

how would i get music to play only when you are in the display menu...

i set ambient sound ,, but it plays everywhere

thanks..
Title: Re: music only in display-menu ? HELP
Post by: qqplayer on March 10, 2017, 08:25:05 AM
I think the best option is to.add a custom music for your menu theme.

I have a little code for this on my computer.
Something like fe.add music....

I'll paste later if you want.
Title: Re: music only in display-menu ? HELP
Post by: jedione on March 11, 2017, 05:47:39 PM
yes please.......thankx
Title: Re: music only in display-menu ? HELP
Post by: qqplayer on March 12, 2017, 06:01:49 AM
Code: [Select]
// sound
local mysong = fe.add_sound("music.mp3");

mysong.file_name = music.mp3";
mysong.loop = true;
mysong.playing = true;

 ;)
Title: Re: music only in display-menu ? HELP
Post by: caminiti45 on September 15, 2017, 08:30:13 PM
where would you put this code? in the layout.nut file for the display?
Title: Re: music only in display-menu ? HELP
Post by: jedione on September 17, 2017, 08:24:43 AM
just put the code into the layout.nut file of the theme that is being used as your display-menu
then drop an mp3 file into the layout,  make sure to rename it of course!

done.
Title: Re: music only in display-menu ? HELP
Post by: caminiti45 on September 17, 2017, 04:55:53 PM
EDIT
doh nevermind figured it out. Thanks!
Title: Re: music only in display-menu ? HELP
Post by: caminiti45 on October 07, 2017, 05:07:44 PM
I do have one more problem with this script. When I exit a game back to the theme, the music no longer plays. Any way around this?
Title: Re: music only in display-menu ? HELP
Post by: jedione on October 07, 2017, 09:52:25 PM
It has been discussed in forums before and cocluded that it is bug in AM,   
Maybe will be fixed in future release