Jump to content

PaintKit and Carburetor Heat Lever - Oil Flaps - Engine Cowl Flaps


phrosperatus

Recommended Posts

Dear developers and community!
 
I love this classic airplane so much. It's a joy to fly. I wish i could use some functions of the plane on my controllers.
 
So I managed to bind Cowl Flaps Open/Close (Inc/Dec Cowl Flaps) via FSUIPC.
Please help me bind Oil Flaps Control and Carburator Heat Lever To Joystick Buttons or Axis.
 
I bought Aerosoft Antonov AN-2 from Just Flight and i can't figure out where is the paintkit and the livery installers (i managed to download some liveries from http://forum.aerosoft.com/index.php?/files/category/117-antonov-an-2-liveries/)
 
I'm using the Aerosoft Antonov AN-2 in Prepar3D v4.2.
 
Thanks in advance.
Happy Simming!
Link to comment
Share on other sites

I found out the paintkit is available at just flight support website.

Now only the Oil Flaps Control and Carburator Heat Lever To Joystick Buttons or Axis thing left.

If anyone know how to do these please let me know.

Thanks in advance.

Link to comment
Share on other sites

I managed to do the cowl flaps with sounds and the oil cooler flaps with Lua scripting, using Linda and registered FSUIPC. I'm using the latest fsuipc in p3dv4.2

This is the first time i have ever done something like this, so sorry if it's too basic or just simply bad, but it works for me at the moment.

These are the scripts i managed to do which work for me. The method is the same at every button.

 

Use these lua scripts and copy them to your simulator\modules folder so you'll be able to use them and bind them to a key or button in fsuipc.

In theory you must restart your simulator after copying these files in order for FSUIPC to recognize them.

So for example bind "Lua CowlFlapsOpen" to Joystick button 1 and put "Lua CowlFlapsNeutral" on "control sent when button released" in fsuipc. This way while you are holding down the button, you'll keep opening the cowl flaps and you gona stop opening the cowl flaps on the Joystick button 1 release.

If you wish to open / close the Cowl Flaps fast then assign a button or key via fsuipc to the "Inc Cowl Flaps" / "Dec Cowl Flaps" commands.

Make a new text document by right clicking on the desktop or in a folder, so right click -> new -> text document and name them for example CowlFlapsOpen.lua and as i mentioned earlier copy these files into your simulator\modules.

My macros:

 

------------------------------------------------------------------

 

CowlFlapsOpen.lua

ipc.writeLvar("L:an2CowlShutSwMouseY", 700)

ipc.writeLvar("L:an2CowlShutSwPressed", 1)

ipc.writeLvar("L:an2CowlShutSw", 0)

 

ipc.writeLvar("L:an2CowlShutSwMouseY", 500)

ipc.writeLvar("L:an2CowlShutSwPressed", 1)

ipc.writeLvar("L:an2CowlShutSw", 1)

 

------------------------------------------------------------------

 

CowlFlapsClose.lua

ipc.writeLvar("L:an2CowlShutSwMouseY", 500)

ipc.writeLvar("L:an2CowlShutSwPressed", 1)

ipc.writeLvar("L:an2CowlShutSw", 1)

 

ipc.writeLvar("L:an2CowlShutSwMouseY", 700)

ipc.writeLvar("L:an2CowlShutSwPressed", 1)

ipc.writeLvar("L:an2CowlShutSw", 0)

 

------------------------------------------------------------------

 

CowlFlapsNeutral.lua

ipc.writeLvar("L:an2CowlShutSw", 0.5)

ipc.writeLvar("L:an2CowlShutSwPressed", 0)

 

------------------------------------------------------------------

 

OilCoolerOpen.lua

ipc.writeLvar("L:an2OilRadShutSwMouseY", 700)

ipc.writeLvar("L:an2OilRadShutSwMouseX", 700)

ipc.writeLvar("L:an2OilRadShutSwPressed", 1)

ipc.writeLvar("L:an2OilRadShutSw", 0)


 

