soundrats Posted April 25, 2013 Report Share Posted April 25, 2013 Hello, I had a short discussion in the Linda Forum, please have a short look at what I was asking for. Are you able to show me an example and or tell me where I will found the topic in the FSUIPC guides. Thnx a lot Tom My question: What I like to know is if it is possible to use the commands which are LUA scripted in LINDA can be used in FSUIPC for switching through keystroke or other hardware which is not listed in LINDA? Example: FSUIPC mouse macros I can use via FSUIPC on a GoFlight Switch panel, is there any possibillity that I bring Commands from the linda lua scipt to goflight? Cheers Tom The answer: tom yes you can .... by copying / renaming the actions.lua to the main module folder & adding to that file "parameter" switch codes for those actions you want to setup thru fsuipc. there are notes on this in the fsuipc guides. unfortunately, i'm away from my simming pc & can't show you examples / or give page references. trust another member (gunter) can help in the near term & like i may have rebuilt files to offer if we know the aircraft.. Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 25, 2013 Report Share Posted April 25, 2013 "yes you can .... by copying / renaming the actions.lua to the main module folder & adding to that file "parameter" switch codes for those actions you want to setup thru fsuipc. there are notes on this in the fsuipc guides." Sorry, I don't really understand what notes this is referring to. I'm not a Linda user and know almost nothing about it I'm afraid. If you tell me what you need to do in FSUIPC I can point you to it. Pete Link to comment Share on other sites More sharing options...
soundrats Posted April 25, 2013 Author Report Share Posted April 25, 2013 Hello Pete, thnx for getting back to me. I will try to explain more clearly. A LINDA user offers a LINDA MODUL with a LUA script for using with VRINSIGHT and Joysticks. Unfortunately GOFLIGHT switches are not supported via LINDA. And here comes my question as LINDA is a LUA script - can I use the script in FSUIPC to root it to GOFLIGHT switches - like I do this with FSUIPC macros. For example I have the lines for the apporach lights on and off - if I wolud know how I can use this lines to make the lights working through GOFLIGHT switch 109 I could start to understand and could retry for other actions. You see that I was told that this must work - I did what was mentioned as far as I understand but from here - & adding to that file "parameter" switch codes for those actions you want to setup thru fsuipc - I am totally lost I do not know what is ment. Kind Regards Tom The EXAMPLE: -- ## System functions ## function InitVars () -- uncomment to disable display -- AutopilotDisplayBlocked () end -- ## Exterior Lights ############### function Light_LandingAll_On () Lights_Approach_On () Lights_Flare_On () end function Light_LandingAll_Off () Lights_Approach_Off () Lights_Flare_Off () Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 25, 2013 Report Share Posted April 25, 2013 And here comes my question as LINDA is a LUA script - can I use the script in FSUIPC to root it to GOFLIGHT switches - like I do this with FSUIPC macros. If you have a text-based Lua script (not a compiled one) which operates switches in one way and you want to change it, then, yes, of course you can change t, but you'd probably need to learn a lot about the script, unless it is very simple, beforehand so you knew what to change and where. As far as I recall, there are a number of scripts used by Linda and it gets quite complicated. I'd certainly advise getting help from the authors. For example I have the lines for the apporach lights on and off - if I wolud know how I can use this lines to make the lights working through GOFLIGHT switch 109 I could start to understand and could retry for other actions. But without understanding those lines, I don't see how you can do that. You see that I was told that this must work - I did what was mentioned as far as I understand but from here - & adding to that file "parameter" switch codes for those actions you want to setup thru fsuipc - I am totally lost I do not know what is ment. Sorry, nor do I! Look at your example: -- ## System functions ##function InitVars () -- uncomment to disable display -- AutopilotDisplayBlocked ()end[/CODE]That part does nothing at all. It is just comments.[CODE]-- ## Exterior Lights ###############function Light_LandingAll_On () Lights_Approach_On () Lights_Flare_On ()endfunction Light_LandingAll_Off () Lights_Approach_Off () Lights_Flare_Off ()[/CODE]And that part shows two functions which just call other functions. There is no code here reading buttons or switches and no code here talking to FSUIPC. Evidently all the parts relevant to what you want to do are elsewhere.Why would you want life to be so complicated in any case? Why not just assign your button 109 to the landing lights directly in FSUIPC? This must surely be straight forward, expecially if you already have the macros to do that. Why do in in Linda?RegardsPete Link to comment Share on other sites More sharing options...
soundrats Posted April 25, 2013 Author Report Share Posted April 25, 2013 Thnx a lot Pete, actually I do not want a complicate life for sure. I cannot assign directly the "approach lights" of the DASH8 via FSUIPC. And I cannot make a macro with the FSUIPC macro tool. It just does not work on the virtaul cockpit of the DASH and there is no 2D panel. That is why I thought I can use the Linda lua script to make it work. Kind Regards Tom Sorry I picked thr wrong part i am such a dummy (working in filmbusiness - We can do everything but nothing properly) :razz: Sorry for my bad english EXAMPLE function Lights_Approach_On () Lvar = "L:OHD_EXT_LIGHTS_L_APPR_SW" ipc.writeLvar(Lvar, 1) end function Lights_Approach_Off () Lvar = "L:OHD_EXT_LIGHTS_L_APPR_SW" ipc.writeLvar(Lvar, 0) end Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 25, 2013 Report Share Posted April 25, 2013 You posted this twice so I deleted the earlier one. I cannot assign directly the "approach lights" of the DASH8 via FSUIPC. And I cannot make a macro with the FSUIPC macro tool. It just does not work on the virtaul cockpit of the DASH and there is no 2D panel. That is why I thought I can use the Linda lua script to make it work. If you cannot program it directly in FSUIPC then I don't see how Linda can help. You need some way of operating the switch in the aircraft -- a keypress, a control, a mouse macro or a local panel variable (L:var). If none of those can be used then it can't be done. If any of them can work, then you can do it simply without delving deep into the complex workings of inner Linda. function Lights_Approach_On () Lvar = "L:OHD_EXT_LIGHTS_L_APPR_SW" ipc.writeLvar(Lvar, 1)endfunction Lights_Approach_Off () Lvar = "L:OHD_EXT_LIGHTS_L_APPR_SW" ipc.writeLvar(Lvar, 0)end[/CODE]So, if those are correct for your aircraft, then it uses L:Vars. All you need to do is have one little single-line Lua file:[CODE] ipc.writeLvar("L:OHD_EXT_LIGHTS_L_APPR_SW", ipcPARAM)[/CODE]Save that in the Modules folder as, say, "D8ApprLeft.lua", and assign the switch 109 press to "Lua D8ApprLeft" with parameter 1 and the release to the same with parameter 0.Pete Link to comment Share on other sites More sharing options...
soundrats Posted April 25, 2013 Author Report Share Posted April 25, 2013 Thnx Pete, you made my day - like this it works! Do I have to make a .lua file for any single action or can I write it in one single file? Kind Regards Tom Link to comment Share on other sites More sharing options...
Pete Dowson Posted April 25, 2013 Report Share Posted April 25, 2013 Do I have to make a .lua file for any single action or can I write it in one single file? If you want a single Lua program with lots of alternative actions then that program has to work out what to do, so you'd need to use the parameter (ipcPARAM) with different values for each action and test this (if .... then .... else .... etc). There are examples of such in the User Contributions section. But really, when a large file has to be reloaded and compiled for each button press you'd find it easier and more efficient to keep it simple, one or two (eg on and off as above) actions in each little file. Pete Link to comment Share on other sites More sharing options...
soundrats Posted April 25, 2013 Author Report Share Posted April 25, 2013 You are right, some small files will do it. Thank you very much for your help. Kind Regards Tom Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now