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

additional cowl flaps?

Partial success. Here are the new codes slave first:

Code:
<part>
	<name>oil_flap_slave</name>
      <animation>
	<parameter>
	  <code>(L:oil_flap_slave,enum)</code>
 	  <lag>100</lag>
	</parameter>
      </animation>
   <mouserect>
   <callback_code>
     (L:oil_flap_slave,enum) ! (>L:oil_flap_slave,enum)
   </callback_code>
   </mouserect>
</part>

Now the vc controller:
Code:
<part>
	<name>oil_switch_spring</name>
	<animlength>100</animlength>
	<animation>
	   <parameter>
	   <code>50 (L:oil_switch_spring,enum) 50 * +</code>
		<Lag>100</Lag>
	   </parameter>
	</animation>
<mouserect>
	   <cursor>Hand</cursor>
	   <tooltip_text>Left_Click-open/Right_Click-close</tooltip_text>
	   <mouse_flags>LeftSingle+Leftrelease+RightSingle+RightRelease</mouse_flags>
			<callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ 1 (>L:oil_switch_spring,enum) }
			(M:Event) 'LeftSingle' scmp 0 ==
                                                                          if{ (L:oil_flap_slave,enum) ++ 5 max (>L:oil_flap_slave,enum) }
			(M:Event) 'LeftRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ (L:oil_switch_spring,enum) -- 0 min (>L:oil_flap_slave,enum) }
			(M:Event) 'RightRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
	   </callback_code>
    </mouserect>
</part>

When left clicked at the vc controller the slave part moves what looks like the first 5 frames. Then with additional VC controller clicks the slave moves what looks like about 1 or 2 frames at a time untill it reaches full open. It takes over 60 clicks to open fully.

Right click of the vc controller does not respond decrementaly, but fully returns slave to closed position at a single click from any open position. Any advice on how to proceed will be welcomed.

Carl
 
Why not just tag both part with the "oil_switch_spring" animation?

How many keyframes do you use with the "oil_flap_slave"?

A code from FSX adjusted a bit.
Don't know if the syntax is correct for FS2004, but it looks good.

Code:
<part>
	<name>oil_flap_slave</name>
      <animation>
        <animlength>300</animlength>
	<parameter>
	  <code>(L:oil_flap_slave,enum) 20 *</code>
 	  <lag>100</lag>
	</parameter>
      </animation>
   <mouserect>
   <callback_code>
     (L:oil_flap_slave,enum) ! (>L:oil_flap_slave,enum)
   </callback_code>
   </mouserect>
</part>


Code:
       <part>
   <name>oil_switch_spring</name>
    <animlength>300</animlength>
     <animation>
      <parameter>
       <code>	
	   (L:oil_switch_spring, enum) 20 *
        </code>
         <lag>300</lag>
        </parameter>
       </animation>
	<mouseRect>
	 <cursor>Hand</Cursor>
	   <mouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
	    <callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) -- 0 max  (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) ++ 15 min (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum }
					(M:Event) 'WheelDown' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) -- 0 max (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
			(M:Event) 'WheelUp' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) ++ 15 min (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
		</callback_code>
	</mouseRect>
   </part>
 
Last edited:
I don't know if it will help or not, but you might not be able to have two LeftSingle and RightSingle events.

Change them to :

Code:
	          (M:Event) 'LeftSingle' scmp 0 ==
                                if{ 1 (>L:oil_switch_spring,enum) (L:oil_flap_slave,enum) ++ 5 max (>L:oil_flap_slave,enum) }

			  (M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) (L:oil_switch_spring,enum) -- 0 min (>L:oil_flap_slave,enum) }

I didn't change them above, but I believe the max and min are in the wrong lines. In FS gauge code they work the reverse of the way you think they should (should be 5 min and 0 max), if I remember correctly. Others can chime in on that, though.

Hope this helps,
 
Zeiten

The cooling flaps and their controls were hydrolic in the Corsair. Nigel's spring switch that I am using for the VC controller gives a good reproduction of the Corsair's cooling flap control levers function so I must maintain its animation for historical accuracy in the VC.

