Jump to content
The simFlight Network Forums

Nick M

new Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    United Kingdom

Nick M's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Thanks chaps! Yeah maybe Al. Perhaps this would simply the Lua function needed. Basically I'd just need a function which would check whether the existing value was negative or positive and then increment or decrement accordingly as long as the button was pressed in. Paul, thanks very much for these examples: they're exactly what I need to get started. This last Sept weekend here in the UK has seen some glorious weather, so no fiddling with FS or Lua stuff and I'm away with work for a couple of weeks from tomorrow. However, when I get back I'll revisit this topic. Thanks again fellas! ;-) Nick
  2. Thanks Al for the suggestion. ;-) I think I need to have a dig around for some snippets of code that do similar things. I'm not sure if a loop would be overcomplicating things more than needed though, as (presumably) there's a way to just invoke the increment or decrement action via a Lua function until the specified parameter (in this case 0) is met? As far as I'm aware, the turn knob values are just integers so sounds like that should help to simplify things. I'll post the question on the A2A forums when I get round to it as I know there are a few Lua gurus there too. Thanks again, Nick
  3. Hello there! I'm very new to FSUIPC (order #1342052) and still getting acquainted with this marvellous bit of software. Thank you Pete! So far (as well as the basic stuff like axis assignments) I've managed to program hardware buttons to control some features in A2A aircraft using their published L:Var list. For example, their PA-24 and PA-28 use an S-TEC System 30 autopilot with a 'turn knob' (separate to the HDG knob). I've set up a hardware button to drive this anticlockwise using its L:Var - L:ApTurnKnob. The knob has a range of -50 (full left) to 50 (full right) with 0 of course being the centre position. Therefore it's set as follows... This works wonderfully and I use another button to turn the knob clockwise. I also managed to instantaneously centre the knob with a third button using the L:ApTurnKnob=SET action. However, this leads onto my question... I'd love to be able to smoothly centre the knob by pressing a single button using the 'INC' and 'DEC' actions; however, I suspect that a custom Lua function will be necessary for this. The basic logic would be that if the knob's position was <0 then it should INC until reaching zero, and if its position was >0 then it should DEC until it's at zero. I'm sure this is a pretty simple undertaking, and if anyone could suggest a bit of code that would do this, I'd be very grateful. It's a rather trivial little thing I know, but it should help get me started with some simple Lua programming and the basic syntax etc. (I'm completely new to Lua but have worked with Visual Basic a bit.) Thanks, Nick P.S. I also tried using the parameter of 0 in the example pictured above, expecting this would cause the knob to stop at its centred position but it didn't - it's just kept turning. The closest I could get was using a -1 or 1 parameter. Anyway, this is a slight aside as ideally I'd like to be able to just use a single hardware button to centre the knob. ;-) (...Edited to improve post title.)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.