Hi
So, I'm getting to grips (read: reacquainting myself) with script writing to build switch panels for my Flight deck, migrating from SimVim.
I've managed to geta few switches working without an image on the panel. Whilst building the panel, want to add the image of the switch or button...
So, run the videos and copied the switch and button scripts/amended, your basic as follows:
function propsync_pressed()
print("I am pressed!")
end
function propsync_released()
print("I am released!")
end
propsync = button_add("press_off.png", "press_on.png", 50,50,100,100,propsync_pressed, propsync_released)
RUN the script and get - ERROR - logic.lua:9: attempt to call a nil value (global 'button_add') I've written several scripts for variations of adding an image and xxx-add persists in this error...
The .png are located in the correct resource folder and I just cannot fathom why I get this error.
Its gota be a basic mistake ... can you point me in the right direction, please.
Thank
Nik
persistent error...ERROR - logic.lua:9: attempt to call a nil value
Re: persistent error...ERROR - logic.lua:9: attempt to call a nil value
The button add is the virtual button. In hardware functions you'll need to use hw_button_add
Re: persistent error...ERROR - logic.lua:9: attempt to call a nil value
What you posted should work if it's used in an instrument script rather than a hardware function script.
As Ralph said you can't generate any graphics from a hardware function script.
As Ralph said you can't generate any graphics from a hardware function script.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: persistent error...ERROR - logic.lua:9: attempt to call a nil value
Hi Guys
Thanks.. for refreshing my knackered old memory!!
Yeh.. worked with instruments... Duh
Still thrashing around ... Getting there slowly.
As ever grateful ...
Cheers
Nik
Thanks.. for refreshing my knackered old memory!!
Yeh.. worked with instruments... Duh
Still thrashing around ... Getting there slowly.
As ever grateful ...
Cheers
Nik