Results 1 to 3 of 3
Thread: problem with sound script
-
09-26-2010, 12:39 PM #1
- Join Date
- Aug 2010
- Location
- Barcelona, Spain
- Posts
- 2
problem with sound script
Several weeks ago I began a simple script with sounds, but I committed a mistaque that I'm not able to find from then on:
when the aircraft speed is higher than 135Knt, I want to sound (only one time!) an alarm, but sadly this sound repits again and again, very quickly. This alarm only stops when the speed is slower than 135Knt.
I don't undertand, I thought that Var0702 was enough to stop the sound.
This is the script:
Var 0701, Link SOUND // Sound on
Var 0702, Link SOUND, Type S // Sound off
Var 1224
Var 1220, Link FSUIPC_IN, Offset $02BC, Length 4 // IAS in knots * 128
{
V1224 = V1220 / 128 // IAS
IF V1224 > 135 // if IAS higher than 135Knt...
{
V0701 = 3 // the alarm file in sioc.ini
V0701 = 0
}
ELSE
{
V0702 = 3
V0702 = 0
}
}
Please, I need your advice.
Greetings from Barcelona, Spain.
-
09-26-2010, 01:54 PM #2
- Join Date
- Jul 2013
- Posts
- 917
Re: problem with sound script
With your code the sound is triggered when the speed reaches more than 135 knots AND ABOVE. So the sound will play at over 135 knots and it will repeat until the speed drops below 135 knots. This because the code attached to variable 1220 will run every time the value of var 1220 changes ie for 135.1, 135.2, 135.3 knots etc etc. There are probably a number of ways to recode. You could create a variable called "IAS-over_135" and set this to 1 when you first go over 135 knots. Then insert a line to test if the IAS_over_135 variable is 1 before playing the sound. You will also need to add a line to reset the IAS_over_135 variable to zero after the sound has played once
Others may know a simpler way to solve this
David
Edited to correct logic !!
-
09-27-2010, 06:12 PM #3
- Join Date
- Aug 2010
- Location
- Barcelona, Spain
- Posts
- 2
Re: problem with sound script
dear friend David,
thanks a lot for your help.
Your suggestion has given me some ideas to modify the script. I have to think about it.
Greetings, Mike.
Similar Threads
-
Sioc trim sound problem
By themax222 in forum OpenCockpits General DiscussionReplies: 13Last Post: 05-03-2010, 01:33 PM -
X-Plane Thunder Sound addon sound pack
By Padraig in forum General X-Plane (Laminar Research)Replies: 4Last Post: 12-12-2009, 07:24 AM -
Sound problem in FSX
By GDR in forum FSX Sound DiscussionsReplies: 0Last Post: 07-01-2009, 02:54 AM -
FSX Sound Problem
By airwolfe in forum Cockpit SoundsReplies: 6Last Post: 02-12-2009, 01:44 PM -
SIOC SOUND: How to make a looping sound?
By stabell in forum OpenCockpits General DiscussionReplies: 3Last Post: 10-29-2008, 07:27 PM
Explore Exciting Connections for a Night of Fun in Your City
Ready for an Unforgettable Night?...