• 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.

MSFS Pilot figures

Messages
938
Country
australia
So the NodesToHide action doesn't work, that's for sure.
Makes sense because the camera.cfg would probably look into the behaviour files to gather the node. so...
I apologise. I appear to have misled you.

NodesToHide, despite the name, doesn't work with nodes. It is actually L:variables that are in the list. When the camera is used those L:vars will be set to true otherwise they are set to false. You will need to have a visibility condition in the model behaviour file to read the status of the L:var and then hide the part.

It has been a while since I worked on NodesToHide and I had forgotten exactly how they work (I have a terrible memory so I usually forget about half of what I learn which is why I make posts on FSDeveloper, so I can refer to them later). Here is a post I made at the time:


Here is my complicated code for pilot visibility. Note how I am checking if it is a user aircraft, camera state, payload station weight, the XMLVAR from the NodesToHide in cameras.cfg and my own L: var on whether or not the pilot is visible:
Code:
            <UseTemplate Name="ASOBO_GT_Visibility">
                <VISIBILITY_CODE>
                    (A:IS USER SIM,bool)
                    if{
                        (A:CAMERA STATE,number) 2 !=
                        if{
                            (A:PAYLOAD STATION WEIGHT:1, pounds) 0 &lt;= if{ 0 } els{ (L:Drifter_Prefs_Pilot,bool) ! }
                        }
                        els{
                            (L:XMLVAR_PilotHidden) (A:PAYLOAD STATION WEIGHT:1, pounds) 0 &lt;= || if{ 0 } els{ (L:Drifter_Prefs_Pilot,bool) ! }               
                        }
                    }
                    els{
                        (A:GENERAL ENG COMBUSTION:1,bool)                   
                    }
                </VISIBILITY_CODE>
            </UseTemplate>
 
Messages
88
The easiest way to add the pilot models is using multiple cockpit LOD models. The options section in model.cfg controls that.

[model.options]
withExterior_showInterior=true
withExterior_showInterior_hideFirstLod=true
withInterior_forceFirstLod=true
withInterior_showExterior=true

You need to export a second LOD that has the PILOT_0 and PILOT_1 nodes. These nodes can be empties and placed right on the seats. Keep the scale at 1 but you can apply some rotation to get the models to sit in the seats nicely.

The LOD0, which is the cockpit you see with interior camera views would not have these nodes. With the above model options, it shows the LOD1 in external view and the pilots appear.

If you want to make the visibility dynamic based on payload weight, you could add the behavior code similar to what Anthony31 posted above.

If you also want to see a copilot model next to you while you're in the cockpit, you would add the copilot node to the LOD0 model.

This is the visibility behavior I used for pilot and copilot. I have click spots so you can make either of the models visible while you're inside and that is what the Lvar is for. But you can simply use the payload weight as the conditional.

XML:
                <Component ID="PILOT_0" Node="PILOT_0">
                    <!-- pilot visibility -->
                    <UseTemplate Name="ASOBO_GT_Visibility">
                        <VISIBILITY_CODE>(L:PILOT_VIS, Bool) (A:PAYLOAD STATION WEIGHT:1, pound) 20 &gt; and (A:CAMERA STATE, Enum) 2 != or (A:PAYLOAD STATION WEIGHT:1, pound) 20 &gt; and</VISIBILITY_CODE>
                    </UseTemplate>
                </Component>
                <Component ID="PILOT_1" Node="PILOT_1">
                    <!-- co-pilot visibility -->
                    <UseTemplate Name="ASOBO_GT_Visibility">
                        <VISIBILITY_CODE>(L:COPILOT_VIS, Bool) (A:PAYLOAD STATION WEIGHT:2, pound) 20 &gt; and (A:CAMERA STATE, Enum) 2 != or (A:PAYLOAD STATION WEIGHT:2, pound) 20 &gt; and</VISIBILITY_CODE>
                    </UseTemplate>
                </Component>
 
Messages
22
Country
hungary
The easiest way to add the pilot models is using multiple cockpit LOD models. The options section in model.cfg controls that.

[model.options]
withExterior_showInterior=true
withExterior_showInterior_hideFirstLod=true
withInterior_forceFirstLod=true
withInterior_showExterior=true

You need to export a second LOD that has the PILOT_0 and PILOT_1 nodes. These nodes can be empties and placed right on the seats. Keep the scale at 1 but you can apply some rotation to get the models to sit in the seats nicely.

The LOD0, which is the cockpit you see with interior camera views would not have these nodes. With the above model options, it shows the LOD1 in external view and the pilots appear.

If you want to make the visibility dynamic based on payload weight, you could add the behavior code similar to what Anthony31 posted above.

If you also want to see a copilot model next to you while you're in the cockpit, you would add the copilot node to the LOD0 model.

This is the visibility behavior I used for pilot and copilot. I have click spots so you can make either of the models visible while you're inside and that is what the Lvar is for. But you can simply use the payload weight as the conditional.

XML:
                <Component ID="PILOT_0" Node="PILOT_0">
                    <!-- pilot visibility -->
                    <UseTemplate Name="ASOBO_GT_Visibility">
                        <VISIBILITY_CODE>(L:PILOT_VIS, Bool) (A:PAYLOAD STATION WEIGHT:1, pound) 20 &gt; and (A:CAMERA STATE, Enum) 2 != or (A:PAYLOAD STATION WEIGHT:1, pound) 20 &gt; and</VISIBILITY_CODE>
                    </UseTemplate>
                </Component>
                <Component ID="PILOT_1" Node="PILOT_1">
                    <!-- co-pilot visibility -->
                    <UseTemplate Name="ASOBO_GT_Visibility">
                        <VISIBILITY_CODE>(L:COPILOT_VIS, Bool) (A:PAYLOAD STATION WEIGHT:2, pound) 20 &gt; and (A:CAMERA STATE, Enum) 2 != or (A:PAYLOAD STATION WEIGHT:2, pound) 20 &gt; and</VISIBILITY_CODE>
                    </UseTemplate>
                </Component>

This is the smartest and most useful code I've seen lately, thank you so much! Works like a charm!
Maybe there is a similar code for passengers? So there's a name for passengers instead of PILOT_VIS or COPILOT_VIS...maybe PASSENGER1_VIS or something?
 
Top