ipc.writeLvar("L:an2OilRadShutSwMouseY", 500)

ipc.writeLvar("L:an2OilRadShutSwMouseX", 500)

ipc.writeLvar("L:an2OilRadShutSwPressed", 1)

ipc.writeLvar("L:an2OilRadShutSw", 1)

 

------------------------------------------------------------------

 

OilCoolerClose.lua

ipc.writeLvar("L:an2OilRadShutSwMouseY", 500)

ipc.writeLvar("L:an2OilRadShutSwMouseX", 500)
ipc.writeLvar("L:an2OilRadShutSwPressed", 1)
ipc.writeLvar("L:an2OilRadShutSw", 1)
 
ipc.writeLvar("L:an2OilRadShutSwMouseY", 700)
ipc.writeLvar("L:an2OilRadShutSwMouseX", 700)
ipc.writeLvar("L:an2OilRadShutSwPressed", 1)
ipc.writeLvar("L:an2OilRadShutSw", 0)
 

------------------------------------------------------------------

 

OilCoolerNeutral.lua

ipc.writeLvar("L:an2OilRadShutSw", 0.5)
ipc.writeLvar("L:an2OilRadShutSwPressed", 0)

 

Link to comment
Share on other sites

I played more with linda and Linda Tracer and i made lua scripts to turn switches on and off. I'm not sure if it's 100% good and working, it seemed to me it did.

Same stuff, make a text document, name it to whatever.lua u wish for example SwitchesAllOn.lua and copy that to your simulator\modules folder and bind it to a key or button.

 

SwitchesAllOn.lua

 

ipc.writeLvar("L:an2AzsTopFlaps", 1)
ipc.writeLvar("L:an2AzsControlFlaps", 1)
ipc.writeLvar("L:an2AzsBottomFlaps", 1)
ipc.writeLvar("L:an2AzsAileronTrim", 1)
ipc.writeLvar("L:an2TrimAileronLamp", 1)
ipc.writeLvar("L:an2AzsElevatorTrim", 1)
ipc.writeLvar("L:an2TrimElevLamp", 1)
ipc.writeLvar("L:an2TrimRudderLamp", 1)
ipc.writeLvar("L:an2AzsRudderTrim", 1)
ipc.writeLvar("L:an2AzsOilRadShut", 1)
ipc.writeLvar("L:an2AzsCowlShut", 1)
ipc.writeLvar("L:an2PyroLamp", 1)
ipc.writeLvar("L:an2AzsFireEquipment", 1)
ipc.writeLvar("L:an2AzsHornDoor", 1)
ipc.writeLvar("L:an2AzsKlsrkUfo", 1)
ipc.writeLvar("L:an2AzsLightFuz1", 1)
ipc.writeLvar("L:an2CockpitLightVis", 1)
ipc.writeLvar("L:an2AzsLightFuz2", 1)
ipc.writeLvar("L:an2CabinLampVis", 1)
ipc.writeLvar("L:an2AzsKlsrkUfoLeftBoard", 1)
ipc.writeLvar("L:an2AzsWalkSocket", 1)
ipc.writeLvar("L:an2AzsFloorLight", 1)
ipc.writeLvar("L:an2AzsUkv", 1)
ipc.writeLvar("L:an2AzsSpu", 1)
ipc.writeLvar("L:an2AzsKv", 1)
ipc.writeLvar("L:an2AzsRv", 1)
ipc.writeLvar("L:an2AzsArk", 1)
ipc.writeLvar("L:an2AzsSro", 1)
ipc.writeLvar("L:an2AzsMrp", 1)
ipc.writeLvar("L:an2AltSwitch", 1)
ipc.writeLvar("L:an2AltLamp", 0)
ipc.writeLvar("L:an2Hsi1Att47b", 1)
ipc.writeLvar("L:an2Att47bHsi48", 1)
ipc.writeLvar("L:an2BenzinSw", 1)
ipc.writeLvar("L:an2Emi3kSw", 1)
ipc.writeLvar("L:an2FlapsIndSw", 1)
ipc.writeLvar("L:an2CarbTempSw", 1)
ipc.writeLvar("L:an2AzsNavLights", 1)
ipc.writeLvar("L:an2NavLightVis", 1)
ipc.writeLvar("L:an2AzsLightBottom", 1)
ipc.writeLvar("L:an2AGKArrPressed", 1)
ipc.writeLvar("L:an2AGKArr", 1)
ipc.writeLvar("L:an2AGKArrPressed", 0)
ipc.writeLvar("L:an2FuelSelector", 2)
ipc.writeLvar("L:an2FuelHorn", 1)

 

 

