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

FSXA Ambient help

Messages
1,749
Country
unitedstates
I recently made an electric fan in my VC. I tried to use all the ambient
codes, but the fan turns too slow. Can we speed this up more?
The Ambient code is just a GUID, no actual xml code.

DG:confused:
 
Code:
<PartInfo>

  <Name>Fan_Anim</Name>

    <AnimLength>100</AnimLength>

      <Animation>

        <Parameter>

         <Code>

        (A:ELECTRICAL MASTER BATTERY,bool) 0 !=

	      if{ (L:FAN POS,number) 1 + 100 % d (&gt;L:FAN POS,number) }

	      els{ (L:FAN POS,number) }	      

	      </Code>

	  </Parameter>

  </Animation>  

</PartInfo>

The "1" is a placeholder and sets the fan speed. Increase or decrease at will.
 
Thanks Heretic,

i figured it was controlled by the bias. But i was not sure what makes continues animation. Does this part of the bias make it cycle........100 % d

DG:D
 
Last edited:
Thanks Heretic,

i figured it was controlled by the bias. But i was not sure what makes continues animation. Does this part of the bias make it cycle........100 % d

DG:D

That's not bias. Bias is used only to scale-offset the end result to match keyframes to negative values. That's not applicable in this case.

Code:
(L:FAN POS,number) 1 + 100 % d (&gt;L:FAN POS,number)

The script above will increment the L:var by 1 on each gauge cycle. The result is run against a modulo ("%") of 100, which means when the L:var reaches 101, the modulo 100 will return 0 which is duplicated ("d") to the stack, then sent to (">") the L:var with the new value.

In short, the L:var will continuously count from 0 to 100, then from 0 to 100 over and over and over, ad infinitum.
 
Bill, on such a unit, how would you shut it off? I guess a Logic string could do this? But if it reads zero and restarts, I would think it would loop again, requiring a visible to control it, stationary fan when off, running fan when on.
 
Bill, on such a unit, how would you shut it off? I guess a Logic string could do this? But if it reads zero and restarts, I would think it would loop again, requiring a visible to control it, stationary fan when off, running fan when on.

As already mentioned, the current script will stop when the battery switch is off.

To add a switch, simply add the appropriate condition to the script!

Code:
        (A:ELECTRICAL MASTER BATTERY,bool) 0 !=
        (L:FanSwitch,bool) 1 ==
        and
	      if{
 
Last edited:
I controlled the power switch with no vis tags.

Code:
  <PartInfo>
    <Name>fan</Name>
	<AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code> (L:FAN POS,number) 0 != (A:ELECTRICAL MASTER BATTERY,bool) 0 != &amp;&amp;
		if{ (L:FAN POS,number) 25 + 100 % d (&gt;L:FAN POS,number) } 
		els{ (L:FAN POS,number) }
	</Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Fan</TooltipText>
      <MouseFlags>LeftSingle+MiddleSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
      <CallbackCode>
	(L:FAN POS,number) ! (>L:FAN POS,number)
       1 (&gt;L:XMLSND28,enum)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

I wish i could understand these codes like you Bill. So d means duplicated.

DG;)
 
i don't mind reading the SDK.

But i find 2 problems with the SDK over asking someone.

I can never get back to the same place very quickly.

And they don't give enough detailed info. Mostly small samples.

i could easily reproduce this code all day long, But i am not sure if the
d is what makes cycle.

but the sdk is still very important.....Thanks for the help everyone.;)
 
Back
Top