Jump to content
The simFlight Network Forums

Recommended Posts

Posted (edited)

Hi, 

So, my rudder is broken and now im a liltle short on money, so i have a joystick (CH Flightstick PRO) that only has 2 axis, X and Z. I Assign my Z axis as my Elevator, and X axis as my Aleiron. Some addon , lets say FSLab a3xx and BBS require steering/rudder to move on ground, i tried with auto rudder setting within the simulation but no luck with those 2 add on, is there any way to make the X axis as Rudder in ground and as Aleiron in Sky ?.

What i've tried to do : 
Asign both Aleiron and Rudder/Steering to the X axis in FSUIPC, but when on final the aircraft becomes unstable. 

What i wanted to do :
Change the X axis from aleiron to rudder/steering vice versa with a toogle of a button.


Thanks.

Edited by ZldvX
Posted
10 hours ago, ZldvX said:

So, my rudder is broken and now im a liltle short on money, so i have a joystick (CH Flightstick PRO) that only has 2 axis, X and Z. I Assign my Z axis as my Elevator, and X axis as my Aleiron. Some addon , lets say FSLab a3xx and BBS require steering/rudder to move on ground, i tried with auto rudder setting within the simulation but no luck with those 2 add on, is there any way to make the X axis as Rudder in ground and as Aleiron in Sky ?.

Only by writing a Lua plug-in program to process the axis value as a paramater (ipcPARAM) and assigning the axis to that Lua using LuaValue <name of lua program>.. The plug-in would need to be loaded beforehand by an [Auto.<profile name>] section in the INI. It would use event.param to call a function and that would check whether you are on the ground or in the air and send the appropriate Control using that axis input value which is supplied as a parameter.

10 hours ago, ZldvX said:

What i've tried to do : 
Asign both Aleiron and Rudder/Steering to the X axis in FSUIPC, but when on final the aircraft becomes unstable

I'm not surprised!

10 hours ago, ZldvX said:

What i wanted to do :
Change the X axis from aleiron to rudder/steering vice versa with a toogle of a button.

Same answer as above except that instead of detecting whether you are on the ground you'd have another function, called by event.button, which changes a flag (just a value) which you can interrogate in the main function.

Documentation for all these Lua facilities is contained in your FSUIPC Documents subfolder, along with lots of examples.

Pete

 

Posted
22 minutes ago, Pete Dowson said:

Only by writing a Lua plug-in program to process the axis value as a paramater (ipcPARAM) and assigning the axis to that Lua using LuaValue <name of lua program>.. The plug-in would need to be loaded beforehand by an [Auto.<profile name>] section in the INI. It would use event.param to call a function and that would check whether you are on the ground or in the air and send the appropriate Control using that axis input value which is supplied as a parameter.

I'm not surprised!

Same answer as above except that instead of detecting whether you are on the ground you'd have another function, called by event.button, which changes a flag (just a value) which you can interrogate in the main function.

Documentation for all these Lua facilities is contained in your FSUIPC Documents subfolder, along with lots of examples.

Pete

 

Hi pete,

Thanks for your answer, unfortunately i dont know how to write a program in LUA. Can you guide me which doumentation is relevant for my goals? 

Thanks.

Posted
16 minutes ago, ZldvX said:

i dont know how to write a program in LUA. Can you guide me which doumentation is relevant for my goals? 

As I said, the FSUIPC facilities for Lua plug-ins are documented in PDFs in you FSUIPC Documents subfolder. For help understanding how to write them, look at some of the exmples provided in the ZIP file. To learn more about Lua and possibly see a tutorial you'd need to go to the Lua web site itself, Lua.org.

Pete

 

Posted

Hi,

attached are AilRudSW.lua that needs the corresponding JoyNumber, JoyAxis and ButtonNumber. You get those from FSUIPC and its INI file. The Aileron and Rudder axis have to be disabled in your FS and then assign the Aileron axis in FSUIPC. Set up this axis in FSUIPC to your needs, calibration/ center ...

Place the AilRudSW.lua file into Modules folder, if you don't have any other lua files already running you can place as well the attached ipcReady.lua into Modules folder. If you have already lua files running then add only the AilRudSW.lua file to the list or INI file.

