November 27, 20169 yr Hi all, I am just starting out using linda. I want to write some of my own lua code For the Carenado Phenom 300. I see that i can get a list of Lvars using the tracer but i am stuck on function names. The first switch i am having a go at is for the emergency lights. Here is the Lvar for it......ASD_SWITCH_EMER_LIGHT_EMB500 Can i Work out the function name from the above Lvar or do i need to source it elsewhere? thanks Stinger
November 27, 20169 yr Good luck on jumping straight in to write your own module for the Phenom. The best advice I can offer as someone who has only worked on one module and modified a couple of others is to find a similar aircraft and study its module to see how it works for that aircraft and then modify the module for your own purposes. The Lvars are data variables provided by or sent to the aircraft addon via FSUIPC4. You can use the Tracer page and console to monitor what values the addon provides for specific switch positions and inject values to see what effect they have on the addon. Most are either 0 or 1 or range from 0 to 100 - but don't quote me. Function names should be description for their purpose. In LUA they are case sensitive and must have no spaces - underscores and dashes are acceptable. The normal convention is to start with an aircraft specific prefix (ie. P300_). There are also a set of 'standard' self-explanatory suffixes like _on, _off, _toggle, _up, _down, etc which should be in lowercase. These are useful for assignment functions to buttons as the alternative function can be automatically selected. Using the LINDA Editor you will see a shortcut (top left) for ensure the correct function format. In answer to your other question on the Development thread, there is no documentation available for LINDA developers. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
November 27, 20169 yr Author Function names should be description for their purpose. In LUA they are case sensitive and must have no spaces - underscores and dashes are acceptable. Are you saying here that I can make up my own function name as long as I follow the convention? The reason I ask this is that my first attempt at a lua code for my emergency lights switch is not working and I thought that the reason it is not is that I have used the wrong function name? As an aside, I have a more fundamental issue. I am using a custom box based on a Leo Bodnar card. Linda recognises the card ok but the"On Release" doesn't seem to work. I have tried assigning a standard FSX aircraft (the baron) with button 29 (my leo box switch number as seen light up in Linda). I assigned button 29 "On press" to nav lights on, and "on release" to nav lights off. When I turn the leo switch on I get the nav lights switch on in fsx but when I turn the leo switch off the nav lights stay on in FSX? Any clues on this one. Thanks for looking and the reply Stinger
November 27, 20169 yr As with any programming language you can give your functions any name but it is useful if you make them meaningful to you and LINDA users. If you base you new module on an existing one, then there is a higher probably of your's working as many of the base structure will already exist. There is an issue with OnRelease in 2.8.5 which I am testing a solution. The work around is to click Reload LUA Engine after any significant save or program change. Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
November 27, 20169 yr Author Thanks for the reply again My plan is to use fsuipc and linda to assign as many of my custom cockpit switches, buttons etc, as i can. Any that i can't, i hope to be able to overcome it by writing my own. I realise this is no simple task but hope fully once i have managed one or two it will get easier. All the best Stinger
December 11, 20169 yr Hi Stinger Did you manage to get the to config button up and running? I'm helping a friend to get started with LINDA, but I can't find the correct variable for it. Kind regards Tomas Kind Regards Tomas Linnet A2A fan
Archived
This topic is now archived and is closed to further replies.