Custom Pilot in Hangar

Dear Asobo Team, as requested by Mabel, i am here to report this:

  • during last updates of my products has been requested to remove the pilot from the hangar preview. The problem is this:
    Me as other devs, enclosed a custom pilot, with custom animations on the model, and in order to make all the animation working and make possible to hide just part of the pilot when the users want to have only the body, the only way (that i found) to follow the request is to set to 0 the weight on the pilot… so now yes, the pilot is not present in the hangar by default… BUT … this follow that now at any flight if a user want the pilot, they have to manually add the weight of the pilot in the loading page……
    My request is:
  • is there any possibility to remove this rule on the pilot present in the hangar? OR
  • could you help me, providing me a code line or any solition, to set to 0 only in the hangar the weight for the pilot? Or to hide the “pilotnode” only in the hangar ?

Thanks so much in advance!

Put a condition on the pilot visibility based on an L:VAR, store the L:VAR value inside the hangar.flt, taxi.flt, etc. And this way you can force it to hide in the hangar and show during normal flight.

Best,
R.

1 Like

Hello @DeimoS987 ,

For this you can use the native simvar (A:PLANE IN PARKING STATE, bool). If the aircraft is in the hangar, the var in question will return true. Otherwise, false. In the XML behavior file, you can add something like this for the pilots’ visibility (this is how I defined it on my EMB-110):

<Component ID="PILOT_0" Node="PILOT_0">
    <UseTemplate Name="ASOBO_GT_Visibility">
        <VISIBILITY_CODE>
            (A:PLANE IN PARKING STATE, bool) !
            (A:CAMERA STATE, enum) 3 ==
            (A:CAMERA STATE, enum) 4 == || &amp;&amp;
        </VISIBILITY_CODE>
    </UseTemplate>
</Component>
<Component ID="PILOT_1" Node="PILOT_1">
    <UseTemplate Name="ASOBO_GT_Visibility">
        <VISIBILITY_CODE>
            (A:PLANE IN PARKING STATE, bool) !
            (A:CAMERA STATE, enum) 3 ==
            (A:CAMERA STATE, enum) 4 == || &amp;&amp;
            (L:XMLVAR_CopilotVisibleOnVC, bool) || &amp;&amp;
        </VISIBILITY_CODE>
    </UseTemplate>
</Component>

What the above does is hide the pilots in the hangar, but showing them in flight only in the exterior view and not in the cockpit view, as you do not want them to be rendered in the cockpit view, unless you want the copilot (for example) to be there, which you can use a L: var for that matter, just like in the example above.

Just make sure the pilots’ nodes match the ones from BOTH the 3D model and the aircraft.cfg:

[PILOT]
pilot_attach_node = "PILOT_0"
copilot_attach_node = "PILOT_1"

EDIT: The aircraft.cfg params above are if you are using the native MSFS pilot characters. Otherwise, if you are using your custom pilot character model, you can just rename the ID and Node params from the XML to the ones on your 3D model, and there is no need to define them in the aircraft.cfg file for instance.

You can use the solution Raul (@SimbolFSReborn) gave you in his reply above, or use the solution I give you here. Whichever you use, you should get the same result. :slight_smile:

Regards,
Carlos Gonzalez
NextGen Simulations

1 Like

Thanks so much guys! I’ll try them out!

Just to be more precise, my condition is:

  • pilot is visible in exterior (both body and head) wile when in the interior view, head is not visible and body is visible only if you activate the relative switch…and so now yes, i have to add the condition that on hangar all the nodes have to be hiden

I’ll try your solutions, thanks again so much guys!
I’ll let u know

2 Likes