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

2 Stage Opening Door

Messages
26
Country
unitedkingdom
Hi Guys,

Currently building a new Chinook Helicopter for FSX. Im just trying animate the rear ramp. I trying to get it to open in 2 stages as it does in real life, ie half way open, when in flight, then open it fully when on the ground! Is there a way of doing this? Or do I need to create a new line in the modeldef file?

Any help or advice appreciated!

Cheers

Rich

Using FSDS 3.5
 
This is what I have got so far, but I think its slightly wrong!:o


<PartInfo>
<Name>ChinookRampSwitch</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>50 (L:Chinookramp,enum) 50 * +</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Left_Click-Down/Right_Click-Half/Right_Doubleclick-Up</TooltipText>
<MouseFlags>LeftSingle+RightSingle+Rightdouble</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == if{ -1 (>L:Chinookramp, enum) }
(M:Event) 'RightSingle' scmp 0 == if{ 0 (>L:Chinookramp, enum) }
(M:Event) 'Rightdouble' scmp 0 == if{ 1 (>L:Chinookramp, enum) }
</CallbackCode>
</MouseRect>
</PartInfo>

<part>
<name>Chinookramp</name>
<animation>
<Parameter>
<Code>50 (L:Chinookramp,enum) 50 * +</Code>
<Units>percent</Units>
</Parameter>
</animation>
</part>

Cheers

Rich
 
The only thing I see is that you are mixing FS9 and FSX XML script schemas in the same entry...

...also, <Units> is only used with a <Sim> construct. ;)

Code:
<part>
     <name>Chinookramp</name>
     <animation>
          <Parameter>
               <Code>50 (L:Chinookramp,enum) 50 * +</Code>
               <Units>percent</Units>
          </Parameter>
     </animation>
</part>

Try this instead:
Code:
<PartInfo>
     <Name>Chinookramp</Name>
     <Animation>
          <Parameter>
               <Code>50 (L:Chinookramp,enum) 50 * +</Code>
          </Parameter>
     </Animation>
</PartInfo>
 
You could also do two other routes.


One is to time your doors so that the first moves with keys zero through 50, then door 2 is keys 51 through 100. With gaps in the key points and the right door speed, you would have a nicely done dual door opening system. (I am using this system on my biz jet clam shell dual panel door).


Second, is to use door2 as your second door.


Coding the doors second door though is a nice way to go. Its more solid. I guess I like simple approaches.



Bill
 
Hi thanks for the reply.

The switch now works in the VC, apart from the right double click doesn't move the switch. However when I toggle the swtich the Chinookramp doesnt move. Its in a different position to start with from what is configured in the key frames for it. Hopefully that makes sense.

Lionheart, thanks for the idea - however it is one door that has 2 positions. Half open and fully open, as well as shut obviously.

Thanks again

Rich
 
Change the callback code to get rid of the 'RightDouble' entirely:
Code:
<CallbackCode>
     (M:Event) 'LeftSingle' scmp 0 == 
          if{ 
               (L:Chinookramp,enum) 1 == if{ 0 (>L:Chinookramp, enum) }
               (L:Chinookramp,enum) 0 == if{ -1 (>L:Chinookramp, enum) }
            }
     (M:Event) 'RightSingle' scmp 0 == 
          if{ 
               (L:Chinookramp,enum) -1 == if{ 0 (>L:Chinookramp, enum) }
               (L:Chinookramp,enum)  0 == if{ 1 (>L:Chinookramp, enum) }
            }
</CallbackCode>
With the above, right-clicking once should set the door to 1/2 way, right-clicking again will open the door all the way.

Left-clicking will close the door from either full or half-open, depending on where the door currently is... :D
 
Right, sorted the link to the ramp out. Moving the switch moves the ramp now, hand a capital letter in one line and not in the other. However the double right click still isnt working. Am I coding it corretly in that the door is half way open to start with, leftclick opens it all the way, rightclick back to half way and then doubleright should be closed?

Really appreciate the help guys.

Rich

Sorry just seen you new post! Will try that thanks!
 
Last edited:
Getting closer, but now the ramp goes from fully open to fully closed and vice versa with both clicks. Its missing out the '0' position.

Rich
 
Hmmm... we need another flag variable then. I'll have to sleep on this and see what I dream up. Right now, my mind is mush! :eek:
 
Bill - isn't this a glorified Off-Left-Right-Off Fuel Selector.

Oddly enough, that's what occured to me sometime during the night...

...that's what happens whenever I get fixated on some idea. Why do I keep trying to reinvent the wheel? :D

Rich, the following WILL WORK, I guarantee it!

Code:
<MouseFlags>LeftSingle+RightSingle</MouseFlags> 
<CallbackCode> 
	(M:Event) 'RightSingle' scmp 0 ==  
		if{ (L:Chinookramp,enum) -- -1 max (>L:Chinookramp,enum) }
	(M:Event) 'LeftSingle' scmp 0 ==  
		if{ (L:Chinookramp,enum) ++ 1 min (>L:Chinookramp,enum) }
</CallbackCode>

Note: to swap the mouse button's actions, simply swap the 'RightSingle' and 'LeftSingle' tags...
 
Last edited:
Hey, that's why you need me - to oddly remind you of what you forgot!



Oddly enough, that's what occured to me sometime during the night...

...that's what happens whenever I get fixated on some idea. Why do I keep trying to reinvent the wheel? :D
Because if it ain't broke, you keep trying to fix it until it does?
 
Genius!!

Thanks guys works an absoulte treat!:D:D

I may be back for more:eek:, but starting to get my head around the coding alot better now!

Thanks again!

Rich
 
Me again!

Another little problem. The door in question is split into 2, an upper and lower section. Like a stable door. At '0' keyframes both are shut, at '0' to '50' the upper door slides inside the lower door and both move to half way open. At '100' the lower door has fully opened with the upper door still inside it. Hope it's making sense so far. I have called the upper part ChinookRamp.1 as the lower is ChinookRamp. I have paereted the upper to the lower part and parented the lower to a fixed part. The problem is when I have compiled it the upper door sits and 20feet back from where it appears in FSDS, but animates correctly just too far back! Screenie below!

Any ideas?

pic110l.jpg
 
Me again!

Another little problem. The door in question is split into 2, an upper and lower section. Like a stable door. At '0' keyframes both are shut, at '0' to '50' the upper door slides inside the lower door and both move to half way open. At '100' the lower door has fully opened with the upper door still inside it. Hope it's making sense so far. I have called the upper part ChinookRamp.1 as the lower is ChinookRamp. I have paereted the upper to the lower part and parented the lower to a fixed part. The problem is when I have compiled it the upper door sits and 20feet back from where it appears in FSDS, but animates correctly just too far back! Screenie below!

Any ideas?

PArt hierarchy/ animated reference part.

ChinookRamp.1 should be the child of ChinookRamp.1ref (not animtated, just a really tiny box co-located with ChinookRamp.1 so that it's not visible. I like to make it a box dims .1 .. you can tag it as a hierarchy part, (NOT REFERENCE).

Then set ChinookRAmp.1ref to be child of ChinookRamp






I think.
 
Ah thats got it! Think I must have tried every other combination but that one, and forgot to tag it as hierarchy!! Head wasn't working quite right!

Thanks again!:D
 
Hi Guys,

Sorry to bring this back up again, but as I always do I need to tweak it slightly!! :p

Is it possible to adapt this code to make it into a 3 stage door? ie and an extra animation stop?

Cheers

Rich
 
Back
Top