Jump to content
The simFlight Network Forums

Recommended Posts

Posted

 

Hi 

I have an aircraft that has switches that I would like to assign to my cockpit but after running the logging console window non of the switches show any command when I move the switch in the 3d cockpit.

I ran list local panel variables and the log files shows up lots of commands.

I have made a macro file and managed to go through  and get several switches working and moving in the 3d cockpit and doing that they should 

One switch however I just can't seem the locate.

Is it possible that while I can move the switch with the mouse in the 3d cockpit, it is not located in list local panel variables with all the other commands.

Cheers 

Rhys 

Posted
On 10/23/2025 at 6:54 AM, Reco said:

Is it possible that while I can move the switch with the mouse in the 3d cockpit, it is not located in list local panel variables with all the other commands.

Listing the lvars does just that - it lists all the local panel variables available. You then have to determine if any are relevant to the switch you are trying to control. You list the lvars two or three times, with the switch in different positions and see if any of the values change.

16 hours ago, Reco said:

Sim is fsx se the  aircraft is the now freeware Milviz Bell uh1 redux.

Ok - and what switch are you looking at? As its freeware, I can install it and take a look, but it will take me a couple of days before I will have time to do this. I am just back after a couple of days away and need to catch-up on a few things first.

John

Posted

Hi John

I can send you the freeware fsx se version Installer I have found on my old PC.

I thought the newer version at Blackbird freebies was an updated version for fsx se but it was only for p3d.

I can add a image of the switch on the panel which I am having trouble with.

Let me know  the best way to send you the file

 

Regards 

Rhys

 

Posted

Hi John

Thanks heaps for your help. with some perseverance I created a new macro and placed all the switch commands into it and eventually found the correct one.

I have also been able to assign switches in another aircraft using the local panel variables that in the  past could not assign

Cheers 

Rhys 

Posted
9 hours ago, Reco said:

Thanks heaps for your help. with some perseverance I created a new macro and placed all the switch commands into it and eventually found the correct one.

Great - well done! Maybe you could attach your macro file for the Milviz Bell uh1 redux as it may be useful for other users (I will also update the title of this thread).

John

  • John Dowson changed the title to Assigning switches using Local panel variables (lvars) for the Milviz Bell uh1 redux (FSX)
Posted

Hi John

Here is the file, but might need your help on 2 things if are able to. 

One switch I just can not seem to find in the variables list 

Plus the collective throttle shows up as  85859  ( L:UH1_THROTTLE = 0.000000) as the throttle is a axis and not a switch I am not sure what to do.

In axis assignments I have mapped my collective throttle to pro pitch1 and when I rotate it, the engine spools up but the collective throttle in the 3d cockpit sits in the idle position

so I have to use the mouse to rotate the collective throttle to  get the N2 needle gauge to get to full for take off 

Pm a email and I can send you the files

Cheers 

Rhys

Bell_UH1C.mcro

Posted
8 hours ago, Reco said:

Plus the collective throttle shows up as  85859  ( L:UH1_THROTTLE = 0.000000) as the throttle is a axis and not a switch I am not sure what to do.

To assign an axis to control an lvar, you need to use lua. You assign your axis to write its value to an offset (using 'Send to FSUIPC offset').
You then need a lua script, which should run automatically via a [Auto.xxx] section in your FSUIPC4.ini (where xxx is your profile name). The lua script monitors the offset to which you have assigned your axis, using event.offset, and in the event handling function you calibrate the axis value (given as a parameter to the handling function) to the lvar value range, and set the lvar using ipc.writeLvar. Try this and let me know if you have issues and I can help further.

John


 

Posted

Hi John

Sorry struggling on this ,adding a Macro is about my limit of knowledge when it comes to programming.

I can transfer the zip file I have for you to look at at your convenience 

Cheers 

Rhys

Posted
9 hours ago, Reco said:

I can transfer the zip file I have for you to look at at your convenience 

You can send it to me, but can you at least try and report back your issues first...

9 hours ago, Reco said:

Sorry struggling on this ,adding a Macro is about my limit of knowledge when it comes to programming.

What issues are you having?
Here are more detailed instructions - please try these and report back any issues, and include/attach your .log and .ini files:

1. Assign your axis using Send to FSUIPC Offset, using Offset Dword Set and offset x66D0

2. Save the attached lua script to your FSUIPC4 installation folder: BellUH1Throttle.lua
    Take a look at that script to see how it works - you may need to change the calibration.

3. Set the script to be auto-ran. To do this, add the following [Auto] section (or update this section if you already have one) to your FSUIPC ini file - note if using profiles you should use [Auto.xxx] (where xxx is you profile name) instead:

[Auto]
1=Lua BellUH1Throttle

Do this when FSX/FSUIPC4 is nor running.

Try that and report back, attaching relevant files if you have issues.

John

Posted

Hi John 

I have included my ini file 

Added the Auto to the ini file and set axis to send to FSUIPC offset and lua file is in my installation folder but no joy 

Cheers so far for your help 

Rhys 

FSUIPC4.ini

Posted

Your ini file shows that the lua script I provided is not in your installation folder, as it does not appear in your [LuaFiles] section (do NOT add this manually!).
Can you please make sure that the lua file is in your installation folder.
Also, as you are using profiles, you should use the auto section for your profile. i.e. change [Auto] to [Auto..Bell UH1c].

You should also use substrings for your aircraft profile names, i.e. change

Quote

[Profile.Bell UH1c]
1=Bell UH-1C Huey N204BH

to

Quote

[Profile.Bell UH1c]
1=Bell UH-1C

and

Quote

[Profile.MD530f]
1=Milviz MD 530 N23FF
2=Milviz MD 530 NWHC

to

Quote

[Profile.MD530f]
1=Milviz MD 530 

and

Quote

[Profile.Dodsim 206]
1=DodoSim 206 Utility
2=DodoSim 206 High Skid

to

Quote

[Profile.Dodsim 206]
1=DodoSim 206

This will then load the profile when you are using different variants/liveries of the same aircraft.

You also have quite a few invalid assignments that you should remove, especially in your [Buttons.Dodsim 206] section, e.g. these

Quote

0=P0,11,C32981,0     -{}-
1=U0,11,C32981,0     -{}-
4=P0,3,C32887,0     -{}-
5=U0,3,C32887,0     -{}-
6=P0,13,C32883,0     -{}-
7=U0,13,C32883,0     -{}-
8=P0,18,C32773,0     -{}-
9=U0,18,C32773,0     -{}-
10=P0,6,C32864,0     -{}-
11=U0,6,C32864,0     -{}-
12=P0,10,C32879,0     -{}-
13=U0,10,C32879,0     -{}-
14=P0,7,C32868,0     -{}-
15=U0,7,C32868,0     -{}-
16=P0,8,C32881,0     -{}-
17=U0,8,C32881,0     -{}-
18=P0,9,C32979,0     -{}-
19=U0,9,C32979,0     -{}-
20=R0,16,C32997,0     -{}-
21=U0,16,C32997,0     -{}-
24=P0,20,C32794,1     -{}-
26=U0,20,C32794,0     -{}-

So please correct those issues, and make sure the lua file I provided is in your FSUIPC4 installation folder, and any issues please also attach your FSUIPC4.log file as well as the FSUIPC4.ini file.

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.