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

Pressurization Knob

Messages
50
Country
australia
Hi Guys, Ive been putting this off for a while but it's getting to the point that I need to start dotting I's and crossing T's.

You guys were so helpful with my last problem...Still can't get over how effective the solution was.

So I have a new one. I'm Attempting to program my pressurization knob. The part is animated from 0 to 100 and is intended to set from zero to 10 thousand feet cabin altitude. I have tried it two ways and neither seem to work. Tool tip appears but none of the changing functions work.

Attempt 1

Code:
    <PartInfo>
    <Name>orbx_Cab_P_Knob</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>(A:PRESSURIZATION CABIN ALTITUDE GOAL, Feet) 0.01 * </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>hand</Cursor>
      <TooltipText>Cabin Altitude Goal</TooltipText>
      <MouseFlags>WheelUp+WheelDown+LeftDrag+LeftSingle</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (M:X) (&gt;L:PRSSRZTN, number) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:KEY_PRESSURIZATION_PRESSURE_ALT_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:KEY_PRESSURIZATION_PRESSURE_ALT_DEC) }
        (M:Event) 'LeftDrag'    scmi 0 == if{ (M:X) (L:PRSSRZTN, number) - 0 &lt; if{ (&gt;K:KEY_PRESSURIZATION_PRESSURE_ALT_INC) } els{ (&gt;K:KEY_PRESSURIZATION_PRESSURE_ALT_DEC) } }
      </CallbackCode>
    </MouseRect>
  </PartInfo>

Attempt 2

Code:
<PartInfo>
        <Name>orbx_Cab_P_Knob</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>PRESSURIZATION CABIN ALTITUDE GOAL</Variable>
                    <Units>Feet</Units>
                    <Scale>0.01</Scale>
                </Sim>
            </Parameter>
        </Animation>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Cabin Altitude Goal</TooltipText>
            <MouseFlags>LeftSingle+LeftDrag+Wheel</MouseFlags>
            <CallbackJumpDragging>
                <XMovement>
                    <Delta>30</Delta>
                    <EventIdInc>KEY_PRESSURIZATION_PRESSURE_ALT_INC</EventIdInc>
                    <EventIdDec>KEY_PRESSURIZATION_PRESSURE_ALT_DEC</EventIdDec>
                </XMovement>
            </CallbackJumpDragging>
        </MouseRect>
    </PartInfo>
They are both recycled from the microsoft modeldef.
Strange thing is i have used the same partinfo template for other parts.
I have gone over this about 50 times and can't see a stuff up. Maybe you guys can?

Thanks in advance.:o
 
Another thing to note is that the stationary part remains at key frame 100 when in Sim. Both code sets. Usually if you stuff up programing a part it stays at key 0
 
Just a wild stab in the dark: is there perhaps something in the aircraft.cfg that could be keeping this from working right? For instance that the aircraft is not actually pressurized?
 
Hi Blogga,

I'm looking at your first attempt here. Try removing the "KEY_" part of it. I had a look at the SDK and saw that they use the KEY_... in the string section as well, but in XML events usually don't come with this prefix. Therefore try this:

Code:
        (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:PRESSURIZATION_PRESSURE_ALT_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:PRESSURIZATION_PRESSURE_ALT_DEC) }

If you want to use a dragable lever, you might want to check out the code over at the FDSFSSDFSDFDDFFDS forums (Felix will kill me for that :p).
Have a look here, and here. I am using this code for 30+ animated parts in the VC and it works perfectly.

Cheers,
Vitus
 
CAUTION!

That one document (\Event IDs.htm) in the SDK isn't very clear, but...

Event ID
Everthing in the first column lists the C++ gauge "Commands"

String Name
The second column lists the XML script "Commands"

Description
The third column describes the "Commands"

Multiplayer
The fourth column indicates whether the "Command" works in Shared Cockpit/Multiplayer.
 
Last edited:
Hey Bill,

the funny thing about the pressurization events is, that the SDK states that the STRING commands are KEY_PRESSURIZATION_PRESSURE_ALT_INC and KEY_PRESSURIZATION_PRESSURE_ALT_DEC - that's right: with "KEY_" prefix, hence the confusion (I guess).

Vitus
 
Cabin pressurization
KEY_PRESSURIZATION_PRESSURE_ALT_INC| KEY_PRESSURIZATION_PRESSURE_ALT_INC | Increases the altitude that the cabin is pressurized to. | Shared Cockpit
KEY_PRESSURIZATION_PRESSURE_ALT_DEC| KEY_PRESSURIZATION_PRESSURE_ALT_DEC| Decreases the altitude that the cabin is pressurized to.| Shared Cockpit

This is from the user doc. Acording to it the variable starts with key for both. Maybe they made a mistake though so i will try it today.

Thanks for the fast reply guys.
 
Hey Bill,

the funny thing about the pressurization events is, that the SDK states that the STRING commands are KEY_PRESSURIZATION_PRESSURE_ALT_INC and KEY_PRESSURIZATION_PRESSURE_ALT_DEC - that's right: with "KEY_" prefix, hence the confusion (I guess).

Vitus

Oddly enough, that's one example I've glanced at only briefly, so never actually noticed the error(s)...
 
Just a courtesy message. I still haven't had a chance to test this. I've changed the entry but I'm in the middle of modeling something else at the moment and i hate exporting partial models.

I will report back as soon as I know.
 
I note that even the ESP SDK insists that the two key_events' XML script commands are:

(>K:KEY_PRESSURIZATION_PRESSURE_ALT_INC)
(>K:KEY_PRESSURIZATION_PRESSURE_ALT_DEC)

Try using something simpler for the MouseRect then, such as:

Code:
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (>K:KEY_PRESSURIZATION_PRESSURE_ALT_DEC) }
        (M:Event) 'RightSingle' scmi 0 == if{ (>K:KEY_PRESSURIZATION_PRESSURE_ALT_INC) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (>K:KEY_PRESSURIZATION_PRESSURE_ALT_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (>K:KEY_PRESSURIZATION_PRESSURE_ALT_DEC) }
      </CallbackCode>
 
I think i'm just going to create a Gauge that controls all pressurisation. Rather than relly on the hard coded fsx version. It will allow me to control things that the fsx version doesn't anyway.

I saw this done in fs2004 on some freeware before the pressurisation variables existed. Having a solid understanding of how pressurisation works from an engineering standpoint should allow me to design a comprehensive system to include valve bounce, pressure inlet variables, door seal control, fresh air vent flap, ect...

Disregard this thread now if you like...
 
OK i just finished my first test of my hand written XML pressurization system and it works great. A few minor tweaks like slowing the pressure dump and lessening the max rate but it works like a dream considering I wrote the whole thing in one hit.

It allows for the door seal to lessen pressurization efficiency and opening the door to trigger explosive decompression animation, (if I decide to model it). It also got me thinking about the temperature system and after these promising results I'm going to tie it into the same gauge.

Also i wrote my own electrictro hydraulic system which reacts to flap and gear position changes but doesn't require the motor to be running. It pressurizes with the master switch.

I will post it in the code bank when it's done because I couldn't get the hard coded pressurization to work and i have a feeling others will come to a similar problem when and if they ever do a pressurized aircraft.
 
Back
Top