game controller
Re: game controller
Good. You don’t need all that code that I posted. It was just in there to help show what is happening. Remember to remove the prints.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: game controller
sure thanks a lot
Re: game controller
hi
can some go through my code and check y my rd function is not called with change in Thr and new_rd
what wrong am i doing kindly someone point it out
regards
can some go through my code and check y my rd function is not called with change in Thr and new_rd
what wrong am i doing kindly someone point it out
regards
Code: Select all
new_elv=0
new_alr=0
new_col=0
new_rd=0
rd=0
Thr=0
function callback(type, index, value)
print("Type = " .. type .. ", Index = " .. index .. ", Value = " .. value)
if index==1 then
new_elv= value
print("elv"..new_elv)
elseif index==0 then
new_alr=value
print("alr"..new_alr)
elseif index==2 then
new_col=value
print("col"..new_col)
elseif index==3 then
new_rd=value
print("rd"..new_rd)
end
end
function thr(thr)
Thr=thr
print ("thr"..Thr)
end
function rd()
R=(Thr/100)+new_rd
print ("RD"..R)
fsx_variable_write("RUDDER POSITION", "position", R)
end
list = game_controller_list()
for k, v in pairs(list) do
print(v)
if v == "Logitech Extreme 3D" then game_controller_add(v, callback) end
end
fsx_variable_subscribe("GENERAL ENG THROTTLE LEVER POSITION:1", "percent", thr)
rd()
Re: game controller
You are not calling rd everytime Thr updates. That is why it does not work. The rd() call needs to be inside the Thr callback for it to be run everytime the throttle changes.
This is quite basic stuff you are asking. I would suggest you spend some time studying the instrument API pages of the wiki and watch through the tutorial videos. This will help you moving forward.
This is quite basic stuff you are asking. I would suggest you spend some time studying the instrument API pages of the wiki and watch through the tutorial videos. This will help you moving forward.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: game controller
thanks a lot yes i need to spend sometime on it.