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

Mousedrag Dimension

Messages
947
Country
indonesia
How to define a dimension of mousedrag movement?
I have engine starter lever with this code :
Code:
(M:Event) 'LeftSingle'  scmi 0 == if{ (M:X) (>L:ClickStart) }
(M:Event) 'LeftDrag'    scmi 0 == if{ (M:X) (L:ClickStart) - 0 <
if{ (L:Eng1_Ctrl, number) -- 0 max (>L:Eng1_Ctrl, number) }
els{ (L:Eng1_Ctrl, number) ++ 3 min (>L:Eng1_Ctrl, number) }

but to make a drag mouse I just need a small portion movement from my mouse. I want dragging the mouse have similar with animation range.
 
No time to explain, but here's what I use for (controlled) dragging:
Code:
(M:Event) 'LeftSingle' scmp 0 ==
if{ (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }

(M:Event) 'LeftRelease' scmp 0 ==
if{ (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }

(M:Event) 'LeftDrag' scmp 0 ==
if{ (M:Y) (L:MOUSEPOSY,number) - 3 + 0 <
(M:X) (L:MOUSEPOSX,number) - 3 + 0 < or
if{ (L:DC3 Prop Lever R, number) (M:Y) (L:MOUSEPOSY,number) - (M:X) (L:MOUSEPOSX,number) - + abs 0.25 * + 100 min (>L:DC3 Prop Lever R, number) (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }

(M:Y) (L:MOUSEPOSY,number) - 3 - 0 >
(M:X) (L:MOUSEPOSX,number) - 3 - 0 > or
if{ (L:DC3 Prop Lever R, number) (M:Y) (L:MOUSEPOSY,number) - (M:X) (L:MOUSEPOSX,number) - + abs 0.25 * - 0 max (>L:DC3 Prop Lever R, number) (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) } }

I think the "0.25 *" controls the drag sensitivity.
 
Thanks @Heretic, it seem not working, as my scripts only use 4 value ( 0,1,2,3), unlike yours 100 value. if I change value ++ 3 min to ++ 100 min, I got wider sensitivity.
 
Try a lower multiplier like 0.001 and round the result to the nearest integer.

Code:
... - + abs 0.001 * + near 3 min ...
 
still not working, event though using "near", result getting worse. mouse wheel became not at correct value and need to add some mouse drag movement to get correct value.think it better if use mouse drag and get wider sensitivity by using bigger value. i.e. use 0-100 instead 0-5.
 
Back
Top