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

FSX Is it possible to......

Messages
10,163
Country
us-arizona
Can one create an invisible gauge that can read 'percentages of an animation' off of an animated object in FS?

Lets say I have an object that animates 100 key frames. Can I have a sound that starts when the part is at KF 1+?


I tried 'percent' and 1 > but this didnt work.


I have a window animation, which has wind noise when open. But, when you close the window, the sound stops immediately when the window begins its trek to closure, which takes about 1.5 seconds. Makes the animation look goofy.


Is there a way to do this?


This is what I have right now, and doesnt function as like I want it to..

Code:
  <Element>
    <Select>
      <Value>                 
               (A:GENERAL ENG1 RPM, rpm) 20 &gt;
               0 40 (A:VELOCITY BODY Z, knots) rng
                   and 
               if{
                (L:F24 LEFT WINDOW, percent) 1 &gt;
                (L:F24 RIGHT WINDOW, percent) 1 &gt;
                    or
                    if{ 2 (&gt;L:XMLSND192,enum) }
                    els{ 3 (&gt;L:XMLSND192,enum) }
                  }        
       </Value>
    </Select>
   </Element>
 
It is not possible to read percentage of animation within a gauge but instead, measuring the lapse -in seconds- that an animation lasts, it is possible to trigger a sound at any moment within this lapse.

For example, if the animation lasts 1.5 seconds, you can start a timer when it begins:

Code:
<Click>
   1 (>L:SoundAnim,bool) (P:Absolute time, seconds) (>L:Timer,seconds)
</Click>

and then check for a certain period elapsed (ie 1.2 secs) to trigger the sound:

Code:
<Update>
    (L:SoundAnim,bool)
    if{ (P:Absolute time, seconds) (L:Timer,seconds) - 1.2 >
         if{  Make_Sound 0 (>L:SoundAnim,bool) }
       }
</Update>

Also it would be possible to code this logic inside the model itself.

Tom
 
Man, this is becoming more difficult then I thought it would be.

What I need is for the window to start the wind noise as soon as it is cracked open (begins) when it is opened, but when it is 'closing' it needs to be 'still running' until it is closed.

So I would need this to start immediately when something is 1 == and to 'continue on' with a timer 'then stop' when it is 0 ==.


I have so many cool little ideas. So difficult to make them work... sigh...
 
Bill, you would only need to start a "timer" when clicking to CLOSE the window. Delay the sound termination for x seconds (until the window is fully closed).

You are using a 'binary' switch for your window(s), so it will always change immediately from 0 to 1 and back to 0...

You can always tell if a sound is being looped (that is, playing) by checking the status of the L:variable.

(L:XMLSND192,enum) 2 == if{ /*what to do if sound is playing */ }

So:

Code:
(L:F24 LEFT WINDOW, percent) 0 ==                              /*window is closed*/
(L:XMLSND192,enum) 2 == and                                    /*sound is playing*/ and
(P:Absolute time, seconds) (L:Timer,seconds) - 1.2 > and      /*window has had time to close now*/ and
if{ 3 (>L:XMLSND192,enum) }                                   /*so stop the sound!*/
 
Last edited:
Sorry to get back on this so late. I have had many obstacles arise on this. Dwight and I worked with it but couldnt seem to get it to work.

I ended up trying to create wind noise that exists at low volume when the engine is running, zero speed to medium speed range. Then medium noise, range of speed in mid range. Then loud wind noise with med. to max cruise speed.

What we ended up with was 'two' windows, each with their own L:vars, that require the 3 sound levels of noise, to be off when the engine is off, to not turn off the sound if 'one' window of two is closed.

Then........... on top of all of that, to not shut off when the window starts to close, but to turn off when the window has finished closing.

(On top of all of that, the handle which is geared with several cubes to create multiple revolutions will not 'mouserect' in FSX, but is fine in P3D).




So... My question is, how exactly would you write this into the code for the windows? Our ways didnt work.

This is what I have so far.


Code:
  1 100 (L:F24 LEFT WINDOW, percent) rng 1 100 (L:F24 RIGHT WINDOW, percent) rng ||

  if{
    0 40 (A:VELOCITY BODY Z, knots) rng 
      if{ 3 (&gt;L:XMLSND194,enum) 3 (&gt;L:XMLSND193,enum) 2 (&gt;L:XMLSND192,enum) }

    41 90 (A:VELOCITY BODY Z, knots) rng 
      if{ 3 (&gt;L:XMLSND192,enum) 3 (&gt;L:XMLSND194,enum) 2 (&gt;L:XMLSND193,enum) }

    91 200 (A:VELOCITY BODY Z, knots) rng 
      if{ 3 (&gt;L:XMLSND193,enum) 3 (&gt;L:XMLSND192,enum) 2 (&gt;L:XMLSND194,enum) }  
    }

  els{
     (L:XMLSND192,enum) 2 == if{ 3 (&gt;L:XMLSND192,enum) }
     (L:XMLSND193,enum) 2 == if{ 3 (&gt;L:XMLSND193,enum) }
     (L:XMLSND194,enum) 2 == if{ 3 (&gt;L:XMLSND194,enum) }
     }

This is written into a 'update' segment in the invisible gauge.


Is it possible?
 
Bill, I'll have to give that some careful thought. In fact I'll have to run some "experiments" here myself to see what needs to be done to get it working.
 
Back
Top