Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: kent79 on April 30, 2017, 08:23:51 PM

Title: Can't entry to game while add on_signal( sig ) case "select":
Post 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;
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: bjose2345 on May 01, 2017, 01:22:58 AM
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
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: kent79 on May 01, 2017, 06:09:53 AM
Not working  :'(
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: qqplayer on May 01, 2017, 11:37:38 AM
Try "Transition.ToGame"


http://attractmode.org/docs/Layouts.html
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: popoklo on May 04, 2017, 10:11:08 AM
return false. not true ;)
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: kent79 on May 04, 2017, 11:19:11 AM
qqplayer, popoklo

both not ok  :(
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: kent79 on May 04, 2017, 11:22:04 AM
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;
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: popoklo on May 05, 2017, 11:59:27 PM
case "select":
{
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         
         return false;
}

tried this?
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: kent79 on May 06, 2017, 05:38:12 AM
case "select":
{
         local previewClick = fe.add_sound("selectclick.mp3");
               previewClick.playing=true;
         
         return false;
}

tried this?

not working.  :(
Title: Re: Can't entry to game while add on_signal( sig ) case "select":
Post by: bjose2345 on May 06, 2017, 05:03:01 PM
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.