The function setting to select the use of REDUCED RUDDER (1) or ZERO RUDDER (0) is initial set to REDUCED RUDDER, that will reduce the deflection with increasing speed above 25 kts.
setRudREDUCED = 0

Thomas

-------------------------------------------------------
-- Lua plug-in for Aileron / Rudder switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'joyAxis' is the letter between asterix shown in FSUIPC 
-- 'btnNumber' is Button number shown in FSUIPC 
joyNumber = "A"
joyAxis = "X"
btnNumber = 0

-- function setting to select the use of REDUCED RUDDER (1) or ZERO RUDDER (0)
setRudREDUCED = 1

-- maxRudSpd is the speed from where on the rudder is reduced
maxRudSpd = 25.0
corrector = 1.0	-- initial value 1.0

-- create Button mask
btnMask = 2^btnNumber
btnPressed = 0
toggleBtn = 0

-- Rudder out value
rudOut = 0

while 1 do
    ipc.sleep(20)
	ias = ipc.readSD(0x02BC) / 128.0
	if ias >= maxRudSpd then
		corrector = 1.0 - ((ias - maxRudSpd) / 50)
		if corrector < 0.1 then 
			corrector = 0.1 
		elseif corrector > 1.0 then 
			corrector = 1.0 
		end
	end
	if (logic.And(ipc.buttons("A"), btnMask) == 1) then
		btnPressed = btnPressed + 1
		if (btnPressed == 1 and toggleBtn == 0) then
			toggleBtn = 1

			ipc.writeSTR(0x3380, "Rudder COMBINED\0")
			ipc.writeSW(0x32FA, 4)
		elseif (btnPressed == 1 and toggleBtn == 1) then
			toggleBtn = 0
			if setRudREDUCED == 1 then
				ipc.writeSTR(0x3380, "Rudder REDUCTION\0")
				ipc.writeSW(0x32FA, 4)
			else
				ipc.writeSTR(0x3380, "Rudder ZERO\0")
				ipc.writeSW(0x32FA, 4)
			end
		end
		if btnPressed > 25 then btnPressed = 25 end
	else
		if btnPressed > 0 then btnPressed = btnPressed - 1 end
	end
	
	-- read aileron axis from FS
	aileronAxisSW = ipc.axis(joyNumber, joyAxis)
	
	-- write to rudder depending of selection
    if toggleBtn ~= 0 then
	diff = (aileronAxisSW - rudOut) / 5
	rudOut = rudOut + diff
        ipc.writeSW(0x0BBA, -rudOut)
	else
		if setRudREDUCED == 1 then
			diff = ((aileronAxisSW * corrector) - rudOut) / 5
		else
			diff = (0 - rudOut) / 5
		end
		rudOut = rudOut + diff
		ipc.writeSW(0x0BBA, -rudOut)
    end
end

 

AilRudSW.lua

ipcReady.lua

Posted
2 hours ago, Thomas Richter said:

Hi,

attached are AilRudSW.lua that needs the corresponding JoyNumber, JoyAxis and ButtonNumber. You get those from FSUIPC and its INI file. The Aileron and Rudder axis have to be disabled in your FS and then assign the Aileron axis in FSUIPC. Set up this axis in FSUIPC to your needs, calibration/ center ...

Place the AilRudSW.lua file into Modules folder, if you don't have any other lua files already running you can place as well the attached ipcReady.lua into Modules folder. If you have already lua files running then add only the AilRudSW.lua file to the list or INI file.

The function setting to select the use of REDUCED RUDDER (1) or ZERO RUDDER (0) is initial set to REDUCED RUDDER, that will reduce the deflection with increasing speed above 25 kts.
setRudREDUCED = 0

Thomas


-------------------------------------------------------
-- Lua plug-in for Aileron / Rudder switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'joyAxis' is the letter between asterix shown in FSUIPC 
-- 'btnNumber' is Button number shown in FSUIPC 
joyNumber = "A"
joyAxis = "X"
btnNumber = 0

-- function setting to select the use of REDUCED RUDDER (1) or ZERO RUDDER (0)
setRudREDUCED = 1

-- maxRudSpd is the speed from where on the rudder is reduced
maxRudSpd = 25.0
corrector = 1.0	-- initial value 1.0

-- create Button mask
btnMask = 2^btnNumber
btnPressed = 0
toggleBtn = 0

