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

FS2004 3D Kohlsman disc problem

Messages
231
Country
us-alabama
Hi Guys

I need to create a 3d Kohlsman disc for my VC. I have a working 2d gauge with a Kohlsman disc .bmp element I could rewrite and display behind the 3d gauge face, but the disc is supposedly radium painted and must display as lighted all the time at night. My solution is to make all the active elements as 3d parts with light map textures.

All of the information I have found for 3d Kohlsman part code is for drum displays. So I tried a mkmdl.parts entry based on a drum code :

Code:
  <part>
	<name>kohl_disc</name>
	<animlength>200</animlength>
      <animation>
	<parameter>
	  <code>(A:Kohlsman setting hg, inHg) 10 % 0.05 /</code>
	</parameter>
      </animation>
</part>

It rotates, but only on every 3 or 4 clicks of the Kohlsman knob, where as the 2d disc rotates on every knob click. This causes the two discs to fall out of sync.

I am new to xml and have been trying to find a trial and error solution for most of a week. Nothing seems to work, should I trash the 3d disc and try to find a lighting solution for the 2d element?

Carl
 
Carl, I've done many 3d drums in the past, but for my last project (B737-200C for Milviz) I had far too many animated parts in the project and exceeded the maximum...

As a result, since I had a total of 166 3d drums animated, I reverted to the "old school" method of projecting a 2d gauge instead.

However, what I did was to take the existing 3d drums and removed their animations entirely. Then I selected only the 3 or four polys of the drum's surface that could be seen, and deleted the rest, leaving only a curved surface.

Then I Attached the 3d drum polys to a single object, and UVM Mapped them to an area of a $B737_FMS.bmp texture, so I could then place the "digital displays" on them via the panel.cfg file.

To provide "lighting" I used the same $B737_FMS.bmp texture in the Self-Illumination slot of the FSX Material, and set the Emissive Mode to "Additive" so they'd be lighted all the time, as the brightness will be controlled in the gauge itself (see the XML script below).

Were I to do it again, I think I'd probably Attach all of the "drum polys" into a single object and arrange them on the UVW Map so that I could create a single gauge for all of them.

