Variables in action.lua

Recommended Posts


If I want to modifiy a function for a given aircraft in actions.lua, I will copy it to user.lua for the same aircraft and modify it here. Will variables declared in actions.lua be 'visible' from the user.lua function, or will I have to declare ir again?




Share this post

Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Yes. All LINDA LUA variables, including system and aircraft, will be visible and modifiable. I would caution against modifying LINDA system LUA variables as  this may cause unexpected results or errors. You can use the prefix local to make the LUA variable specific to the function in which it is declared in.

Writing your own functions in user.lua can be named the same as existing aircraft function to override the original and will be called instead of the original. In this case no variables declared by the original function can be used. 

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now