-- Rudder out value
rudOut = 0

while 1 do
    ipc.sleep(20)
	ias = ipc.readSD(0x02BC) / 128.0
	if ias >= maxRudSpd then
		corrector = 1.0 - ((ias - maxRudSpd) / 50)
		if corrector < 0.1 then 
			corrector = 0.1 
		elseif corrector > 1.0 then 
			corrector = 1.0 
		end
	end
	if (logic.And(ipc.buttons("A"), btnMask) == 1) then
		btnPressed = btnPressed + 1
		if (btnPressed == 1 and toggleBtn == 0) then
			toggleBtn = 1

			ipc.writeSTR(0x3380, "Rudder COMBINED\0")
			ipc.writeSW(0x32FA, 4)
		elseif (btnPressed == 1 and toggleBtn == 1) then
			toggleBtn = 0
			if setRudREDUCED == 1 then
				ipc.writeSTR(0x3380, "Rudder REDUCTION\0")
				ipc.writeSW(0x32FA, 4)
			else
				ipc.writeSTR(0x3380, "Rudder ZERO\0")
				ipc.writeSW(0x32FA, 4)
			end
		end
		if btnPressed > 25 then btnPressed = 25 end
	else
		if btnPressed > 0 then btnPressed = btnPressed - 1 end
	end
	
	-- read aileron axis from FS
	aileronAxisSW = ipc.axis(joyNumber, joyAxis)
	
	-- write to rudder depending of selection
    if toggleBtn ~= 0 then
	diff = (aileronAxisSW - rudOut) / 5
	rudOut = rudOut + diff
        ipc.writeSW(0x0BBA, -rudOut)
	else
		if setRudREDUCED == 1 then
			diff = ((aileronAxisSW * corrector) - rudOut) / 5
		else
			diff = (0 - rudOut) / 5
		end
		rudOut = rudOut + diff
		ipc.writeSW(0x0BBA, -rudOut)
    end
end

 

AilRudSW.lua

ipcReady.lua

Hi Thomas,

Thank you for your reply, but in what part i cant get the "joyNumber", "joyAxis", and the "btnNumber" ? is it in the FSUIPC application or in the .ini files ? im sorry for such a noob question 😄 

Thanks

Posted

Hi,

Note a change in the file, use the attached one. It allows to have a different Joystick than the Ail axis one, see changed code below!