Link to comment
Share on other sites

  • 4 weeks later...

 

Hi phrosperatusyou can try to talk with guenseli for more detailes.

 

And this is a most interesting part of our conversation, I hope this helps:

 

 

This is an example of the trimmer switch callback:

<Animation name="an2AileronTrimControl" guid="5F6FA2C0-4EF4-4518-B463-000000000164" length="100" type="Sim" typeParam2="an2AileronTrimControl" typeParam="AutoPlay" />
<PartInfo>
  <Name>an2AileronTrimControl</Name>
  <AnimLength>100</AnimLength>
  <Animation>
    <Parameter>
    <Code> (L:an2AileronTrimControl) 100 * </Code>
    <Lag>1200</Lag>
    </Parameter>
  </Animation>
  <MouseRect>
    <Cursor>hand</Cursor>
    <TooltipText>Aileron Trim Control</TooltipText>
    <MouseFlags>LeftSingle+LeftDrag+LeftRelease</MouseFlags>
    <CallbackCode>
      (M:Event) 'LeftSingle' scmi 0 == if{ (M:X) (>L:an2AileronTrimControlMouseX, number) (M:Y) (>L:an2AileronTrimControlMouseY, number) 1 (>L:an2AileronTrimControlPressed, number) }
      (M:Event) 'LeftRelease' scmi 0 == if{ 0 (>L:an2AileronTrimControlPressed,  number) }
      (M:Event) 'LeftDrag' scmi 0 == if{ (M:X) (>L:an2AileronTrimControlMouseX, number) (M:Y) (>L:an2AileronTrimControlMouseY, number) }
    </CallbackCode>
  </MouseRect>
</PartInfo>

 

The key point of my callback system is that I initialize additional L vars in c++ with suffixes for basic L-var (an2AileronTrimControl):
"Pressed" - is the left mouse button state,  1 - pressed, 0 - released
"PressedR" - is for the right mouse button
"MouseX" - counts pixels then the left mouse button is pressed. It is used to create increment/decrement events after each N-pixels step if only the left mouse button is pressed
"MouseY" - behaves like MouseX
"Wheel" - increment/decrement wheel event,
 
So you can directly control L-vars with suffixes "Pressed", "PressedR", "Wheel" to mimic the user mouse events. Because to control "MouseX" and "MouseY" is not a trivial task from the an-2 logic's point of view, special for you I have add additional L-vars with suffixes:
"ClickL" - invokes a sequence of events (pressed/released) of the left mouse button. You just need to set that L-var as 1.0 and forget about it - the an-2 logic will reset it to zero automatically after the callbacks invocation.
"ClickR" - is for the right mouse button
"DirectControl" - directly invokes a special callback in c++ (if defined) for the basic L-var to manage its state. For example, the starter switch - it has three states, so you can set one of values -1 0 1 and the switch will obey. When you have first time set that L-var, the switch will enter the direct control mode, so in case of the starter switch it will not move in the center position if you set it in the end position. But this mode can be reset by the user's mouse button events or by direct invocation of "Pressed" "PressedR". The "Wheel" event does not brake the direct control mode.
 
This is a list with all the an-2 cockpit's custom callbacks:
 
