Jump to content

Script LUA for F18


BlackHole

Recommended Posts

I am making changes in LUA scripts

to add parameters on the F18 plane

 

Here is my test example:

 

* Devices.lua file

 

- TEST

devices ["TEST"] = counter () - 60

 

 

* Devices_init.lua file

 

- TEST

creators [devices.TEST] = {

"AvLuaDevice"

LockOn_Options.script_path .. "test_device.lua"

{}

}

 

 

* Main_init.lua file

 

- TEST

TEST_PARAM_GAUGE = CreateGauge ("parameter")

TEST_PARAM_GAUGE.parameter_name = "TEST_PARAM"

TEST_PARAM_GAUGE.arg_number = 600

TEST_PARAM_GAUGE.input = {0,100}

TEST_PARAM_GAUGE.output = {0,1}

 

 

 

* Test_device.lua file

 

local my_param = get_param_handle ("TEST_PARAM") - get shared parameter (created if not exist), i.e. databus

my_param: set (0.1) - set to 0.1

local update_time_step = 0.1

make_default_activity (update_time_step)

--update will be called 10 times per second

 

function post_initialize ()

print ("post_initialize called")

end

 

function update ()

local v = my_param: get ()

my_param: set (10)

end

 

function SetCommand (command, value)

- if command == 3001 then

- print ("user click")

- end

end

 

--need_to_be_closed = false - close lua state after initialization

 

 

 

* Export.lua file

 

- test

local a26 = MainPanel: get_argument_value (600)

 

 

 

==> My problem is that I do not get the value 10 in my variable?

==> I always have the value 0 while for the other standard arguments, it works.

==> I added the device last (60) is the last device

==> I checked that the arg_number 600 did not exist

 

==> Can you help me?

Link to comment
Share on other sites

What are you currently trying to get? Using custom Lua scripts modified with the systems may break the Hornet due to the systems being in C++. (This I have no full clue to though) The answer to this question will greatly help.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...