go to Axis Assignment tab where you assigned your Aileron axis. Here, in my case, joyNumber = A (Joy#) and joyAxis = X (Axis#).

image.png.9171f98e1936ceefd7e880156f062303.png

 

Go to Buttons + Switches tab and press the joystick button you want to use. Here, in my case, btnNumber = 0 (Btn#). As I changed the code you can now assign a different joystick than the Ail axis one by changing the parameter for btnJoy = joyNumber to what you want to use. It's the same format as for joyNumber and taken from below as the btnNumber, here in my case, (Joy#).

image.png.b0f767dd84d1546241d92f34de580c03.png

 

-------------------------------------------------------
-- Lua plug-in for Aileron / Rudder switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'joyAxis' is the letter between asterix shown in FSUIPC 
-- 'btnNumber' is Button number shown in FSUIPC 
joyNumber = "A"
joyAxis = "X"
btnJoy = joyNumber	-- can be replaced with the number/letter if a differend joystick is used i.e. btnJoy = "B"
btnNumber = 0

 

Thomas

AilRudSW.lua

Posted
8 hours ago, Thomas Richter said:

Hi,

Note a change in the file, use the attached one. It allows to have a different Joystick than the Ail axis one, see changed code below!

go to Axis Assignment tab where you assigned your Aileron axis. Here, in my case, joyNumber = A (Joy#) and joyAxis = X (Axis#).

image.png.9171f98e1936ceefd7e880156f062303.png

 

Go to Buttons + Switches tab and press the joystick button you want to use. Here, in my case, btnNumber = 0 (Btn#). As I changed the code you can now assign a different joystick than the Ail axis one by changing the parameter for btnJoy = joyNumber to what you want to use. It's the same format as for joyNumber and taken from below as the btnNumber, here in my case, (Joy#).

image.png.b0f767dd84d1546241d92f34de580c03.png

 


-------------------------------------------------------
-- Lua plug-in for Aileron / Rudder switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'joyAxis' is the letter between asterix shown in FSUIPC 
-- 'btnNumber' is Button number shown in FSUIPC 
joyNumber = "A"
joyAxis = "X"
btnJoy = joyNumber	-- can be replaced with the number/letter if a differend joystick is used i.e. btnJoy = "B"
btnNumber = 0

 

Thomas

AilRudSW.lua

Hi Thomas,

Thanks again, i appreciate it, but somehow your script wont work with FSLabs A3xx , any other aircraft is fine. 
I tried to edit the script but its too confusing, basically what i tried to do is this : 

If "A button" is pressed, use X axis as Rudder, if "A button" is pressed again, use X axis as Steering.

im relatively new to LUA programming, do you think you can help me achieve it ?

Thanks

Posted

Hi,

you can try this one as it sends the FS Controls instead. You only need to assign the axis as shown. The Button has to be assigned as before.

In case the file name changed you will need both attached new files, RudTilSW.lua and ipcReady.lua

image.png.60e4d27f283e6557f75363ceeb7c0203.png

 

Go to Buttons + Switches tab and press the joystick button you want to use. Here, in my case, btnNumber = 0 (Btn#) and for joyNumber = A (Joy#) to what you want to use, here in my case, (Joy#).

image.png.b0f767dd84d1546241d92f34de580c03.png

 

Thomas

-------------------------------------------------------
-- Lua plug-in for Rudder / Tiller switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'btnNumber' is Button number shown in FSUIPC 

-- FS Controls
joyNumber = "A"
btnNumber = 0

-- create Button mask
btnMask = 2^btnNumber
btnPressed = 0
toggleBtn = 0

-- Rudder out value
rudOut = 0
tilOut = 0
setZero = 1

while 1 do
    ipc.sleep(20)

	if (logic.And(ipc.buttons(joyNumber), btnMask) == 1) then
		btnPressed = btnPressed + 1
		if (btnPressed == 1 and toggleBtn == 0) then
			toggleBtn = 1
			setZero = 0

			ipc.writeSTR(0x3380, "TILLER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		elseif (btnPressed == 1 and toggleBtn == 1) then
			toggleBtn = 0
			setZero = 0
			
			ipc.writeSTR(0x3380, "RUDDER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		end
		if btnPressed > 25 then btnPressed = 25 end
	else
		if btnPressed > 0 then btnPressed = btnPressed - 1 end
	end
	
	-- read aileron axis from FS
	axisSW = ipcPARAM
	
	-- write to rudder depending of selection
    if toggleBtn == 1 then	-- write TILLER
		diffT = (axisSW - tilOut) / 5
		tilOut = tilOut + diffT
		ipc.control(66818, tilOut)
		if setZero == 0 then
			setZero = 1
			rudOut = 0
			ipc.control(65764, 0)
			ipc.log("RUD nCTR")
		end
	else	-- write RUDDER
		diffR = (axisSW - rudOut) / 5
		rudOut = rudOut + diffR
		ipc.control(65764, rudOut)
		if setZero == 0 then
			setZero = 1
			tilOut = 0
			ipc.control(66818, 0)
			ipc.log("TIL nCTR")
		end
    end
end

 

ipcReady.lua

 

RudTilSW.lua

Posted
10 hours ago, Thomas Richter said:

Hi,

you can try this one as it sends the FS Controls instead. You only need to assign the axis as shown. The Button has to be assigned as before.

In case the file name changed you will need both attached new files, RudTilSW.lua and ipcReady.lua

image.png.60e4d27f283e6557f75363ceeb7c0203.png

 

Go to Buttons + Switches tab and press the joystick button you want to use. Here, in my case, btnNumber = 0 (Btn#) and for joyNumber = A (Joy#) to what you want to use, here in my case, (Joy#).

image.png.b0f767dd84d1546241d92f34de580c03.png

 

Thomas


-------------------------------------------------------
-- Lua plug-in for Rudder / Tiller switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'btnNumber' is Button number shown in FSUIPC 

-- FS Controls
joyNumber = "A"
btnNumber = 0

-- create Button mask
btnMask = 2^btnNumber
btnPressed = 0
toggleBtn = 0

-- Rudder out value
rudOut = 0
tilOut = 0
setZero = 1

while 1 do
    ipc.sleep(20)

	if (logic.And(ipc.buttons(joyNumber), btnMask) == 1) then
		btnPressed = btnPressed + 1
		if (btnPressed == 1 and toggleBtn == 0) then
			toggleBtn = 1
			setZero = 0

			ipc.writeSTR(0x3380, "TILLER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		elseif (btnPressed == 1 and toggleBtn == 1) then
			toggleBtn = 0
			setZero = 0
			
			ipc.writeSTR(0x3380, "RUDDER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		end
		if btnPressed > 25 then btnPressed = 25 end
	else
		if btnPressed > 0 then btnPressed = btnPressed - 1 end
	end
	
	-- read aileron axis from FS
	axisSW = ipcPARAM
	
	-- write to rudder depending of selection
    if toggleBtn == 1 then	-- write TILLER
		diffT = (axisSW - tilOut) / 5
		tilOut = tilOut + diffT
		ipc.control(66818, tilOut)
		if setZero == 0 then
			setZero = 1
			rudOut = 0
			ipc.control(65764, 0)
			ipc.log("RUD nCTR")
		end
	else	-- write RUDDER
		diffR = (axisSW - rudOut) / 5
		rudOut = rudOut + diffR
		ipc.control(65764, rudOut)
		if setZero == 0 then
			setZero = 1
			tilOut = 0
			ipc.control(66818, 0)
			ipc.log("TIL nCTR")
		end
    end
end

 

ipcReady.lua

 

RudTilSW.lua

Hi Thomas,

Thanks again, really appreciate it, but seems like doesnt work, when i press my button on my joystick , nothing happend (The joynumber and button number is the same), and also i tried to change instead "Rudder To Tiller" to "Rudder to Aileron" because that what i try to achieve (its a typo when i said rudder to tiller, Sorry 😄 ) by change the ipc.control value. here i attached my edited script,  Really hope you can help me to see what the matter. Sorry to bother you. 

Thanks.

-------------------------------------------------------
-- Lua plug-in for Rudder / Tiller switch --
-------------------------------------------------------

-------------------------------------------------------
-- if 'AutoAssignLetters=Yes' is used then 'joyNumber' is a letter between asterix
-- else it is the number without asterix
-- 'btnNumber' is Button number shown in FSUIPC 

-- FS Controls
joyNumber = "A"
btnNumber = 1

-- create Button mask
btnMask = 2^btnNumber
btnPressed = 0
toggleBtn = 0

-- Rudder out value
rudOut = 0
tilOut = 0
setZero = 1

while 1 do
    ipc.sleep(20)

	if (logic.And(ipc.buttons(joyNumber), btnMask) == 1) then
		btnPressed = btnPressed + 1
		if (btnPressed == 1 and toggleBtn == 0) then
			toggleBtn = 1
			setZero = 0

			ipc.writeSTR(0x3380, "TILLER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		elseif (btnPressed == 1 and toggleBtn == 1) then
			toggleBtn = 0
			setZero = 0
			
			ipc.writeSTR(0x3380, "RUDDER CONTROL\0")
			ipc.writeSW(0x32FA, 4)
		end
		if btnPressed > 25 then btnPressed = 25 end
	else
		if btnPressed > 0 then btnPressed = btnPressed - 1 end
	end
	
	-- read aileron axis from FS
	axisSW = ipcPARAM
	
	-- write to rudder depending of selection
    if toggleBtn == 1 then	-- write TILLER
		diffT = (axisSW - tilOut) / 5
		tilOut = tilOut + diffT
		ipc.control(65695, tilOut)
		if setZero == 0 then
			setZero = 1
			rudOut = 0
			ipc.control(65764, 0)
			ipc.log("RUD nCTR")
		end
	else	-- write RUDDER
		diffR = (axisSW - rudOut) / 5
		rudOut = rudOut + diffR
		ipc.control(65764, rudOut)
		if setZero == 0 then
			setZero = 1
			tilOut = 0
			ipc.control(65695, 0)
			ipc.log("TIL nCTR")
		end
    end
end

--Aileron 65695
--Steering 66818
--Rudder 65764

 

RudTilSW.lua

Posted

Hi,

the changed control value you did works correct here. Have you done the first configuration part correct?

Please send your FSUIPC INI file and FSUIPC log file, both located in Modules folder, zipped and attached to your message here. If zip attachment doesn't work for you then copy and paste their content to your message.

Thomas

Posted
44 minutes ago, Thomas Richter said:

Hi,

the changed control value you did works correct here. Have you done the first configuration part correct?

Please send your FSUIPC INI file and FSUIPC log file, both located in Modules folder, zipped and attached to your message here. If zip attachment doesn't work for you then copy and paste their content to your message.

Thomas

Hi,

Here is both the .ini and log file. 

*i reupload the files, because i attached an old log.
 

 

log.rar

Posted

Hi,

your INI file shows that you didn't follow the instructions.

[Axes]
PollInterval=10
RangeRepeatRate=10
0=AX,256,F,65695,0,0,0    -{ TO SIM: AILERON_SET }-
1=AY,256,F,65694,0,0,0    -{ TO SIM: ELEVATOR_SET }-
2=AZ,256,F,L4:R,0,0,0    -{ TO SIM: Lua AilRudSW }-

...

[Auto]
1=Lua AilRudSW

Yous have the X axis (normally Aileron) direct assigned to Aileron_Set instead to LuaValue RudTilSW from scroll down list !!

You have the the Z axis assigned to Lua AilRudSW . First of all that only loads the file only, but also it is not the last file you changed!

When you lock at the pic I sent, to make it as easy as possible to set up, you can see the correct needed setting for the axis.

image.png.60e4d27f283e6557f75363ceeb7c0203.png (605Ã432)

When you correct those both errors in your set up it will work, hopefully as well with your add-on A320.

Thomas

Posted
20 minutes ago, Thomas Richter said:

Hi,

your INI file shows that you didn't follow the instructions.


[Axes]
PollInterval=10
RangeRepeatRate=10
0=AX,256,F,65695,0,0,0    -{ TO SIM: AILERON_SET }-
1=AY,256,F,65694,0,0,0    -{ TO SIM: ELEVATOR_SET }-
2=AZ,256,F,L4:R,0,0,0    -{ TO SIM: Lua AilRudSW }-

...

[Auto]
1=Lua AilRudSW

Yous have the X axis (normally Aileron) direct assigned to Aileron_Set instead to LuaValue RudTilSW from scroll down list !!

You have the the Z axis assigned to Lua AilRudSW . First of all that only loads the file only, but also it is not the last file you changed!

When you lock at the pic I sent, to make it as easy as possible to set up, you can see the correct needed setting for the axis.

image.png.60e4d27f283e6557f75363ceeb7c0203.png (605Ã432)

When you correct those both errors in your set up it will work, hopefully as well with your add-on A320.

Thomas

Hi thomas, here i updated the setting. 

the problem is the button to change to Alieron or vice versa is not responding when i press it.564669017_Screenshot(177).png.ae13659264acdf406f171ae158c25a3e.png474730571_Screenshot(178).png.4261c4f7e07850a4d6695aaeafa6e02c.png

 

Is there any chance to change the button to keyboard button instead ?

 

Thanks.

Posted
12 minutes ago, Thomas Richter said:

Please send again your FSUIPC INI file and FSUIPC log file.

Thomas

Here it is. The axis is fine, when i move the X axis the rudder does move, the only problem is that i cant switch it to alieron.

 

Thanks

Log.rar

Posted

Hi,

use the attached lua file. I didn't change the file name.

Lua behaves different than C/C++, I didn't check, as it doesn't return TRUE or FALSE (1 or 0) for the ipc.buttons function but the checked bitmask if TRUE else 0. I corrected that so it will work now correct.

Thomas

RudTilSW.lua

Posted
2 hours ago, Thomas Richter said:

Hi,

use the attached lua file. I didn't change the file name.

Lua behaves different than C/C++, I didn't check, as it doesn't return TRUE or FALSE (1 or 0) for the ipc.buttons function but the checked bitmask if TRUE else 0. I corrected that so it will work now correct.

Thomas

RudTilSW.lua

Hi,

Thank you thomas the script work, The button does work, i can change from aileron to rudder and vice versa but im unable to change the control inside the sim, what i have to do is open the fsuipc menu, press the button, and come back to sim, and the control changed. do you by chance know why is that? is that a bug or theres something wrong with my fsuipc setting or something ? 

Or theres something wrong with the ipcReady ? i load the RudTilSW from ipcReady (I deleted the [Auto] in fsuipc ini)

Heres my ipcReady log  

********* LUA: "ipcReady" Log [from FSUIPC version 5.151] *********
  3850250 System time = 07/08/2019 08:20:35, Simulator time = 14:00:08 (19:00Z)
  3850250 LUA: beginning "F:\Lockheed Martin Prepar3D v4\Modules\ipcReady.lua"
  3850250 LUA: F:\Lockheed Martin Prepar3D v4\Modules\ipcReady.lua:1
  3850250 LUA: Global: ipcPARAM = 0
  3850359 >>> Thread forced exit (ipc.exit or os.exit) <<<
  3850359 System time = 07/08/2019 08:20:35, Simulator time = 14:00:08 (19:00Z)
********* LUA execution terminated: Log Closed *********

 

 

Thank You.

Posted

Hi,

the INI file shows two things.

1. you have the axes assigned global, for all AC. But also as a profile for the FSLABS320 only. If you want to use it for all AC anyway then the Profile for the FSLABS320 can be deleted in the INI file.

2. if you use the ipcReady file to load the lua file then you don't load it again in [Auto} section, that loads it already. 'Maybe' one load cancels the other, so you load the RudTilSW.lua via the ipcReady.lua OR with [Auto] section.

Try after correcting this.

Thomas

Later:  Missed that Or theres something wrong with the ipcReady ? i load the RudTilSW from ipcReady (I deleted the [Auto] in fsuipc ini)

So you fixed that already.

 

[Axes]
PollInterval=10
RangeRepeatRate=10
0=AX,256,F,L3:V,0,0,0	-{ TO SIM: LuaValue RudTilSW }-
1=AY,256,F,65694,0,0,0	-{ TO SIM: ELEVATOR_SET }-
.
.
.
[Auto]
1=Lua RudTilSW

[LuaFiles]
1=landarate
2=ipcReady
3=RudTilSW

[Profile.FSLABS320]
1=FSLabs A320X CFM - Air France (F-HBNL)

[Axes.FSLABS320]
RangeRepeatRate=10
0=AX,256,F,L3:V,0,0,0	-{ TO SIM: LuaValue RudTilSW }-
1=AY,256,F,65694,0,0,0	-{ TO SIM: ELEVATOR_SET }-

 

 

Posted
5 hours ago, Thomas Richter said:

Hi,

the INI file shows two things.

1. you have the axes assigned global, for all AC. But also as a profile for the FSLABS320 only. If you want to use it for all AC anyway then the Profile for the FSLABS320 can be deleted in the INI file.

2. if you use the ipcReady file to load the lua file then you don't load it again in [Auto} section, that loads it already. 'Maybe' one load cancels the other, so you load the RudTilSW.lua via the ipcReady.lua OR with [Auto] section.

Try after correcting this.

Thomas

Later:  Missed that Or theres something wrong with the ipcReady ? i load the RudTilSW from ipcReady (I deleted the [Auto] in fsuipc ini)

So you fixed that already.

 


[Axes]
PollInterval=10
RangeRepeatRate=10
0=AX,256,F,L3:V,0,0,0	-{ TO SIM: LuaValue RudTilSW }-
1=AY,256,F,65694,0,0,0	-{ TO SIM: ELEVATOR_SET }-
.
.
.
[Auto]
1=Lua RudTilSW

[LuaFiles]
1=landarate
2=ipcReady
3=RudTilSW

[Profile.FSLABS320]
1=FSLabs A320X CFM - Air France (F-HBNL)

[Axes.FSLABS320]
RangeRepeatRate=10
0=AX,256,F,L3:V,0,0,0	-{ TO SIM: LuaValue RudTilSW }-
1=AY,256,F,65694,0,0,0	-{ TO SIM: ELEVATOR_SET }-

 

 

Hi Thomas,

Good news, its all worked out. what i need to do is close my logitech gaming software (because it run lua script in background too, i dont know why but it somehow wont work if i leave LGS open) and Assign the LUAvalue to button 3. Thank you so much for taking your time to guide me through this 😄

Again, Thank You So Much !


1452898774_Screenshot(179).png.39d52d6edf75b261c6c0b8e4409bc522.png

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.