i am hoping someone to help me out in this. i am trying to make a plugin so when ever i apply collective the rudder should set to the define position as per rough formula i have calculated. but this code has some issues as rudder position comes to zero after few input by collective and peddals.
looking forward to this forum to guide me
regards
Code: Select all
[code]
old_thr=1
new_thr=1
new_rd=1
old_rd=1
function rd(rd)
new_rd=rd
print("rd"..rd)
if old_rd > new_rd then
print("+")
else
print("-")
end
print("new_rd"..new_rd)
print("old_rd"..old_rd)
old_rd=new_rd
end
function compare(thr)
thr = var_round(thr,2)
new_thr=thr
if thr >4.5 then
print("thr"..thr)
rd_set=(165.23*new_thr)-(16548*new_rd)
print ("rd_set"..rd_set)
if old_thr <= new_thr then
fsx_event("RUDDER_SET",rd_set)
print("ok")
else
fsx_event("RUDDER_SET",-rd_set)
print("no")
end
print("new"..new_thr)
print("old"..old_thr)
old_thr=new_thr
end
end
fsx_variable_subscribe("GENERAL ENG THROTTLE LEVER POSITION:1","Percent", compare)
fsx_variable_subscribe( "RUDDER POSITION", "Position", rd)
[/code]