Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: jedione on May 25, 2019, 05:19:01 PM
-
was music loop crash ever solved?
cant seem to find, any info... but it happens when using..
kind of old topic...but still revalant :-\
after song ends...
local mysong = fe.add_sound("music/music-3.mp3");
mysong.loop = true;
mysong.playing = true;
-
i new i saw it somewere....
solved..... thought it would be nice to just be fixed
// [fe.sound.loop = true;] cause AM crash. I don't know the reason exactly. but, It works well as Plan B.
function playSound( path, loop=false ) {
local sound = fe.add_sound( path, true );
if( ! loop && ! sound.playing ) {
sound.playing = true;
}
if( loop ) {
fe.add_ticks_callback( this, "loopSound" )
}
function loopSound( ttime ) {
if( ! sound.playing ) {
sound.playing = true;
}
}
}
-
Thank you for your sharing. You help me a lot :)