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

Different Pilots Selector

Messages
10,163
Country
us-arizona
Hey all,

Ready for another cool idea? (just say yes... )

What if you could select one of three different models of pilots in the same plane? You could have a male pilot, a female pilot, and a couple, male and female..

This would be selected by a clickable switch on the panel, or a popup.

You would have a default model pilot, lets say male, and the button would cause the male to hide, the female to appear, then again, the female hides, and the couple appears.

Now, the tricky part. How would you do this? You are hiding two and causing one to appear.

My thoughts are that you would have a;
* pilot_select_switch...................XML that brings up each pilot, one at a time

Then you would have the appearence nodes XML parts;
* pilot_select_01.................male
* pilot_select_02.................female
* pilot_select_03.................couple


I have a 'sky door' animation for the Kodiak that will 'hide' the entire rear hatch assembly via the click of a button, (for the skydiver option). The door by default 'appears' when you boot up the plane, the button hides it, then unhides it.

My question is; how on earth do you write the code for 3 different popups?

This could be a pretty cool feature as you could have this for aircraft interior variants;
* Seats...............default
* No Seats...........option one
* Cargo/No Seats......option two
* Seats with Passengers...........option three

Another use would be for say a WWII plane or jet fighter;
* No bombs loadout
* Missle racks
* Bomb racks
* Sidewinders and laser guided bombs


Here is the code for the sky door.

Any idea's?


Code:
<part>
   <name>sky_door_switch</name>
      <animation>
	<parameter>
	  <code>(L:sky_door_visible, bool) 50 *</code>
 	  <lag>400</lag>
	</parameter>
      </animation>
   <mouserect>
	<cursor>Hand</cursor>
   <tooltip_text>Hide Cargo Door for Sky Diver Mode</tooltip_text>
   <callback_code>(L:sky_door_visible, bool) ! (>L:sky_door_visible, bool)</callback_code>
   </mouserect>
</part>



<part> 
      <name>sky_door</name>
            <visible_in_range>
               <parameter>
               <code>(L:sky_door_visible, bool)</code>
               </parameter>
           <minvalue>-1</minvalue>
           <maxvalue>0</maxvalue>
    </visible_in_range>
</part>
 
Quit thinking only in binary!

Use a "button" that sequences from zero to three...

0 = off
1 = male pilot
2 = female pilot
3 = male & female pilot/copilot
 
Hi Bill,

Code:
<part>
   <name>seat</name>
   <mouserect>
     <cursor>Hand</cursor>
     <tooltip_text>Toggle pilot</tooltip_text>
     <callback_code>
       (L:PILOT SHOW,enum) 1 + 4 % (&gt;L:PILOT SHOW,enum)
     </callback_code>
   </mouserect>
</part>

Code:
<part>
   <name>pilot_1</name>
      <visibility>
        <parameter>
          <code>
            (L:PILOT SHOW,enum) 1 ==
          </code>
        </parameter>
      </visibility>
   <mouserect>
     <cursor>Hand</cursor>
     <tooltip_text>Toggle pilot</tooltip_text>
     <callback_code>
       (L:PILOT SHOW,enum) 1 + 4 % (&gt;L:PILOT SHOW,enum)
     </callback_code>
   </mouserect>
</part>

Code:
<part>
   <name>pilot_2</name>
      <visibility>
        <parameter>
          <code>
            (L:PILOT SHOW,enum) 2 ==
          </code>
        </parameter>
      </visibility>
   <mouserect>
     <cursor>Hand</cursor>
     <tooltip_text>Toggle pilot</tooltip_text>
     <callback_code>
       (L:PILOT SHOW,enum) 1 + 4 % (&gt;L:PILOT SHOW,enum)
     </callback_code>
   </mouserect>
</part>

Code:
<part>
   <name>pilot_3</name>
      <visibility>
        <parameter>
          <code>
            (L:PILOT SHOW,enum) 3 ==
          </code>
        </parameter>
      </visibility>
   <mouserect>
     <cursor>Hand</cursor>
     <tooltip_text>Toggle pilot</tooltip_text>
     <callback_code>
       (L:PILOT SHOW,enum) 1 + 4 % (&gt;L:PILOT SHOW,enum)
     </callback_code>
   </mouserect>
</part>

As usual the code is not tested but I hope you get the principle. As Bill suggested you should simply change your visibility variable from binary to enum format. In the sample above it is assumed that you have three different pilots for your aircraft. By clicking on the pilot (or the seat if no pilot is inside) the PILOT SHOW variable is incremented. The module operation "4 %" makes sure that the variable just counts up to "3" and then resets to "0".

Here is the problem: if you are using skinned mesh animations for animating your pilot you cannot use visibility code! For some reason ACES decided that such an attempt will screw up your mesh.

Cheers,
Vitus



oooh and because you asked for the Bleriot in the other thread a couple of days ago: have a look at SOH.
 
Many thanks guys.

Enum.. arrgh.. I should have remembered that. Just like 'pages' in a screen gauge, but with model parts instead.


Vitus, I hope you are wrong on the mesh and animation via appearence. Hopefully this will not fall under that category. Luckily the first model will be in trusty ole FS9 format.

:D


Going to check that link on the Bleriot! Domo Arrigatto.
 
Hi Bill,

don't get me wrong - for "normal" Animations you won't get any problems. It's just a problem if you are using a skinned mesh with bones animations. ;)

Vitus
 
Ahhh... roger.

I do not use such sophisticated devices of the gaming world. Just hinged mechanical bits.
 
It drives you nuts. Ask Bjoern! :rotfl:

Hey, the folding handrail still works! As did the gear! The light splashes work as well!


Just like everything else out there, it's just the first time that gives you a headache. :D
 
