Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: kent79 on April 30, 2017, 08:23:51 PM
-
Dear All,
I want to play sound while click select button. Then, I added below code on default grid theme. A sound is working, but it can't entry the game. Please help to fix it.
case "select":
local previewClick = fe.add_sound("selectclick.mp3")
previewClick.playing=true
return true;
-
yeah, i have the same problem some time ago,
try to put this,
case "select":
local previewClick = fe.add_sound("selectclick.mp3")
previewClick.playing=true
enable=true;
return true;
its work with any variable non declare
-
Not working :'(
-
Try "Transition.ToGame"
http://attractmode.org/docs/Layouts.html
-
return false. not true ;)
-
qqplayer, popoklo
both not ok :(
-
Well, I have tested as below 4 codes. 1 & 3 can play sound and do fe.signal action. But 2 & 4 is not ok and will be hang. I don't why, may be it is a bugs for AM :(
1. case "select":
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
fe.signal( "add_favourite" );
return true;
2. case "select":
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
fe.signal( "select" );
return true;
3. case "add_favourite":
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
fe.signal( "select" );
return true;
4. case "add_favourite":
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
fe.signal( "add_favourite" );
return true;
-
case "select":
{
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
return false;
}
tried this?
-
case "select":
{
local previewClick = fe.add_sound("selectclick.mp3");
previewClick.playing=true;
return false;
}
tried this?
not working. :(
-
Well maybe i can give you another idea, try to dont overwrite the select case, instead use the default case
example
default:
local previewClick = fe.add_sound("selectclick.mp3")
previewClick.playing=true
hope this idea work for you Kent.