In any case, here is the XML "gauge" for my Altimeter drum displays, including some semi-transparent overlays for lighting control:
Code:
<Gauge Name="B737 Altimeter Gauge" Version="1.0">
  <Image Name="B737_Alt_Digits_Background.bmp" />
  <!-- ALTITUDE DIGITAL DISPLAY -->
  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Altitude_Digits_Mask.bmp" >
      <Axis X="0" Y="0"/>
    </MaskImage>
    <Image Name="White_Digit_Strip_Sm.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="289"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:INDICATED ALTITUDE, feet) abs 99999 min 0 max 100000 % 10000 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Altitude_Digits_Mask.bmp" >
      <Axis X="18" Y="0"/>
    </MaskImage>
    <Image Name="White_Digit_Strip_Sm.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="289"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:INDICATED ALTITUDE, feet) 99999 min 0 max 10000 % 1000 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Altitude_Digits_Mask.bmp" >
      <Axis X="36" Y="0"/>
    </MaskImage>
    <Image Name="White_Digit_Strip_Sm.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="289"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:Indicated Altitude, feet) 99999 min 0 max 1000 % 100 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Altitude_Digits_Mask.bmp" >
      <Axis X="54" Y="4"/>
    </MaskImage>
    <Image Name="Alt_Number_Strip_narrow.bmp">
      <Nonlinearity>
        <Item Value= "10" X="0" Y="0"/>
        <Item Value="0" X="0" Y="196"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:Indicated Altitude, feet) 99999 min 0 max 100 % 10 /
      </Value>
    </Shift>
  </Element>

  <!-- MILLIBARS DIGITAL DISPLAY -->
  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="0" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG:1, mbar) abs 9999 min 0 max 10000 % 1000 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="16" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG:1, mbar) abs 9999 min 0 max 1000 % 100 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="34" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG:1, mbar) abs 9999 min 0 max 100 % 10 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="51" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG:1, mbar) abs 9999 min 0 max 10 % 1 / flr
      </Value>
    </Shift>
  </Element>

  <!-- inHg DIGITAL DISPLAY -->
  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="71" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 100 % 10 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="88" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 10 % 1 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="105" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 1 % 0.1 / flr
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <MaskImage Name="B737_Alt_Baro_Mask.bmp" >
      <Axis X="122" Y="30"/>
    </MaskImage>
    <Image Name="B737_White_Digit_Strip.bmp">
      <Nonlinearity>
        <Item Value= "0" X="0" Y="0"/>
        <Item Value="10" X="0" Y="286"/>
      </Nonlinearity>
    </Image>
    <Shift>
      <Value>
        (A:KOHLSMAN SETTING HG, inHg) abs 99 min 0 max 0.1 % 0.01 / near
      </Value>
    </Shift>
  </Element>

  <Element>
    <Position X="0" Y="0"/>
    <Visible>(A:ELECTRICAL MASTER BATTERY,bool) !</Visible>
    <Rectangle Width="140" Height="61" FillColor="black" Transparency="1.00"/>
  </Element>
  
  <Element>
    <Position X="0" Y="0"/>
    <Visible>(A:ELECTRICAL MASTER BATTERY,bool)</Visible>
    <Element>
      <Visible>(L:SwitchMainPnlLts, enum) 0 ==</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="1.00"/>
    </Element>
    <Element>
      <Visible>0.1 1 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.32"/>
    </Element>
    <Element>
      <Visible>1.1 2 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.34"/>
    </Element>
    <Element>
      <Visible>2.1 3 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.35"/>
    </Element>
    <Element>
      <Visible>3.1 4 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.40"/>
    </Element>
    <Element>
      <Visible>4.1 5 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.45"/>
    </Element>
    <Element>
      <Visible>5.1 100 (L:SwitchMainPnlLts, enum) rng</Visible>
      <Rectangle Width="140" Height="61" FillColor="black" Transparency="0.50"/>
    </Element>
  </Element>
</Gauge>
Here is the panel.cfg entry for this $VC group of gauges. The entry for the Altimeter is gauge12:
Code:
//--------------------------------------------------------
[Vcockpit16]
Background_color=0,0,0 
size_mm=1024,1024
visible=1
pixel_size=1024,1024
texture=$B737_FMS

gauge00=B737_XML!B737_Course,  6,565,70,79
gauge01=B737_XML!B737_Heading,  76,565,75,79
gauge02=B737_XML!B737_SpeedHold,  147,565,75,79
gauge03=B737_XML!B737_AltitudeHold,  221,565,116,79
gauge04=B737_XML!B737_VSpeed,  342,566,235,61
gauge05=B737_XML!B737_RadioDisplay,  7,643,429,179
gauge06=B737_XML!B737_XpdrDisplay,  444,646,105,36
gauge07=B737_XML!B737AltSelectDisplay,  555,647,134,35
gauge08=B737_XML!B737_TotalAirTemp,  588,568,54,37
gauge09=B737_XML!B737_EPR_TAT,  7,824,65,169
gauge10=B737_XML!B737_EPR_Gauge,  77,826,122,55
gauge11=B737_XML!B737_ZFW_Gauge,  77,886,100,70
gauge12=B737_XML!B737_Altimeter_Gauge,  443,693,140,61
gauge13=B737_XML!B737_DME_Gauge,  206,826,146,71
gauge14=B737_XML!B737_APU_Hobbs_Gauge,  77,  962 ,110,34
gauge15=B737_XML!B737_Pressurization,  202,915,374,42
Here is a half-size image of the $B737_FMS.bmp file I used as a panel layout background image, and a screenshot of the altimeter's drums as seen in the sim. If you look closely, you can see the 'curved surface' of the drums that provides the illusion of the drum moving instead of the actual 2d bitmap! :)
 

Attachments

  • B737_FMS.png
    B737_FMS.png
    124.3 KB · Views: 648
  • B737_200_Altimeter.png
    B737_200_Altimeter.png
    557.3 KB · Views: 593