var: 'an2ClutchSwitch' - the starter switch
aux: 'an2ClutchSwitchPressed'
aux: 'an2ClutchSwitchClickL'
aux: 'an2ClutchSwitchMouseX'
aux: 'an2ClutchSwitchDirectControl' - states -1 0 1
 
var: 'an2ClHeadL' - clock's left knob
aux: 'an2ClHeadLPressed'
aux: 'an2ClHeadLClickL'
aux: 'an2ClHeadLPressedR'
aux: 'an2ClHeadLClickR'
aux: 'an2ClHeadLWheel'
aux: 'an2ClHeadLDirectControl'
 
var: 'an2ClHeadR'- clock's right knob
aux: 'an2ClHeadRPressed'
aux: 'an2ClHeadRClickL'
aux: 'an2ClHeadRWheel'
aux: 'an2ClHeadRDirectControl'
 
var: 'an2GComp'  - gyro heading's knob
aux: 'an2GCompPressed'
aux: 'an2GCompClickL'
aux: 'an2GCompPressedR'
aux: 'an2GCompClickR'
aux: 'an2GCompWheel'
aux: 'an2GCompDirectControl'
 
var: 'an2AGKArr' - attitude indicator AGK-47B
aux: 'an2AGKArrPressed'
aux: 'an2AGKArrClickL'
aux: 'an2AGKArrPressedR'
aux: 'an2AGKArrClickR'
aux: 'an2AGKArrDirectControl'
 
var: 'an2AGKArrR' - attitude indicator AGK-47B
aux: 'an2AGKArrRPressed'
aux: 'an2AGKArrRClickL'
aux: 'an2AGKArrRPressedR'
aux: 'an2AGKArrRClickR'
aux: 'an2AGKArrRDirectControl'
 
var: 'an2UGRBtn'
aux: 'an2UGRBtnPressed'
aux: 'an2UGRBtnClickL'
aux: 'an2UGRBtnDirectControl'
 
var: 'an2UKBtn'
aux: 'an2UKBtnPressed'
aux: 'an2UKBtnClickL'
aux: 'an2UKBtnDirectControl'
 
var: 'an2PrimerPump' - the syringe (hand pump) on the left panel
aux: 'an2PrimerPumpPressed'
aux: 'an2PrimerPumpClickL'
aux: 'an2PrimerPumpMouseY'
aux: 'an2PrimerPumpWheel'
aux: 'an2PrimerPumpDirectControl' - in range [0-1] - position of the handle
 
var: 'an2ManualPrimer'- the hand pump on the right side of the left pilot seat
aux: 'an2ManualPrimerPressed'
aux: 'an2ManualPrimerClickL'
aux: 'an2ManualPrimerMouseY'
aux: 'an2ManualPrimerDirectControl' - in range [0-1] - position of the handle
 
var: 'an2FuelLampControl'
aux: 'an2FuelLampControlPressed'
aux: 'an2FuelLampControlClickL'
aux: 'an2FuelLampControlMouseX'
aux: 'an2FuelLampControlDirectControl'
 
var: 'an2ClutchTHandle' - the starter T-handle for the SP-ASR cabin (will be in update)
aux: 'an2ClutchTHandlePressed'
aux: 'an2ClutchTHandleClickL'
aux: 'an2ClutchTHandlePressedR'
aux: 'an2ClutchTHandleClickR'
aux: 'an2ClutchTHandleDirectControl' - states -1 0 1
 
var: 'an2ElevatorTrimControl'
aux: 'an2ElevatorTrimControlPressed'
aux: 'an2ElevatorTrimControlClickL'
aux: 'an2ElevatorTrimControlMouseY'
aux: 'an2ElevatorTrimControlDirectControl' - states -1 0 1
 
var: 'an2AileronTrimControl'
aux: 'an2AileronTrimControlPressed'
aux: 'an2AileronTrimControlClickL'
aux: 'an2AileronTrimControlMouseX'
aux: 'an2AileronTrimControlDirectControl' - states -1 0 1
 
