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

P3D v5 Animation holdoff

Messages
10
Country
ca-ontario
Hi there. There's an animation that needs to wait for another variable to be done before becoming active. I've found ways in the past, but am clearly doing something wrong this time.

In this case, the canopy must be open before a latch can animate. The basic latch anim is this, and works without a problem:

Code:
<Code>(L:door_latch,enum) 33 * +</Code>

I've tried a few things including the following, but each time the latch animation no longer works:

Code:
<Code>(A:EXIT OPEN:1,percent) 1 == if{ (L:door_latch,enum) 1 == } if{ 1 } els{ 0 }</Code>

<Code>(A:EXIT OPEN:1,percent) 1 == if{ (L:door_latch,enum) 33 * +</Code>

Does anyone know the correct format in this instance?

Thanks!
 
(A:EXIT OPEN:1,percent) has a value from 0 to 100

0 means door is closed
100 means door is open
 
Many thanks. I've tried with some variations of the below, with no luck, assuming the '95 less than' might take care of it. Would it be possible to suggest the correct syntax? I'm stumped.

Code:
<Code>(A:EXIT OPEN:1,percent) 95 &lt; == if{ (L:door_latch,enum) 33 * + } els{ 0 } </Code>
 
If you are testing for less than 95, then the latch animation will be 0 any time the canopy is open (i.e. greater than 95). Also, you have an == in there that shouldn't be. Try something like

XML:
<Code>(A:EXIT OPEN:1,percent) 95 &gt; if{ (L:door_latch,enum) 33 * + } els{ 0 } </Code>
 
If you are testing for less than 95, then the latch animation will be 0 any time the canopy is open (i.e. greater than 95). Also, you have an == in there that shouldn't be. Try something like

XML:
<Code>(A:EXIT OPEN:1,percent) 95 &gt; if{ (L:door_latch,enum) 33 * + } els{ 0 } </Code>
Thanks, Tom. Unfortunately, no luck, with that format or any other I could think of. Canopy opens and closes without a problem, but while the latch tooltip shows up, there's no animation there. It's puzzling, because I've done other similar ones before (but most have been bool operations).
 
I think I see another error. What are you trying to do with this code? (L:door_latch,enum) 33 * + Currently this takes the door latch variable, multiplies it by 33 and then adds it to nothing. To add 33 it should be (L:door_latch,enum) 33 + and to multiply by 33 it should be (L:door_latch,enum) 33 *
 
Thanks for having a closer look. The door incremented latch code itself works without a problem, and so am tempted to not mess with it. It's getting it to not to work until the EXIT OPEN:1canopy is open is where it's giving the trouble. I really thought the els{ 0 } etc. would do that.
 
There are multiple errors in your RPN code and it's not easy to work out from buggy RPN what you're actually trying to do (e.g. you don't say what values you set L:door_latch to, and you don't say what you want the 'output' of the code section to be (in terms of the intended animation frame number)

To provide a clue, where you setting L:door_latch, and what values are you setting it to?

What do you what your door latch animation frame number to be for each value of L:door_latch?

When (A:EXIT OPEN:1,percent) goes from 0..100, what do you want to happen to the door latch animation (in terms of frame numbers)?

When (A:EXIT OPEN:1,percent) goes from 100..0, what do you want to happen to the door latch animation (in terms of frame numbers)?[/ICODE]
 
Hi B-21. XML is something I struggle with, to put it mildly. The animation is supposed to work like this:

1. The door latch does not work while the canopy (0-100kf) is closed. Once the canopy is fully open (100kf), then the latch animation can begin to work. The code is supposed to check that the canopy is at 100kf (or 95 or less) before activating.

2. The latch has a series of positions, at the 0-33-66-100kf marks, each reached by a further click.
 
So why are you multiplying or adding 33 to that value? If your click code already assigns the values 0-33-66-100 to the door latch variable then all you should need is

XML:
(A:EXIT OPEN:1,percent) 95 &gt; if{ (L:door_latch,enum) } els{ 0 }

This assumes that the door latch is animated with 100 keyframes.

If instead your click code is assigning 0-1-2-3, then you also need a keyframe at 99, identical to the one at 100. Then use:

XML:
(A:EXIT OPEN:1,percent) 95 &gt; if{ (L:door_latch,enum) 33 * } els{ 0 }
 
Back
Top