Last edited:
Bill
Your gauge looks wonderful! Your code is way beyond my level of understanding. It looks like FSX materials are very different from FS9 which I am working in.

Here is a link to video of my 2 gauges side by side. The 2d is on the left, the 3d is on the right, zoomed on in the new window.

http://www.crabdesign.x10.mx/kohl prob.avi


I am going to study your code and see if I can make sense of it. And also see if I can find your tutorial on gauge lighting for FS9.

Carl
 
Bill

I have read thru your FSX Emissive Textures and How They
Relate to Virtual Cockpit Lighting .pdf tutorial and your code makes a little more sense to me now. I still do not think it will help me with my problem in FS9.

In the FS9 versus FSX section of the .pdf, though there are a couple of things that might. You wrote:
In
previous versions of FS there were only two choices for internal gauge lighting: 1)
Luminous and 2) Bright. The Luminous tag will apply the color and intensity to the
tagged gauge bitmaps, based on the Luminous= entry in the panel.cfg file. The
Bright tag will apply full intensity WHITE (RGB:255,255,255) to the selected gauge
bitmaps.

I have tried <Image Name="f4u1_kollsman_dial.bmp" PointsTo="North" Bright="Yes">

That works in the 2d panel, but when I add the gauge to the VC the .bmp appears dark at night. I have tried the Luminous="Yes” statement also with the same result in the VC. I checked my panel.cfg file after reading:

The Luminous tag will apply the color and intensity to the
tagged gauge bitmaps, based on the Luminous= entry in the panel.cfg file.

I can find no Luminous= in my panel.cfg. How and where in the .cfg file would this be placed? And would it's display be based on a lighting switch?

Carl
 
Bill

I have hit a problem with the tutorial. I get to step5 and move my version of the P1_L.BMP into the aircraft's texture folder, when I check it at night in fs9 the gauge and background remain dark. I have the P1 maps correctly placed in the gmax material editor, both maps are 256/256 8bit. The $P1 is filled with black and the P1_L is filled with white. The panel.cfg entry seems to be working correctly as the gauge and background display correctly.

[VCockpit04]
file=kohl_background.bmp
size_mm=512,512
pixel_size=1024,1024
texture=$kohl
background_color=0,0,0
visible=1
gauge01=1_f4u1_gauges!f4u1 kohl_disc,84,22,314,314,

I copied my version, kohl_L.bmp , of the P1_L.bmp to the aircraft's texture folder in its original 256/256 8bit white color. Any idea where I dropped the ball on this?

Carl
 
It took me a while to figure out I had to turn the lights on to get the gauge to illuminate. Now I have to figure a way to keep it lit all the time without having to use the light switch. Any suggestions?

Carl
 
Last edited:
The lighting "control" in FS9 is via the Alpha channel of your _L lightmap.

The Alpha channel may be pure black or pure white. IIRC, pure black Alpha will be controlled via the landing light switch, the pure white Alpha is controlled by the panel light switch.

What I've always done is to use the landing light circuit, and force landing lights "ON" all the time. The actual landing and/or taxi lights are then controlled via custom L:var for <Visibility>.

I may have the black vs. white Alpha bas-ackwards, but the principle remains the same either way. Keep in mind that I haven't worked on an FS9 model in almost six years now... :rotfl:
 
Last edited:
Bill

The _L.bmp I am using is 256/256 pure white 8bit and I did not create an alpha channel that I know of, it lights up on the landing light switch.

I would prefer using the panel light switch as I am not using that circuit.
But all my efforts to create a black alpha _L.bmp have failed to light up using the panel light switch.
First I tried a 256/256 pure black 8bit with no luck.
Then a 256/256 pure black and created an alpha channel with image tool and saved it as a dxt1 with no luck again.
Finally I tried 256/256 pure white with a single pure black pixel in the lower left corner of the .bmp, created an alpha from the U/L pixel and saved as a dxt1 still no light.

I guess I will have to use the landing lights as you suggest.

Carl
 
Hi,

