xpl_command and BEGIN/ONCE/END

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

Re: xpl_command and BEGIN/ONCE/END

#11 Post by Roxus »

Yeah, I've used xpl_command() before (on the trim's), that's why this was interesting to me that it wasnt behaving as expected.
But I havent confirmed yet whether this is aircraft specific (coz its an add-on aircraft) or what, so I will do a detailed debug tonight

Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

Re: xpl_command and BEGIN/ONCE/END

#12 Post by Roxus »

the deploy_flares command on a joystick trigger only deploys while the trigger is held down, and it continually deploys at a pre-described rate until the trigger is released.
I was wrong about the datarefs plugin, the ONCE on the deploy_flares command does not work
So I don't know how it is identified to the programmers in the XPlane SDK documentation, if it is, but this command only works with BEGIN/END, and if I want one deployment per button-press, I guess I need to use my timer mechanism to send an END before the hardcoded XPlane defaults launch another flare

Here endith the lesson

Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

Re: xpl_command and BEGIN/ONCE/END

#13 Post by Roxus »

PS. The default combat aircraft in XPlane dont have any flares or chaff loaded, so I couldnt test on them.
I was only able to test on XPlane.org aircraft that did have them, and the ones I have, come from the same developer (AOA), so the behaviour might be of their own making, I still dont know

User avatar
Ralph
Posts: 7933
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: xpl_command and BEGIN/ONCE/END

#14 Post by Ralph »

Note that there's a button down and up callback in Air Manager. So the down can do the begin and the up the end.

Roxus
Posts: 58
Joined: Wed Sep 02, 2020 7:30 pm

Re: xpl_command and BEGIN/ONCE/END

#15 Post by Roxus »

Ralph wrote: Wed Dec 23, 2020 4:49 am Note that there's a button down and up callback in Air Manager. So the down can do the begin and the up the end.
Yes, but then I'd either have to hold the button in for a period of time to allow the flare to be deployed by XPlane, and then release to send the END,or use a timer after the release to not send the END until a prescribed period of time had expired and then send the END so that one flare deploys with each depress of the button

User avatar
Ralph
Posts: 7933
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: xpl_command and BEGIN/ONCE/END

#16 Post by Ralph »

So the flares do not start before a certain amount of time?

User avatar
Sling
Posts: 5244
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: xpl_command and BEGIN/ONCE/END

#17 Post by Sling »

Roxus wrote: Wed Dec 23, 2020 5:46 pm
Ralph wrote: Wed Dec 23, 2020 4:49 am Note that there's a button down and up callback in Air Manager. So the down can do the begin and the up the end.
Yes, but then I'd either have to hold the button in for a period of time to allow the flare to be deployed by XPlane, and then release to send the END,or use a timer after the release to not send the END until a prescribed period of time had expired and then send the END so that one flare deploys with each depress of the button
I think a combination of the release and a timer might work the best. Pressing the button quickly once will activate the timer on release but pressing and holding for over a certain time can be coded to not use the ‘END’ timer, so it will deploy flares until released.

Post Reply