plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

meochan avatar image
meochan asked meochan commented

LVar Set by Checklist Copilot Action Getting Reverted Back/Overwritten by Aircraft Itself

Hey guys,

I'm currently working on an improved checklist for the Milviz 310R because the original checklist that came with the 310R was broken and can't be used in Assisted Checklist mode.

During working on the checklist I've encountered a really weird issue where one particular LVar will be revert back to its original value after the checklist copilot action altered that LVar's value.

The affected LVar is for the Control Lock and it's a boolean which 1 = Control Lock Installed/Visible and 0 = Control Lock Removed/Invisible

This Control Lock can be removed by clicking on it or via the EFB tablet and can only be installed via the EFB Tablet.

1678339636116.png

The issue is that when I want the checklist's copilot action to either change the LVar value from 1 to 0 (Remove the Control Lock) or from 0 to 1 (Install the Control Lock), the change will be performed but the value will immediately revert back to its original value.

My first checklist item is to verify if the control lock is removed and remove it if it's not.

I used the normal code that anyone can think of to program this part and here it is:

<Checkpoint>
    <CheckpointDesc SubjectTT="Control Locks" ExpectationTT="Remove and Stow"/>
    <ForceCamera name="Lower_Switch_Panel"/> 
    <Test>
        <TestValue>
            <Operator OpType="EQUAL">
                <Val Code="(L:C310_Control_Lock)"/>
                <Val Value="0"/>
            </Operator>
        </TestValue>
        <Action Copilot="True" Condition="TestValueFalse" Once="true" Code="0 (&gt;L:C310_Control_Lock)"/>
        <Instrument Id="C310_Control_Lock"/>
    </Test>
</Checkpoint>

But as I mentioned above, changing the LVar to 0 (Remove and Invisiable) will only work for a split second then it'll be reverted back to 1 (Installed and Visible).

Then I turned to the interior.xml of the Milviz 310R and found the code of the Control Lock item.

I borrowed the code for left click interaction which will remove the Control Lock (Bolded text below).

Here's the entire code for this Control Lock in the interior.xml:

<Component ID="Control_Lock" Node="C310_Control_Lock">
    <PART_ID>C310_Control_Lock</PART_ID>
    <UseTemplate Name="ASOBO_GT_Interaction_LeftSingle_Code">
        <LEFT_SINGLE_CODE>
             -1 (>L:C310_Control_Lock,bool)
        </LEFT_SINGLE_CODE>
        <TOOLTIPID>Control Lock Visibility</TOOLTIPID>
    </UseTemplate>
</Component>

<Component ID="CONTROL_LOCK_vis" Node="C310_Control_Lock">
    <PART_ID>C310_Control_Lock</PART_ID>
    <UseTemplate Name="ASOBO_GT_Visibility_Code">
        <VISIBILITY_CODE>(L:C310_Control_Lock,bool)</VISIBILITY_CODE>
    </UseTemplate> 
</Component>

With that weird -1 (>L:C310_Control_Lock,bool) code, I've managed to successfully make the Control Lock go away for good with the checklist copilot action!

<Checkpoint>
    <CheckpointDesc SubjectTT="Control Locks" ExpectationTT="Remove and Stow"/>
    <ForceCamera name="Lower_Switch_Panel"/> 
    <Test>
        <TestValue>
            <Operator OpType="EQUAL">
                <Val Code="(L:C310_Control_Lock)"/>
                <Val Value="0"/>
            </Operator>
        </TestValue>
        <Action Copilot="True" Condition="TestValueFalse" Once="true" Code="-1 (&gt;L:C310_Control_Lock)"/>
        <Instrument Id="C310_Control_Lock"/>
    </Test>
</Checkpoint>

I've used the BehaviourDebug window to monitor the value of this LVar and similar to before, the value got changed briefly into -1.

But then, unlike before, the value went to 0 (Removed and Invisible) and stayed there. It didn't revert back to 1 (Installed and Visible) which is the original state!

1678340425025.png

With that, I thought I can also make the installation of the Control Lock stick as well but unfortunatly, it's not working.

Due to there's no existing codes in the interior.xml file for installation of the Control Lock for me to copy, I can only use the only code that I can think of to set the LVar to 1 (Installed and Visible) in order to install the Control Lock.

