TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Background Music

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
stormdragon2976



Joined: 19 Nov 2010
Posts: 46
Location: /dev/null

PostPosted: Sat Feb 04, 2012 11:18 pm    Post subject: Background Music Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Mon Feb 13, 2012 6:46 pm    Post subject: Reply with quote

You can run #script {exists} {ls <filename>} to determine if the file exists or not.

Not entirely sure why it is crashing.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group