Originally I had the VC controller and the slave animated with a simple dragable code. It gave a good smooth movement to the slave part and stopped in place when you let go the drag but the VC controller did not have the historical accurate animation. The smoothness of the drag able code applied to the slave part would have been perfect.

I could not get the VC controller part to control the dragable. No way to drag the slave as the controller code just left and right clicks. In the perfect historically accurate system The slave, coded for dragable would play it's keyframes when the VC controller was left clicked and held but stop in place along it's frames if the left click were released. The same in reverse for right click. Such a controller/slave code may be possible I do not know. The incremental/decremental slave will work almost as well and I think I am on the right track to getting that to work. I will try your code and Tom's code and probably many variations of each. Both slave and controller are framed at 100 keyframes.

Code:
(M:Event) 'RightSingle' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) ++ 15 min (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum }
					(M:Event) 'WheelDown' scmp 0 ==

In the above M:event does the ++15 controll the number of frames played?
What does the &gt; expression do?
Is there a significance in the space between the , and enum in the (&gt;L:oil_switch_spring, enum) statement and the lack of a space in the (&gt;L:oil_flap_slave,enum } statement?
And what does the (M:Event) 'WheelDown' scmp 0 == statement do?


Here is a short wipvid of the VC controller, oil flap and oil flap indicator as they work now:

www.pendercrafts.com/Carls folder/New folder/flap.avi


Tom

Thanks for the tip on the min and max I had to move the ++5 and --0 statement around to get the VC controller to animate in the right directions. The min and max out of place might be the answer, trial and error will tell I will post results here as I get them.

Carl
 
Last edited:
In the above M:event does the ++15 controll the number of frames played?
What does the &gt; expression do?
Is there a significance in the space between the , and enum in the (&gt;Lil_switch_spring, enum) statement and the lack of a space in the (&gt;Lil_flap_slave,enum } statement?
And what does the (M:Event) 'WheelDown' scmp 0 == statement do?

The ++15 means that the animation will be in 15 increaments.
In the example I gave you I used 300 keyframes.

Code:
    <animlength>300</animlength>
     <animation>
      <parameter>
       <code>	
	   (L:oil_switch_spring, enum) 20 *
        </code>

The 20* means 20 KF increments.

Animationlenght:300
Animation increments:20
300/20=15.

You see the math?

Lets say you want the same except you just want 100 keyframes and the movement will be in 3 increments.
Animationlenght:100
Animation increments:33.33333
100/33.33333=3.000000003..

Well, thats tricky so lets use 90 kf instead.......no need to make things more difficult.

Animationlenght:90
Animation increments:30
90/30=3

So the code for the last one would be:

Code:
    <animlength>90</animlength>
     <animation>
      <parameter>
       <code>	
	   (L:oil_switch_spring, enum) 30 *
        </code>


Code:
(M:Event) 'LeftSingle' scmp 0 ==
                                if{ 1 (>L:oil_switch_spring,enum) (L:oil_flap_slave,enum) ++ 3 max (>L:oil_flap_slave,enum) }

			  (M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) (L:oil_switch_spring,enum) -- 0 min (>L:oil_flap_slave,enum) }

In regards of the spaces in the 2 different code it has nothing to say.

Code:
(L:I dont like spaces,bool)
(L:I like spaces, bool)
They will work flawless regardless of space or not space.

One thing that will not work is
Code:
(L:I dont like spaces,bool) ! (>L:I dont like spaces, bool)

You see the ">" sign?
> = &gt;.

Code:
(>L:I dont like spaces, bool)

(&gt;L:I dont like spaces, bool)

Will do just the same:)

&gt; = is greater then
&lt; = is less then



And what does the (M:Event) 'WheelDown' scmp 0 == statement do?

What it does is checking what code to be activated when the mouse wheel down is used.

