• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Adf2 sound

Messages
61
Country
france
I would like to create a 3D switch to hear the sound of the ADF2

I've written this code, but it doesn't work correctly.
Irrespective of the position of the switch, I always hear the ident sound.

Code:
<PartInfo>
<Name>00-NORD_ADF2_audio_ON-OFF</Name>
	  <AnimLength>50</AnimLength>
	  <Animation>
		<Parameter>
		    <Code>
			  (L:ADF2_audio_ON-OFF,number) 100 *
		    </Code>
		    <Lag>400</Lag>
		</Parameter>
	  </Animation>
	  <MouseRect>
		<Cursor>Hand</Cursor>
		<TooltipText>Maximum</TooltipText>
		<CallbackCode>
		(L:ADF2_audio_ON-OFF,number) ! (&gt;L:ADF2_audio_ON-OFF,number)
(ADF2_audio_ON-OFF,number)  == 1 if{ (&gt;K:RADIO_ADF2_IDENT_ENABLE) } els{ (&gt;K:RADIO_ADF2_IDENT_DISABLE) } 
		</CallbackCode>
	  </MouseRect>
    </PartInfo>

I've tried this code but it doesn't work :

Code:
<PartInfo>
        <Name>00-NORD_ADF2_audio_ON-OFF</Name>
        <AnimLength>50</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>ADF SOUND:1</Variable>
                    <Units>bool</Units>
                    <Scale>50</Scale>
                </Sim>
                <Lag>400</Lag>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <HelpID>HELPID_RADIO_AUDIO</HelpID>
            <TooltipID>TOOLTIPTEXT_ADF2_AUDIO_SELECTOR</TooltipID>
            <EventID>RADIO_ADF2_IDENT_TOGGLE</EventID>
        </MouseRect>
    </PartInfo>
Thank for your help.
 
In your first bit of script, you forgot some critical characters:

(L:ADF2_audio_ON-OFF,number) == 1 if{ (&gt;K:RADIO_ADF2_IDENT_ENABLE) } els{ (&gt;K:RADIO_ADF2_IDENT_DISABLE) }

In the second attempt, you're toggling the ADF2 IDENT, but monitoring the ADF1 token variable!

<Variable>ADF SOUND:2</Variable>
 
Thank you, but for the second attempt the SDK tells me :

ADF SOUND:index ADF audio flag. Index of 0 or 1. Bool

For the first attempt, even after having corrected the syntax error, irrespective of the position of the switch, I always hear the ident sound.
 
For the first attempt, even after having corrected the syntax error, irrespective of the position of the switch, I always hear the ident sound.

Just change == 1 with 1 == and your problems are gone.

Tom
 
Thank you, but for the second attempt the SDK tells me :

ADF SOUND:index ADF audio flag. Index of 0 or 1. Bool.

Well I'll be! How bloody inconsistent of MS to do that! Every other indexed variable is 1 or 2... :rolleyes:

In any case, I'm glad that Tom caught the actual problem with the syntax of your alternate scheme, which my tired old eyes missed. :o
 
Back
Top