<Checkpoint>
    <CheckpointDesc SubjectTT="Control Locks" ExpectationTT="Remove and Stow"/>
    <ForceCamera name="Lower_Switch_Panel"/> 
    <Test>
        <TestValue>
            <Operator OpType="EQUAL">
                <Val Code="(L:C310_Control_Lock)"/>
                <Val Value="1"/>
            </Operator>
        </TestValue>
        <Action Copilot="True" Condition="TestValueFalse" Once="true" Code="1 (&gt;L:C310_Control_Lock)"/>
        <Instrument Id="C310_Control_Lock"/>
    </Test>
</Checkpoint>

Unfortunetly, this is not working. The LVar can be set to 1 (Installed and Visible) by the copilot action but it'll be immediately revert back to 0 (Removed and Invisible).

I've talked with Matt from WTT and he suggested that maybe it's the EFB tablet's JS codes that's setting the LVar every frame based on the state stored in the EFB.

I've also posted this issue to the Milviz Discord but at this moment, no respond yet.

I would like to thank you all for your time to read my post and please, let me know your thoughts!

Please let me know if there's a way to make the LVar change stick or how to troubleshoot the issue and find exactly what's the reason of the LVar keeps reverting back on itself!


Regards,

Meo

aircraftbugdevmodehelpdevs
1678339636116.png (3.6 MiB)
1678340425025.png (1.2 MiB)
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

1 Answer

·
MV-JimStewart avatar image
MV-JimStewart answered meochan commented

Hi Meo. You should have received some answers by now if you've brought this to our attention elsewhere, but I thought I'd reply here as well to give some insight as to what is likely going on. Much of the 310R is controlled via WASM code, including many, many items that have their state saved via individual tail numbers. It's very likely that there's a conflict between the lvar you are trying to set and the code wanting to revert it.

We're investigating the issue of the checklists breaking and will likely provide an update for the aircraft at some point down the road. However, it's very likely that the in-game checklist will be for reference only and not include any auto-complete features.

5 comments
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

meochan avatar image meochan commented ·

Hey man, thank you for the answer!

I've finally managed to figure this one out as well as the pitot cover, engine cover, etc.

After digging through all the LVars in the game and checking them one by one while installing and removing the control lock, I've managed to find another LVar that's also related to the control lock.

It turns out that there's another set of LVars also being changed while these self-reverting actions take place:

It's called L:C310_TAB_XXXX.

So I've managed to make the control lock installation stick with these 2 commands:

<Action Copilot="True" Condition="TestValueFalse" Once="true" Code="1 (&gt;L:C310_Control_Lock,bool)"/>
<Action Copilot="True" Condition="TestValueFalse" Once="true" Code="1 (&gt;L:C310_TAB_LOCK,bool)"/>

And for the checklist with auto-complete features, I'm actually almost done with the pre-flight checks and the shutdown procedure. I can try to finish it all and I'm happy to share that with you guys to implement it to the aircraft instead of posting it to flightsim.to. Everyone deserves a good assisted checklist.

I've also identified some small issues like some switches missing PART_ID (i.e. C310_Nav_Selector, DEICE_Switch_PitotHeat), and orders of the LEFT_SINGLE_CODE were reversed for some of the circuit breakers (i.e. CB_PITOT_HEAT, CB_FLAP_MOTOR ).

And the tooltip is not changing when you pop the Left Alternator breaker in and out. It'll say "Closed" forever due to one line of animation code missing from the LEFT_SINGLE_CODE.

As I keep discovering these little issues and fixing them, can you share with me a good way to communicate and share these bugs with you? Can I DM you with my current findings?

The 310R is a fantastic plane and I just can't wait for your PC-12!

0 Likes 0 ·
MV-JimStewart avatar image MV-JimStewart meochan commented ·
You can absolutely DM me.


We're not doing a PC-12, that must be someone else!


0 Likes 0 ·
meochan avatar image meochan MV-JimStewart commented ·
That was awkward lol. I meant for PC-6. Haven't bought it but I'll definitely get one real soon. (As soon as I finish up the 310R's checklist lol)

I'll DM you shortly!

0 Likes 0 ·
MV-JimStewart avatar image MV-JimStewart meochan commented ·

It doesn't look like we can DM on here, but can I point you towards our public discord channel? You can certainly send me a message once you've joined on there: https://discord.gg/WMK8qupwX9

0 Likes 0 ·
meochan avatar image meochan MV-JimStewart commented ·
Hey man I've just sent you a DM. It's the same name Meo Chan and the same profile pic as here.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.