Jump to content
The simFlight Network Forums

Clearing variable sent to Lua function


Recommended Posts

I have a LUA function that listens for parameter changes using event.param(functionName). My understanding is that if I send the same parameter over and over again the function will not trigger, since the param value hasn't changed. Right now I'm setting the parameter to zero in my button release and treating a zero as a NOOP, but I'm curious whether the function itself can modify the parameter value. The documentation doesn't seem clear, or my brain is too small. 😄

Cheers!

 

Link to post
Share on other sites

Luke,
It seems you would like one particular button to call a function w/ repeat.
An option is to use event.flag(flag #, function name) in the lua, then in the button assignment, use LuaToggle <lua name>  with a param of the flag#, repeat on. 
When passed to the function, the flag number gets sent too, perhaps can be used similar to the param being sent using event.param.

I use flags / LuaToggle a lot when multiple user interfaces need to use the same function in some fashion - very handy.

Roman

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • 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.