July 22, 20196 yr LINDA Vers: 3.0.12 FSUIPC Vers: 4.974 FSX SE Hi all, Early days for LINDA and I but over the weekend I’ve started to build my helicopter start sequence with some significant help from ScotFlieger and I am calling that ‘Phase 1’. I am posting this because I’d like to be pointed in the right direction so I can get on with phases 2 & 3. Here’s the plan… Phase one involves a battery switch (practical switch on my home made collective which you might call an HID) which turns on the battery and runs a cockpit fan sound effect on a loop. Then, a push-to-hold button (HID) is held down for 60 seconds while a starter/wind up sound effect runs and a light is illuminated on the model panel to confirm. After the 60 secs, I flick another physical switch and that triggers an engine start. All working and I love it! Phase 2 will be to automate that sequence in this way: Pushing and holding the start button triggers a .lua function that times the 60 seconds and then starts the engine automatically. If the button is released within the 60 seconds, the process stops (this will be relevant in phase 3). I have a light on the panel that reacts to the starter button being pressed and it goes out when the button is released. My plan is to use the light condition (on/off) to cue the .lua function (if the light is on, start counting, if it is off, stop counting and if you reach 60 secs, launch engine start). Phase 3 will be to use timings in the 60 second count to start to turn the rotors incrementally and affect certain gauges to reflect the wind up (rotor rpm, oil pressure etc). Here are the questions; Where can I look for example code that will achieve phase 2 and how practical is my phase 3 plan? I realise it would be an if/then/else environment but like I said, it's early days for me and coding. Can LINDA monitor the starter light or would I be better advised to monitor the physical button condition instead? The exact code would be nice but I won’t learn anything that way so I’m looking for some hand holding rather than specific lines of code. I know that all this is probably in the literature somewhere but the penny is yet to drop as far as language goes so I guess I'm looking for the plain english version. Thanks in advance, D
July 22, 20196 yr What you say is possible, but good lord, not for newbie. i just spent 3 days making a light blink via lua 😄 got it in the end though. to tech yourself I’d suggest places like fsDelveloper website. And fsdeveloper wiki site. Also look at other gauge xml files to give you an idea of how it all ties together. 1 thing I picked up on that sticks for some reason..... When writing lua, if you get an error saying “<eof> expected character near end”, (or words to that effect) you have to many end sections in your code. The way it’s written can be misleading. I thought there wasn’t enough end sections. some stuff on variables http://www.fs2x.com/Tutorials_files/XML Gauge Programming for FS2004. Chapter 3. Variables V3_0.pdf Some “Rotation” xml examples....for needles and other things that you want to rotate...knobs ect.. https://www.fsdeveloper.com/forum/threads/rotating-knob.430889/ Edited July 22, 20196 yr by MaDDogz Luke Pype
July 22, 20196 yr Author Thank you MaDDogz, I know what you mean and I'm not in a rush. Nearly had a breakdown just trying to get a 'buttonOnPress' function past the syntax rules. But, even with bay steps, I'm making progress. Thanks for the links. I'm going to lie down with a cold towel for a few minutes. D
July 22, 20196 yr LOL!! Yeh, made me feel like that too! its hard mentally, and very exhausting But the relief / sense of achievement when you test it and it all works...great stuff. Don't rush, double check every line after you have typed it for errors, a space in the wrong place ect.Trying to find them when the LUA / XML gets long is another mind bender, lol Wish you good luck. Luke Pype
Archived
This topic is now archived and is closed to further replies.