Code:
 	   <mouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
	    <callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) -- 0 max  (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) ++ 15 min (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum }
					(M:Event) 'WheelDown' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) -- 0 max (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
			(M:Event) 'WheelUp' scmp 0 ==
				if{ (L:oil_switch_spring, enum) (L:oil_flap_slave,enum) ++ 15 min (&gt;L:oil_switch_spring, enum) (&gt;L:oil_flap_slave,enum) }
		</callback_code>
	</mouseRect>
   </part>

"LeftSingle" and "Wheeldown" does one thing and
"RightSingle and "WheelUp" does another thing.
 
Zeiten

Some progress, as before on first left click slave opens aprx 25kf then moves in small 1-3kf increments to end of 100 key frames. Now at the first right click if the slave is at full extension the slave closes aprx 25kf then moves in small 1-3kf increments to zero key frame. If the slave is at less than full extension right clicks produce the 1-3kf increments to zero key frame. Before this edit the right click returned from what ever position the slave was at to the zero frame. Here is the new code:

Code:
<part>
	<name>oil_switch_spring</name>
	<animlength>100</animlength>
	<animation>
	   <parameter>
	   <code>50 (L:oil_switch_spring,enum) 50 * +</code>
		<Lag>100</Lag>
	   </parameter>
	</animation>
<mouserect>
	   <cursor>Hand</cursor>
	   <tooltip_text>Left_Click-open/Right_Click-close</tooltip_text>
	   <mouse_flags>LeftSingle+Leftrelease+RightSingle+RightRelease</mouse_flags>
			<callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ 1 (>L:oil_switch_spring,enum) }
			(M:Event) 'LeftSingle' scmp 0 ==
                                                                          if{ 1 (L:oil_flap_slave,enum) ++ 25 max (>L:oil_flap_slave,enum) }
			(M:Event) 'LeftRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- 25 min (>L:oil_flap_slave,enum) }
			(M:Event) 'RightRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
	   </callback_code>
    </mouserect>
</part>

And the slave code:
Code:
<part>
	<name>oil_flap_slave</name>
      <animation>
	<parameter>
	  <code>(L:oil_flap_slave,enum)</code>
 	  <lag>100</lag>
	</parameter>
      </animation>
   <mouserect>
   <callback_code>
     (L:oil_flap_slave,enum) ! (>L:oil_flap_slave,enum)
   </callback_code>
   </mouserect>
</part>

I have a couple of ideas that might work to fix the remaining problems. So I will post any progress later.

Carl
 
Code:
50 (L:oil_switch_spring,enum) 50 * +

should be

Code:
50 (L:oil_switch_spring,enum) 2 * +



Code:
(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- 25 min (>L:oil_flap_slave,enum) }

should be
Code:
(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- -25 max (>L:oil_flap_slave,enum) }
 
Last edited:
Zeiten

I tried your code edits, the:

Code:
<code>50 (L:oil_switch_spring,enum) 2 * +</code>

Only effected the VC controller giving it minimum movement. Slaves reacted as before.
The :
Code:
(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- -25 max (>L:oil_flap_slave,enum) }

killed the right click response. Left click played slave as before but I had left the code unchanged as:

Code:
(M:Event) 'LeftSingle' scmp 0 ==
                                                                          if{ 1 (L:oil_flap_slave,enum) ++ 25 max (>L:oil_flap_slave,enum) }

So I changed the ++ 25 max to ++ 25 min in the line.
In the sim the slave moved only 1 frame per Vc controller click, right or left.

Next I tried swapping the min and max staements back the way they started but I left the -25 in the right single entry.
Left click slave returned to as before function right click returned slave to 0 frame at first click.

I returned to the original code at that point. During that edit I noticed the right click was returning to the 25kf location. So I punched in -- 75 min into the right single entry.
In the sim the slave when right clicked from full open position returned to the 75kf location then moved in increments of 1 or 2 kf to the zero frame. I went thru several reedits before coming up with this code :
Code:
<part>
	<name>oil_switch_spring</name>
	<animlength>100</animlength>
	<animation>
	   <parameter>
	   <code>25 (L:oil_switch_spring,enum) 25 * +</code>
		<Lag>100</Lag>
	   </parameter>
	</animation>
