PDA

View Full Version : Problem with simpel SIOC code



claushansen
08-31-2012, 08:33 AM
Hi,

I'm struggeling with some simpel code. I want to play a WAV file when the aircraft cross 30000 feet.

I'm using iFly, but i can't see that they have a offset for Altitude, so i'm reading the standard from FSUIPC and it goes good. But this script dosent execute when i'm crossing 30000 feet, any ideas ?

var 0908, name ALTITUDE, Link FSUIPC_INOUT, Offset $3324, Length 4 // Flight_Altitude FSUIPC offset


Var 0909


Var 0910


{
L0 = &ALTITUDE
IF L0 > 30000
{
IF V0909 = 0
{
&PLAY_SOUND = 4 // play wav file in SIOC Dir
&PLAY_SOUND = 0
V0910 = 0
V0909 = 1
}
}
ELSE
{
IF V0909 = 1
{
&STOP_SOUND = 4
&STOP_SOUND = 0
V0910 = 1
V0909 = 1 // stop so it only playes once
}
}
}




Var 0911, name TOC
{
IF &ALTITUDE > 30000
{
&TOC = 1
}
}

Thanks
Claus
www.737sim.dk

kiek
08-31-2012, 12:54 PM
That's because the code attached to your Var 910 is never executed... You should get rid off vars 910 and 911 and put that code in Var 908.
Looks you do not understand yet how SIOC works, here is more info (http://www.lekseecon.nl/sioc.html).

regards,
Nico

claushansen
09-01-2012, 03:52 AM
Hi Nico,

That get me a bit forward :)

Claus