Jump to content

modifs script lua F18


Cougar133

Recommended Posts

Je suis en train de faire des modifications dans les scripts LUA

pour ajouter des paramètres sur l'avion F18

 

Voici mon exemple de test :

 

* Fichier devices.lua

 

-- TEST

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

 

 

* Fichier devices_init.lua

 

-- TEST

creators[devices.TEST] = {

"avLuaDevice",

LockOn_Options.script_path.."test_device.lua",

{}

}

 

 

* Fichier main_init.lua

 

-- 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}

 

 

 

* Fichier test_device.lua

 

local my_param = get_param_handle("TEST_PARAM") -- obtain 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

 

 

 

* Fichier Export.lua

 

-- test

local a26 = MainPanel:get_argument_value(600)

 

 

 

==> Mon problème est que je ne récupére pas la valeur 10 dans ma variable ?

==> j'ai toujours la valeur 0 alors que pour les autres arguments standard , cela fonctionne.

==> j'ai ajouté le device en dernier (60) est le dernier device

==> j'ai vérifié que le arg_number 600 n'existait pas

 

==> Puuvez-vous m'aider ?

[sIGPIC][/sIGPIC]

Ryzen 7950X / Z670E -  32Gb DDR5 6000CAS36 - 4070TI - ReverbG2 - Hotas Cougar FSSBR1

Link to comment
Share on other sites

  • Recently Browsing   0 members

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