var: 'an2RudderTrimControl'
aux: 'an2RudderTrimControlPressed'
aux: 'an2RudderTrimControlClickL'
aux: 'an2RudderTrimControlMouseX'
aux: 'an2RudderTrimControlDirectControl' - states -1 0 1
 
var: 'an2CowlShutSw' - cowl flap switch
aux: 'an2CowlShutSwPressed'
aux: 'an2CowlShutSwClickL'
aux: 'an2CowlShutSwMouseY'
aux: 'an2CowlShutSwDirectControl' - states -1 0 1
 
var: 'an2OilRadShutSw' - oil radiator flap switch
aux: 'an2OilRadShutSwPressed'
aux: 'an2OilRadShutSwClickL'
aux: 'an2OilRadShutSwMouseY'
aux: 'an2OilRadShutSwDirectControl' - states -1 0 1
 
var: 'an2FireCheck1'
aux: 'an2FireCheck1Pressed'
aux: 'an2FireCheck1ClickL'
aux: 'an2FireCheck1MouseX'
aux: 'an2FireCheck1DirectControl'
 
var: 'an2FireCheck2'
aux: 'an2FireCheck2Pressed'
aux: 'an2FireCheck2ClickL'
aux: 'an2FireCheck2MouseX'
aux: 'an2FireCheck2DirectControl'
 
var: 'an2ic210DualBtn'
aux: 'an2ic210DualBtnPressed'
aux: 'an2ic210DualBtnClickL'
aux: 'an2ic210DualBtnDirectControl'
 
var: 'an2ic210EcBtn'
aux: 'an2ic210EcBtnPressed'
aux: 'an2ic210EcBtnClickL'
aux: 'an2ic210EcBtnDirectControl'
 
var: 'an2ic210ChFrqBtn'
aux: 'an2ic210ChFrqBtnPressed'
aux: 'an2ic210ChFrqBtnClickL'
aux: 'an2ic210ChFrqBtnDirectControl'
 
var: 'an2ic210RclBtn'
aux: 'an2ic210RclBtnPressed'
aux: 'an2ic210RclBtnClickL'
aux: 'an2ic210RclBtnDirectControl'
 
var: 'an2ic210MemBtn'
aux: 'an2ic210MemBtnPressed'
aux: 'an2ic210MemBtnClickL'
aux: 'an2ic210MemBtnDirectControl'
 
var: 'an2NarComChFrqBtn'
aux: 'an2NarComChFrqBtnPressed'
aux: 'an2NarComChFrqBtnClickL'
aux: 'an2NarComChFrqBtnDirectControl'
 
var: 'an2NarNavChFrqBtn'
aux: 'an2NarNavChFrqBtnPressed'
aux: 'an2NarNavChFrqBtnClickL'
aux: 'an2NarNavChFrqBtnDirectControl'
 
var: 'an2NarTrdIdentBut'
aux: 'an2NarTrdIdentButPressed'
aux: 'an2NarTrdIdentButClickL'
aux: 'an2NarTrdIdentButDirectControl'
 
 
and this is the special L-vars with guage readings:
an2AlternatorAmperes
an2BatteryAmperesVolts - shows amperes/volts on the main ampere-voltmeter
an2CHT1, an2CHT9  - for 1st and 9th cylinder
an2CarbTemp - carburetor temp
an2OAT - outside air temp - it has the same unlinearity as the carburetor temp gauge

 

Link to comment
Share on other sites

Dear AlexeyM!

 

Hi there!

 

Thank you very much for taking the time to help me out.

I'll try these things out in the near future.

 

Thanks for your amazing aircraft.

 

If it's possible may you give info about the next update for your Antonov AN-2?

 

Thanks for everything again.

Happy Simming!

Link to comment
Share on other sites

The An-2 logic and systems are finished and waiting for testing by Aerosoft, but the update is mostly waiting for our 3d-modeler as he is absent from civilization in the middle of Russia in his main business trip. The models of An-2 have some major updates that we can't just skip and release without them.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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. Privacy Policy & Terms of Use