If a pure white BMP without an alpha channel works correctly with the landing light switch, then you will need a pure white BMP with an all black alpha channel to work correctly with the panel lights switch. Create a copy of your all white BMP file and make it pure black. Then load your all white BMP file into a program like DXTBmp. Choose Alpha/Import Alpha Channel and load your pure black BMP file. Finally use File/Save As/Extended Texture and use the drop down box to save as a DXT1 or DXT3 file (DXT5 is OK for FSX).

Hope this helps,
 
Tom

I was under the impression that DXTBmp could only be used on freeware projects. This Corsair is being developed as payware.

Thanks in part to your guidance in the past. I think I can write the visibility codes to use the landing light circuit.

The only challenge to my limited xml skills will be the code to force which ever circuit I use to stay on all the time.

I do thank you for the info on how to make the black alpha and many Thanks for your help in the past.

Carl
 
Here:
Code:
<Update>
    (A:LIGHT LANDING ON,bool) ! if{ (>K:LANDING_LIGHTS_ON) }
</Update>
The script above will keep the landing lights on, even if someone tries to use the keyboard command to turn 'em off... :D

The script first checks to see if the landing lights are "off," and if so sends the command to turn 'em "on" (again).
 
Bill
I have never seen this <Update> expression used in a code before. Would it be used in a 2d gauge or a 3d part? I have tried it as both with no success, but have not had time to really work on it.

Carl
 
Bill
I have never seen this <Update> expression used in a code before. Would it be used in a 2d gauge or a 3d part? I have tried it as both with no success, but have not had time to really work on it.

Carl

The <Update> section is a special place in a 2d gauge to put any script (code) that you wish to be constantly evaluated, and acted on if the trigger condition changes. In this case an attempt to "shut off" the landing lights via the keyboard or other method is detected and prevented. :D

In a 3d part you would use this method instead to accomplish the same task:
Code:
  <PartInfo>
    <Name>Logic</Name>
    <Visibility>
      <Parameter>
        <Code>
              (A:LIGHT LANDING ON,bool) ! if{ (>K:LANDING_LIGHTS_ON) }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>
 
Last edited:
Bill

The 3d part version worked perfectly! My attempts at the 2d not so much. This is my most current failure.

Code:
<Gauge Name="f4u1 landlighton" Version="1.0">
            <Image Name="f4u1_ll_on_bg.bmp"/>
   <Element>
        <Visible>
<Update>
    (A:LIGHT LANDING ON,bool) ! if{ (>K:LANDING_LIGHTS_ON) }
</Update>
        </Visible>
   </Element>
</Gauge>

But I am still working on it!

Carl
 
Bill

The 3d part version worked perfectly! My attempts at the 2d not so much. This is my most current failure.

Carl, <Update> is on the same "level" as the <Element> so it cannot go inside of an <Element>

Code:
<Gauge Name="f4u1 landlighton" Version="1.0">
     <Image Name="f4u1_ll_on_bg.bmp"/>
     <Update>
         (A:LIGHT LANDING ON,bool) ! if{ (>K:LANDING_LIGHTS_ON) }
     </Update>
     <Element>
            (* Anything you need to use an <Element> for goes in here *)
     </Element>
</Gauge>
 
Bill

I think I see now. I could have added the:

Code:
     <Update>
         (A:LIGHT LANDING ON,bool) ! if{ (>K:LANDING_LIGHTS_ON) }
     </Update>

into the code for the vc version of the altimeter and run it from there, or I could have made it as a stand alone gauge as your edit indicates. Is that correct?

Carl
 
Last edited:
I think I see now. I could have added...

into the code for the vc version of the altimeter and run it from there, or I could have made it as a stand alone gauge as your edit indicates. Is that correct?

That is 100% correct! I generally try to have only one <Update> section defined within one "gauge" and place all of the things I need evaluated there, regardless of what they are actually for...

...it's sort of like putting "all my begs in one ask it..." :D
 
Bill

Roger That! Thank you for your help with this! And many Thanks for all the help over the past few months, I think I would have given up in frustration without it.

Carl
 
Back
Top