JETWAY MOVING - variable accessibility

Hi All, We’ve invested some R&D; time over the weekend to further develop our
custom jetways. Using the JETWAY MOVING simvar as follows, we have
successfully (and eventually) added warning lights (and some audio) when the
jetway is moving: JETWAY MOVING bool The third and final feature we expected
to implement was to hide a couple of other nodes when the jetway was moving,
the opposite of the above. Using RPN code in the visibility element this time:
(A:JETWAY MOVING, bool) 0 == if {1} els{0} Using RPN in an attempt to invert
the bool value didn’t work, further debug showed accessing the simvar A:JETWAY
MOVING always returned empty in the stack. We tried to use the CANOPY OPEN
instead, which is actually more appropriate to what we need, and was showing
the expected values in simvarwatcher, with the following RPN code: (A:CANOPY OPEN, percent over 100) 0 > if{0} els{1} That didn’t work either A:CANOPY
OPEN was also empty in the stack. Finally, we tried something that we
currently use in another static simobject to control which glass window node
to show based on the time of day: (E:LOCAL TIME, Seconds) 22200 <= (E:LOCAL TIME, Seconds) 66000 >= or if{ 1 } els{ 0 } That doesn’t appear to work
either. At that point we didn’t debug any further as it seems that something
really odd is going on. We’ve confirmed that the node name and ID are correct
(using the SIMVAR visibility method). We noticed that [Version] Major 1 Minor
0 were missing from the sim.cfg and may be a problem for Behaviours, so those
were added, but made no difference. We also reverted back to the old
ModelBehaviours method to see if that made any difference, and can confirm
that it doesn’t. The feature we planned to have was more of a ‘nice to have’,
and not essential. But given the time and effort spent getting nowhere, it
would be more of a relief to find out what’s going wrong. Any advice would be
greatly appreciated! Best wishes, Chris.

Jetways are “dead” when they are retracted. No variables or visibilities will
work in that state. They’ll start working only when they become “alive”, that
is the user calls the jetway.

Hi Virtuali, Thanks for the response, but the three actions we’re trying to
achieve are based on when the jetway IS moving. What we want to do is, when
the JETWAY MOVING is not 0 (moving):

  1. Make the rotating beacons VISIBLE : DONE, works perfectly, and disappear when it stops.
  2. Play the hydraulic pump and warning siren from the soundbank until the jetway stops moving: DONE, also works perfectly.
  3. Make the main jetway roller door on the entrance INVISIBLE so that the operator can see where the aircraft door is.