<mouserect>
	   <cursor>Hand</cursor>
	   <tooltip_text>Left_Click-open/Right_Click-close</tooltip_text>
	   <mouse_flags>LeftSingle+Leftrelease+RightSingle+RightRelease</mouse_flags>
			<callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ 1 (>L:oil_switch_spring,enum) }
			(M:Event) 'LeftRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
			(M:Event) 'LeftSingle' scmp 0 ==
                                                                          if{ 1 (L:oil_flap_slave,enum) ++ 25 max (>L:oil_flap_slave,enum) }
			(M:Event) 'LeftRelease' scmp 0 ==
				if{ 0 (L:oil_flap_slave,enum) ++ 50 max (>L:oil_flap_slave,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- 75 min (>L:oil_flap_slave,enum) }
			(M:Event) 'RightRelease' scmp 0 ==
				if{ 0 (L:oil_flap_slave,enum) -- 50 min (>L:oil_flap_slave,enum) }
	   </callback_code>
    </mouserect>
</part>

In the sim the LeftSingle moves the slave to the 25 kf., LeftRelease moves the slave to the 75kf then 25 single frame clicks to full extension. RightSingle from full extension moves the slave to the 75 kf. RightRelease moves the slave to the 25kf then 25 single frame clicks to the 0 kf. here is a wipvid:

http://www.pendercrafts.com/Carls folder/New 2/flapsA.avi

Using the single and release to drive the slave this way tells I need write a left single mouse event that tells the slave to play 0kf to 25kf then play 25fk to 50kf and so fourth. Time for more trial and error, any one know an expression for, then play #kf to #kf?

Carl
 
I finally got the right combination! works great now! Here is the slave code:



Code:
<part>
	<name>oil_flap_slave</name>
      <animation>
	<parameter>
	  <code>(L:oil_flap_slave, enum) 10 *</code>
 	  <lag>50</lag>
	</parameter>
      </animation>
   <mouserect>
	<cursor>Hand</cursor>
   <tooltip_text>Oil Cooler Flap</tooltip_text>
   <callback_code>
     (L:oil_flap_slave, enum) ! (>L:oil_flap_slave, enum)
   </callback_code>
   </mouserect>
</part>

And the VC controller code:
Code:
<part>
	<name>oil_switch_spring</name>
	<animlength>100</animlength>
	<animation>
	   <parameter>
	   <code>25 (L:oil_switch_spring,enum) 25 * +</code>
		<Lag>100</Lag>
	   </parameter>
	</animation>
<mouserect>
	   <cursor>Hand</cursor>
	   <tooltip_text>Left_Click-open/Right_Click-close</tooltip_text>
	   <mouse_flags>LeftSingle+Leftrelease+RightSingle+RightRelease</mouse_flags>
			<callback_code>
			(M:Event) 'LeftSingle' scmp 0 ==
				if{ 1 (>L:oil_switch_spring,enum) }
			(M:Event) 'LeftSingle' scmp 0 ==
                                                                          if{ 1 (L:oil_flap_slave,enum) ++ 10 min (>L:oil_flap_slave,enum) }
			(M:Event) 'LeftRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (>L:oil_switch_spring,enum) }
			(M:Event) 'RightSingle' scmp 0 ==
				if{ -1 (L:oil_flap_slave,enum) -- 0 max (>L:oil_flap_slave,enum) }
			(M:Event) 'RightRelease' scmp 0 ==
				if{ 0 (>L:oil_switch_spring,enum) }
	   </callback_code>
    </mouserect>
</part>

I probably should clean up the LeftSingle and RightSingle double entrys. But by the bikers credo, it works so if it aint broke, don't fix it.

Here is the wipvid of all three cooling flaps, oil cooler, inter cooler, and cowl flaps.

http://www.pendercrafts.com/Carls folder/Fldr01/flapsfini.avi

The cowl flaps are still worked by the cowl flaps inc/dec event ids. To finish the cowl flaps I guess I will need to write a gauge to animate the cowl flaps VC controller when the cowl flap keyboard command is pressed, that will have to wait untill I learn to write gauges. Unless I can figure out a part that will do the job.

I want to thank everyone who has helped by providing code examples and explanations of how the code works. Getting the part working is great, but what you guys have taught me is the real reward. Thank You All!

Carl
 
Last edited:
Back
Top