stormdragon2976
Joined: 19 Nov 2010 Posts: 46 Location: /dev/null
|
Posted: Sat Feb 04, 2012 11:18 pm Post subject: Background Music |
|
|
I have some code in place for background music. well, actually, it's more background ambiance, and it seems to work for the most part. The problem is, when I go from a place that has an existing file to play to a place that doesn't. The terrain files are numbered. So %1 in my action is always a number. It would, for example play terrain-19.ogg. If I can just get it to quit crashing tintin++ when the terrain doesn't have a file to play that would be great. I haven't tried it, but I'm betting switching to a new terrain would cause it to crash too. Anyway, here is the code:
#ACTION {^kxwt_terrain %1}
{
#if {"$bgmusic" == "true"}
{
#if {"$terrain" != "%1"}
{
#if {&{terrain}}
{
#if {&{musicSession}} {#line {gag};
#zap {backgroundMusic};#unvariable {musicSession}}
};
#variable {terrain} {%1};
#script {fileName} {if [ -f sounds/terrain-%1.ogg ] ; then echo "true";fi};
#if {&{fileName[1]}} {#gts {#run {backgroundMusic} {ogg123 -r -q sounds/terrain-%1.ogg}};
#session {1};#var {musicSession} {true}}
}
}
}
{9}
Thanks _________________ Storm
Follow me on Twitter: http://twitter.com/stormdragon2976
or on Identica: http://identi.ca/stormdragon2976 |
|