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

FS2004 Help with refining code

Messages
1,468
Country
italy
Code:
<Mouse>
<Tooltip>Nose Wheel Tiller</Tooltip>
    <Cursor Type="Hand"/>
<Click Kind="LeftSingle+RightSingle+WheelDown+WheelUp">
(M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.55 + 16384 * (>K:RUDDER_SET) } }
(M:Event) 'WheelDown' scmp 0 == if{ 1 (>K:RUDDER_CENTER) }
(M:Event) 'WheelUp' scmp 0 == if{ 1 (>K:RUDDER_CENTER) }
(M:Event) 'RightSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.55 - 16384 * (>K:RUDDER_SET) } }
    </Click>
</Mouse>

As it stands it works but is very crude. The 0.55 represents the maximum turn rate. Is there a good way I can replace parts of this code to for example for 0.55 to progressively increase from say 0.15 and back from 0.55 to 0.15. So for each mouse press there is an increment from 0.15 to 0.55 and vice versa.
Many thanks.
 
Since this is a mouse click section, it is run only each time the mouse is clicked. So change it to something like:

Code:
(M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.15 + (L:steering_increment, number) + 16384 * (>K:RUDDER_SET)  (L:steering_increment, number) 0.15 + (>L:steering_increment, number) } }

This starts at 0.15 and increments it by 0.15 each click. You can change that, of course. You could add some tests for max and/or min if you need to. The RightSingle line also needs this, in the opposite direction. It would be something like:

Code:
(M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.15 + (L:steering_increment, number) + 0.55 min 16384 * (>K:RUDDER_SET)  (L:steering_increment, number) 0.15 + (>L:steering_increment, number) } }

but I'm not sure of the exact syntax.
 
Since this is a mouse click section, it is run only each time the mouse is clicked. So change it to something like:

Code:
(M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.15 + (L:steering_increment, number) + 16384 * (>K:RUDDER_SET)  (L:steering_increment, number) 0.15 + (>L:steering_increment, number) } }

This starts at 0.15 and increments it by 0.15 each click. You can change that, of course. You could add some tests for max and/or min if you need to. The RightSingle line also needs this, in the opposite direction. It would be something like:

Code:
(M:Event) 'LeftSingle' scmp 0 == if{ (A:GROUND VELOCITY, knots) 40 &lt;
if{ (L:steering,number) 0.15 + (L:steering_increment, number) + 0.55 min 16384 * (>K:RUDDER_SET)  (L:steering_increment, number) 0.15 + (>L:steering_increment, number) } }

but I'm not sure of the exact syntax.

Hi Tom,
If you look here
http://www.fsdeveloper.com/forum/threads/gear-steering.434186/
you'll see the final result which works nicely.
 
Back
Top