Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Just getting my legs under me with pilotsdeck / fsuipc. With devmode and hubhop I was able to figure out some basics.

Things fell apart trying to setup my streamdeck+ for the Grand Duke starter however.

I don't really know what I'm looking at here but if anyone could help point me in the right direction I'd really appreciate it. The magneto rotary has 4 positions with (0 off, 4 start) and I am able to set the positions without issue. The problem is that the sim (MSFS 2024) seems to only actually run the starter with a mouse click+drag+hold using the code below. Ultimately I'd like to put that into a pilotsdeck composite action but not sure where to even start. 


(M:Event) 'WheelUp' scmi 0 == if{ 
    (L:BKSQ_IgnitionPosition_1, number) 4 < if{ (L:BKSQ_IgnitionPosition_1, number) 1 + (>L:BKSQ_IgnitionPosition_1, number) } 
    (E:SIMULATION TIME, seconds) (>L:starterKnobReturnTime_L, number) 

els{ 
    (M:Event) 'WheelDown' scmi 0 == if{ 
        (L:BKSQ_IgnitionPosition_1, number) 0 > if{ (L:BKSQ_IgnitionPosition_1, number) 1 - (>L:BKSQ_IgnitionPosition_1, number) } 
    } 
    els{ 
        (M:Event) 'Lock' scmi 0 == if{ 
            (M:RelativeX) (>O:_LastX) 
        } 
        els{ 
            (M:Event) 'Unlock' scmi 0 == if{ 
                0 (>O:_LastX) 
            } 
            els{ 
                (M:Event) 'LeftDrag' scmi 0 == if{ 
                    (M:RelativeX) (O:_LastX) - sp0 
                    0.008 0.07 0.05 3 (M:InputType) case (>O:_InputThreshold) 
                    l0 abs (O:_InputThreshold) > if{ 
                        l0 (O:_InputThreshold) / abs flr sp1 
                        l0 (O:_InputThreshold) % abs sp2 
                        :1 (* for loop *) 
                        l1 0 <= if{ g2 } 
                        l1 -- sp1 
                        l0 0 > if{ 
                            (L:BKSQ_IgnitionPosition_1, number) 4 < if{ (L:BKSQ_IgnitionPosition_1, number) 1 + (>L:BKSQ_IgnitionPosition_1, number) } 
                            (E:SIMULATION TIME, seconds) (>L:starterKnobReturnTime_L, number) 
                        } 
                        els{ 
                            (L:BKSQ_IgnitionPosition_1, number) 0 > if{ (L:BKSQ_IgnitionPosition_1, number) 1 - (>L:BKSQ_IgnitionPosition_1, number) } 
                        } 
                        g1 
                        :2 
                        l0 0 > if{ 
                            (M:RelativeX) l2 - (>O:_LastX) 
                        } 
                        els{ 
                            (M:RelativeX) l2 + (>O:_LastX) 
                        } 
                    } 
                } 
            } 
        } 
    } 

quit 
 

Posted

Presumably you use the lvar BKSQ_IgnitionPosition_1 to move the position of the switch, no? Does this have any actual affect on the starter, besides moving the magneto rotary?

I am not that familiar with such complex gauge calc code, but it looks like you also need to set the starterKnobReturnTime_L lvar when you do this. You can set both lvars using a calculator code preset. The rest of the code is setting O-type (component) variables which I am not familiar with. 

Are any other (standard) events or input events logged (in FSUIPC log / console) when you move the starter in the VC?

If its just a matter of holding the magneto rotary in one position for a certain amount of time before changing the position back, you could do this by writing a macro or lua script. But its probably more complicated than that.

You could try asking the community if its possible to create a preset to replicate that code. The best place for this type of question would be on the MF Discord server, in the MSFS2024 channel.

Sorry but I don't have this aircraft so cannot really look into this in more detail.

John

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.