Item 3 is the main problem and the subject in question, it needs to be fed the
opposite of the JETWAY MOVING bool value of true. We can’t seem to do it with
RPN code as the JETWAY MOVING appears always empty when trying to access it
using the documented method A: SIMVAR method. Furthermore it seems NO simvar
variables are accessible using RPN that could be used to hide the entrance
door, including ones that are accessible to our other static objects, in our
case A:CANOPY OPEN and E:LOCAL TIME which we have used previously, namely
E:LOCAL TIME. We have today tried to implement the ASOBO_GT_Visibility_Code
template method that we know works with our window glass, for the rotating
beacons instead of writing it custom, and found that the template method
doesn’t work either and we have to revert back to the custom simvar based
method. We do know that even when the jetway is ‘alive’ as you describe, the
variable we want to use is available for direct use in a visibility element
using SIMVAR as the parameters but not when accessing it through RPN to
evaluate it’s state and send the opposite value for visibility using `
instead. This is where we’ve been banging heads on brick walls for several
days. All we want to do is send a visibility code of 0 to a node when the
jetway moving simvar is not 0. It works perfectly for things we want to show,
but it seems to be a challenge to do the opposite, hiding something when the
jetway is moving. All the best, Chris

Is this suitable for your need? When the jetway is moving, the component
visibility is false (door gonna be invisible), else is true (gonna be shown)
(A:JETWAY MOVING, Boolean) if{ 0 } els{ 1 }

You said you are using a Visibility code, that’s precisely the problem: when a
Jetway is retracted, Visibilities do not work. “Do not work”, doesn’t mean the
object or behavior under the Visibility won’t show up, it means is AS IF the
Visibility check wasn’t even there so, any object that would have normally be
invisible (because of the Visibility check), WILL SHOW, just because it’s
there in the .gltf file. To sum it up: - When a jetway is inactive, every
part will show - When a jetway is active, parts will show or not depending on
their Visibility conditions, if there are any. It’s exactly the same for
Living World vehicles: when they are static, all parts under any visibilities
will show up, because the Visibility check itself is not processed so,
everything will show, if it’s in the gltf file

Hi Mate, I’m not sure if you’re just trying to make things more complicated on
purpose, or, you haven’t read and understood the issue we are facing and have
subsequently raised the question regarding. The behavior visibility code IS
working perfectly for nodes that we want to SHOW when the jetway IS moving and
HIDE when it’s stationary. All nodes in the GLTF are visible and hidden as
specified in the behaviors, REGARDLESS of anything else including the jetway
being retracted. That’s working perfectly and, as expected. Quote: “When a
jetway is inactive, every part will show”
That’s not true based on our
experience. Quote “When a jetway is active, parts will show or not depending
on their Visibility conditions, if there are any”
That’s partially true, and
our issue IS with the visibility condition. We can show nodes when the jetway
IS moving but, we CANNOT HIDE NODES when the jetway is moving. ONLY USING THIS
IN THE VISIBILITY seems to work as expected: JETWAY MOVING bool Obviously not
suitable for hiding things as it seems to be based on direct access to the
simvar value, which will be always true, and we need to use the ` method
instead of . THE ISSUE IS: We need to send the inverse value of the JETWAY
MOVING bool to a visibility element in the behaviors to hide it when the
jetway moves, and show it when it’s stationary. We have tried multiple ways of
doing it as stated above in the post, with absolutely no success. What we have
found is, regardless of the jetway state, we can’t access the simvar using RPN
and (A:JETWAY MOVING, bool), contrary to what the SDK documentation suggests.
Regards, Chris

Hi Mate, Thanks for the help. We tried that already but with the comparator 0
== and it didn’t work. We removed it and tried: (A:JETWAY MOVING, bool) if{1}
els{0} Then (A:JETWAY MOVING, Boolean) if{1} els{0} Neither worked but this
time with the behaviors debugger open we noticed this popping up in the
console window: Invalid script (no command is more than 4 characters): “if{0}
els{1}” Converted into something understandable what it means is values in
parenthesis must be padded left and right with a space. :expressionless: All the best, Chris

To answer our own question, the problem was with incorrect syntax in the RPN
code. The values in the parenthesis need to be padded both left and right
with a space in order to be parsed by the compiler.
To hide the entry
shutter when the jetway is moving, and show it when the jetway is parked, we
can confirm that this code now works: (A:JETWAY MOVING, bool) 0 == if{ 1 } els{ 0 } We have had no joy with the CANOPY OPEN SimVar using this code which
we were going to add as an OR clause: (A:CANOPY OPEN, percent over 100) 0.0 ==
if{ 1 } els{ 0 } The value seems to be 0 regardless of the state of the
aircraft door, and we assume that it isn’t available to jetways. With the
roller door being closed when the jetway is parked, we are quitting whilst we
are ahead and relying only on the JETWAY MOVING variable. Thanks for all the
help. Chris

QUOTE:We need to send the inverse value of the JETWAY MOVING bool to a
visibility element in the behaviors to hide it when the jetway moves, and show
it when it’s stationary. We have tried multiple ways of doing it as stated
above in the post, with absolutely no success.
**** If you only need to do
that, it’s actually very simple, this code surely works, it’s an example of
two nodes, called “Jetway_Rotating_Light” or “Jetway_Static_Light”,
alternating each other depending if the jetway is moving or not.


(A:JETWAY MOVING,bool) 0 ==

Animations, without or without visibilities, won’t work if the Jetway
hasn’t been called. Which is not the same as the Jetway is “not moving”, since
“not moving” after it has been used, it’s not the same as “not moving” because
it hasn’t been called yet. About visibilities completely disabled, showing all
parts, it’s only relevant for Ground Vehicles that hasn’t been activated yet.