can't be! I am working on the wing-warping animation for the second wing and it still hurts a lot! :yikes:
 
Hi Folks

Silly question,
so guessing I'm missing something. :D

Why not just use the payload mechanism
to control your various object's visibility,
and name the payload stations accordingly ?

That'll also adjust the aircraft handling characterisitics.

HTH
ATB
Paul
 
Hey Paul,

I hadnt heard of this. I am guessing its for FSX. This bird I am building presently is for FS9.

Changes the trim! Outstanding!
 
Paul, the problem with that is two-fold:

1. it requires that one code a C gauge to read/write changes to the aircraft.cfg file, or rely on the sim's built-in GUI, which of course doesn't save the changes when unloading the a/c.

2. after writing new values to the aircraft.cfg file, one must force a "Reload Aircraft" event, which reinitializes the entire panel system, potentially reseting some other panel state variables that may have already been set.
 
Thanks Paul for the heads up. Some ingenious coding there.

You know. I wonder if, for the sake of payload weight, if one could place fuel in fuel tanks, a bit like a submarine having trim tanks, and cause 'instant' displacement without requiring the plane to be rebooted.

One would need to require finding a way to rig the 'extra effects' fuel tanks (trim tanks) to keep them from draining. Perhaps some gauge code that routes only the wing tanks to the engine, but have a central center tank and aux tank for two passengers and cargo?


It amazes me how some of you gauge makers can come up with cool idea's with gauge code. What a gift.
 
Paul, the problem with that is two-fold:

1. it requires that one code a C gauge to read/write changes to the aircraft.cfg file, or rely on the sim's built-in GUI, which of course doesn't save the changes when unloading the a/c.

2. after writing new values to the aircraft.cfg file, one must force a "Reload Aircraft" event, which reinitializes the entire panel system, potentially reseting some other panel state variables that may have already been set.
Hi Bill
You can get around the need for the extra gauges ect for payload by just using vis code with different weights, so 150lb female pilot,180 the guy and 340 for the couple :)
Wozza
 
Hi Folks

wozza -
Exactly my point. :D

Gauge aspect is an alternative, but non-essential.





Fr Bill -
Are the payload variables non-writable in FS9 ?

What benefits are there
of writing such data into the aircraft.cfg,
as it then affects all variants ?



If you were to go to the extent of
creating a gauge to write persistent data,
then surely it'd be preferable to
write-to/read-from some non-internal cfg file.

You can then save/reload variant specific data,
at your convenience
without requiring aircraft reload events
which reinitialize other variables.

You could also save additional data,
e.g.
airframe wear and tear,
panel switch states,
etc.



HTH
ATB
Paul
 
Last edited:
Are the payload variables non-writable in FS9 ?

What benefits are there
of writing such data into the aircraft.cfg,
as it then affects all variants ?

Paul, payload station weights aren't even "writable" in FSX, except via a SimConnect module. Forget about FS9.

The only practical method that will actually affect the FDE is to pre-set the station loads via the aircraft.cfg file entries, and that may only be read during an initial load or reload of the aircraft...

...hence the need to read/write to the aircraft.cfg via an active gauge. This is what Eaglesoft has used for the Citation X v2.0, and it works for both FS9 and FSX versions. I have coded a similar (but simpler) version for the forthcoming CJ1+.

The user is presented with an overhead view of the aircraft's interior, and simply "clicks" on the seats that will be occupied by crew and/or pax, and the "default weight" is written to the aircraft.cfg file. Clicking on the "Save" button will write then reload the aircraft.

The CX v2.0 differs only insofar as the user can adjust the pax individual weights using a spinner rather than simply using a default weight. The effect in the CX v2.0 is more dramatic than is that of the CJ1+ because there are more seats. It is entirely possible -for example- to overload the rear of the cabin and aft baggage area to the extent that the pilot will have a lot of control issues, and may in fact actually raise the nose wheel off the ground! :yikes:

This means that the user absolutely must pay attention to the load/balance of the a/c prior to takeoff... :D

Code:
station_load.0=170,  11.5,    0.0,  0.0, Pilot      // placed in the middle to overcome FS's pilot assymetry instability
station_load.1=170,  11.5,    0.0,  0.0, Co-Pilot   // placed in the middle to overcome FS's pilot assymetry instability
station_load.2=  0,   9.0,    0.0,  0.0, Jumpseat   // placed in the middle to overcome FS's pilot assymetry instability       
station_load.3=170,   6.5,   -1.2,  0.0, Passenger 1 Row 1      
station_load.4=170,   6.5,    1.2,  0.0, Passenger 2 Row 1      
station_load.5=170,   3.5,   -1.2,  0.0, Passenger 3 Row 2      
station_load.6=170,   3.5,    1.2,  0.0, Passenger 4 Row 2        
station_load.7= 90,  13.0,    0.0,  0.0, Forward Baggage
station_load.8= 50,  -5.0,    0.0,  0.0, Rear Baggage
 
Last edited:
Hi Folks

Paul, payload station weights aren't even "writable" in FSX,
except via a SimConnect module.
Forget about FS9.
Bill -
Cheers. :D

I've misunderstood the underlying principles
and wrongly been thinking -
if a SimVar was writable
it would be from both SimConnect and Gauge code. :o

Many thanks
ATB
Paul
 
Hi Bill
You can get around the need for the extra gauges ect for payload by just using vis code with different weights, so 150lb female pilot,180 the guy and 340 for the couple :)
Wozza

Wozza,

Is it possible to illustrate this in gauge code?


I still like the fuel cells idea; code states 'top off this tank' with this selection, empty that tank and fuel this tank with this next selection, etc.

All in all, I may just go with just the people mesh showing up instead of worrying about the weights. If only things would go super smoothly, lol...
 
Back
Top