Add feature to Create custom Dataref or Command from AM/AP
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Add feature to Create custom Dataref or Command from AM/AP
It would be a great feature to be able to create a new custom dataref or command (x-plane) from within the logic.lua, as the x-plane SDK allow this to be performed, so we no more need to rely on external plugin like FlyWithLua or XLua ...
Re: Add feature to Create custom Dataref or Command from AM/AP
Interesting. Why this topic never has been answered or at least addressed?
Chief Technology Officer (CTO) at 360ATC Aviation Training Center
Electronic Engineer. Control & Software Specialist
Electronic Engineer. Control & Software Specialist
Re: Add feature to Create custom Dataref or Command from AM/AP
What would you do with those datarefs?
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: Add feature to Create custom Dataref or Command from AM/AP
As mentioned, to use them (not already existing and for custom needs), without creating FlyWithLua or XLua script for this requirement, as sometime we want to simplify the process without requiring to use multiple solutions at once. I would expect Air manager solution would be sufficient and this is how I see it
Re: Add feature to Create custom Dataref or Command from AM/AP
But still, why do you need this dataref?
-
- Posts: 5346
- Joined: Thu Jul 27, 2017 12:22 am
Re: Add feature to Create custom Dataref or Command from AM/AP
There's many circumstances where devs have to create custom datarefs and commands which doesn't exists, to be able to trigger actions which fulfill their needs and expectation
In the past I have created an XLua script for the Z_2D_XP EFB Panel, for simmers needs who want to show/hide the AM EFB instrument remotely and independently from what we see in the sim
Using this XLua part :
and the related panel logic.lua using "instrument_get" feature
I have other needs which made me come to this though I don't have it in mind at the moment, as switching between multiple tasks and already made the request months ago, however I will add them when I will re come on it
Anyway, you get the abstract with this sample and an idea of the expectation to not force simmers to add additional scripts and plugins in the sim folders structure ...
Again Air Manager would be sufficient ... shouldn't it ???
In the past I have created an XLua script for the Z_2D_XP EFB Panel, for simmers needs who want to show/hide the AM EFB instrument remotely and independently from what we see in the sim
Using this XLua part :
Code: Select all
-- Dedicated LUA script to handle Air Manager EFB hide/show independently to the one which is shown in the sim
-- enjxp_SimPassion 10.19.2019 Initial release
Z2DXP_efbshow = create_dataref("Z2DXP/EFB/ext2dxpefb/show_z2dxp_efb", "number")
Z2DXP_efbshow = 1
function z2dxp_efb_show_CMDhandler(phase, duration)
if phase == 0 then
if Z2DXP_efbshow == 1 then
Z2DXP_efbshow = 0
else
Z2DXP_efbshow = 1
end
elseif phase == 2 then
end
end
Z2DXPCMD_z2dxp_efb_show = create_command("Z2DXP/EFB/toggle_switch/show_z2dxp_efb", "Toggle Z2DXP EFB Tablet Visibility", z2dxp_efb_show_CMDhandler)
Code: Select all
local z2dxpefb_id = instrument_get("cc8ae7fa-eaf1-4228-88c6-05f22630939c")
function compute_efb_show(tablet_state) -- HIDE/UNHIDE Z2DXP EFB Tablet
if tablet_state == 0 then
visible(z2dxpefb_id,false)
else
visible(z2dxpefb_id,true)
end
end
xpl_dataref_subscribe("Z2DXP/EFB/ext2dxpefb/show_z2dxp_efb","INT", compute_efb_show)
compute_efb_show(1)
Anyway, you get the abstract with this sample and an idea of the expectation to not force simmers to add additional scripts and plugins in the sim folders structure ...
Again Air Manager would be sufficient ... shouldn't it ???