Jump to content

How to set flap 10% 40% ???


davescl

Recommended Posts

Hello Everyone, I have searched a lot but unfortunately I´ve been unable to find information regarding the method for setting the position of the flaps to a specific degree.
I have mapped the flap control to my hotas so every time I press the allocated flap button it moves in the assigned direction one step at a time. I would like to program a button to go directly to "10% flap" , another to "40% flap"

Perhaps this is not enabled in DCS.

If someone knows the answer I would pretty much appreciate the information.

 

Cheers!

 

Dave


Edited by davescl
Link to comment
Share on other sites

You should be able to do it by editing the lua files.

 

In <DCS>\Mods\aircraft\P-51D\joystick you'll see default.lua, that has all the controls available for hotas. If you wanted to add this to keyboard as well you'd need to edit the \P-51D\keyboard\default.lua.

 

Around line 242 are the flap controls, you'll see:

 

{down = device_commands.Button_2, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Flaps Up'), category = _('Flight Control')},
{down = device_commands.Button_2, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, name = _('Flaps Down'), category = _('Flight Control')},

 

You can see the flaps go from 0 (fully down) to 1 (fully up). Try adding these lines somewhere in there (doesn't technically matter where, but best to add them right below the lines above so the flaps commands are grouped in the lua)

 

{down = device_commands.Button_2, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.9, name = _('Flaps 10%'), category = _('Flight Control')},
{down = device_commands.Button_2, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.6, name = _('Flaps 40%'), category = _('Flight Control')},

 

Edit to add I just realized/remembered that might just be changing the amount each press trims.

 

If above doesn't work, try this instead, it points to a different command (the flaps axis)

 

{down = device_commands.Button_17, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.9, name = _('Flaps 10%'), category = _('Flight Control')},
{down = device_commands.Button_17, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.6, name = _('Flaps 40%'), category = _('Flight Control')},

 

I'm finishing up some work and then will be able to test it in a bit.


Edited by Monkwolf
Link to comment
Share on other sites

Here ya go, just tested it and this works:

 

{down = device_commands.Button_17, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = -0.8, name = _('Flaps 10%'), category = _('Flight Control')},
{down = device_commands.Button_17, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = -0.2, name = _('Flaps 40%'), category = _('Flight Control')},

 

Did need to address Button_17 command, but then the axis range is -1 (full up) to 1 (full down), so the value_down in my first post was way off.

Link to comment
Share on other sites

Voice Attack can be useful for this sort of thing.

 

I have the HOTAS flap lever for incremental flap movements, but if I want to go directly to any particular setting I use a voice command.

I had 'Betty' remind me of the limiting speeds when I was learning to operate the P-51, and this can be removed if no longer required.

 

Here is the Voice attack command structure for anyone interested.

====================================

When I say:

Flaps [UP; ZERO; 10; 20; 30; 40; 50; DOWN ]

 

Variables used:  Actual position, Selected Position
====================================
Start by checking if flap position value has been initialized
Begin Integer Compare : [Actual Position] Has Not Been Set
    Start Loop : Repeat 5 Times

        Press Left Shift+F keys and hold for 0.1 seconds and release
    End Loop
    Flap lever must be at zero now
    Set integer [Actual Position] value to 0
    Say, 'Actual Position value is initialized to zero'  (and wait until it completes)
End Condition
====================================
Now get the Selected (desired) position
Begin Condition : [{CMDSEGMENT:1}] Equals 'UP' OR [{CMDSEGMENT:1}] Equals 'ZERO'
    Set integer [Selected Position] value to 0
End Condition
Begin Text Compare : [{CMDSEGMENT:1}] Equals '10'
    Set integer [Selected Position] value to 1
    Say, 'Limit 400'  (and wait until it completes)
End Condition
Begin Text Compare : [{CMDSEGMENT:1}] Equals '20'
    Set integer [Selected Position] value to 2
    Say, 'Limit 275'  (and wait until it completes)
End Condition
Begin Text Compare : [{CMDSEGMENT:1}] Equals '30'
    Set integer [Selected Position] value to 3
    Say, 'Limit 225'  (and wait until it completes)
End Condition
Begin Text Compare : [{CMDSEGMENT:1}] Equals '40'
    Set integer [Selected Position] value to 4
    Say, 'Limit 180'  (and wait until it completes)
End Condition
Begin Condition : [{CMDSEGMENT:1}] Equals '50' OR [{CMDSEGMENT:1}] Equals 'DOWN'
    Set integer [Selected Position] value to 5
    Say, 'Limit 165'  (and wait until it completes)
End Condition
====================================
Now calculate how many steps in what direction are required
Set integer [Move] value to the value of [Selected Position]
Set integer [Move] to [Move] minus [Actual Position]
Now send the commands
Begin Integer Compare : [Move] Is Greater Than 0
    Start Loop While : [Move] Is Greater Than 0
        Select down
        Press F key and hold for 0.1 seconds and release
        Set integer [Move] to [Move] minus 1
    End Loop
Else If Integer Compare : [Move] Is Less Than 0
    Select up if negative
    Start Loop While : [Move] Is Less Than 0
        Press Left Shift+F keys and hold for 0.1 seconds and release
        Set integer [Move] to [Move] plus 1
    End Loop
End Condition
Set integer [Actual Position] value to the value of [Selected Position]
Write [Blue] 'Selected {INT:Selected Position}  Actual {INT:Actual Position}' to log
Say, 'Flaps {CMDSEGMENT:1} selected'

=========== END ========================

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...