Hello Guest it is May 12, 2021, 10:00:59 AM

Author Topic: accessibility of lua functions?  (Read 982 times)

0 Members and 1 Guest are viewing this topic.

accessibility of lua functions?
« on: April 30, 2017, 11:41:28 AM »
Hello,

I added a script to a tab-page onEnter, which contains a function and works so far.

Now I want to reuse that function from a buttons leftup script - and that fails. Where do I have to put functions right, so that both scripts can use it?

Offline DazTheGas

*
  •  753 753
  • DazTheGas
    • View Profile
Re: accessibility of lua functions?
« Reply #1 on: April 30, 2017, 01:45:08 PM »
You will need to declare your functions in the Screen_Load_Script this will make it available at all objects within the Gui except the Lua Panels

DazTheGas
Theres always time for a choccy biccy
Re: accessibility of lua functions?
« Reply #2 on: May 01, 2017, 03:18:59 AM »
Thanks! That was the key.

As the manual didn't mention function declarations at all, I asked Mr.Google and he gave me a helping hand :D
Function declaration is just asigning a value to a variable =:O

Works pretty well and it is completely awfull, how fast lua is :)
Re: accessibility of lua functions?
« Reply #3 on: May 06, 2017, 12:04:14 AM »
Hello,

build 3384 broke this rule. Now no declarations from screenload script are recognized and I can not access functions. I added there.

What's the new way of doing it right?