• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

What is wrong with this code?

Messages
10,163
Country
us-arizona
Hey guys,

Sorry to bother. Can anyone tell me why the L:var will not operate when the door is opened and closed?

A similar gauge I have works the door ding sound system fine, but when doing one for the wing step animation, nothing happens...


Code:
  <Update Hidden="Yes">
    <!-- 1 SECOND UPDATE -->
    (P:Absolute time,seconds) 1 % 1 > !
    if{
          (* XML script goes in here *)
            (A:EXIT OPEN,percent) 100 ==
            (A:EXIT OPEN,percent) 0 ==
      }
  </Update>

   <Element>
    <Select>
     <Value>
             (A:EXIT OPEN,percent) 100 ==
               if{ 1 (&gt;L:AVEstepRETRACT, bool) }
     </Value>
    </Select>
   </Element>

   <Element>
    <Select>
     <Value>
             (A:EXIT OPEN,percent) 0 ==
                if{ 0 (&gt;L:AVEstepRETRACT,bool) }
     </Value>
    </Select>
   </Element>


 </Gauge>

Flattened...



<Update Hidden="Yes">
<!-- 1 SECOND UPDATE -->
(P:Absolute time,seconds) 1 % 1 > !
if{
(* XML script goes in here *)
(A:EXIT OPEN,percent) 100 ==
(A:EXIT OPEN,percent) 0 ==
}
</Update>

<Element>
<Select>
<Value>
(A:EXIT OPEN,percent) 100 ==
if{ 1 (&gt;L:AVEstepRETRACT, bool) }
</Value>
</Select>
</Element>

<Element>
<Select>
<Value>
(A:EXIT OPEN,percent) 0 ==
if{ 0 (&gt;L:AVEstepRETRACT,bool) }
</Value>
</Select>
</Element>


</Gauge>



Bill
 
The code is pretty simple... that should work! What on earth could be keeping that from working...



Bill
 
Your update section is whacked. What is it trying to accomplish?

Doug
 
Hey Doug,

Its to monitor the door being fully opened and fully closed. Also, according to the FS9 SDK, it is read as a percent. But, it also says Index.

I'll try it without the Update section.

What I would love is for this to actuate like 3 seconds after the doors open. I need to integrate in a timer for it (when I get this working).



Bill
 
Bill,
Your update section will be activated at one second intervals, but it does nothing.
Code:
(A:EXIT OPEN,percent) 100 ==

By itself this is or could be a test to see if the door was at 100% but it would have to be followed by some action as a result of that test, like you do further down.

Roy
 
Ahh.... Wait. I didnt know that an Update section could handle commands. I thought it was only for monitoring things.

Nice....
 
Well, this did nothing either.

I tried script in both the update section and below it, and then removed the below part, and tried a few variations. Nada...



Code:
  <Update Hidden="Yes">
    <!-- 1 SECOND UPDATE -->
    (P:Absolute time,seconds) 1 % 1 > !
    if{
          (* XML script goes in here *)
            (A:EXIT OPEN,percent) 100 ==
               if{ 1 (&gt;L:AVEstepRETRACT, bool) }
      }
  </Update>

(* Also tried this *)

  <Update Hidden="Yes">
    <!-- 1 SECOND UPDATE -->
    (P:Absolute time,seconds) 1 % 1 > !
    if{
          (* XML script goes in here *)
            (A:EXIT OPEN,percent) 100 ==
               if{ 1 (&gt;L:AVEstepRETRACT, bool) }
               els{ 0 (&gt;L:AVEstepRETRACT, bool) }
      }
  </Update>
 
Um, it should have been this?

Code:
  <Update Hidden="Yes">
    <!-- 1 SECOND UPDATE -->
    (P:Absolute time,seconds) 1 % 1 > !
    if{
          (* XML script goes in here *)
            (A:EXIT OPEN,percent) 100 ==
               if{ 1 (&gt;L:AVEstepRETRACT, bool) }
      }
   els{ 0 (&gt;L:AVEstepRETRACT, bool) }
  </Update>
 
Well, nothing was working, and thats what qued me to the fact that it may not have even been seeing the code. Something should have worked...

When I had entered the gauge into the 2D panel section, I forgot to change up the string number when I copy/pasted it.

:/


For anyone that wants a cool step lowering code for FS9, here is one.



This is the separate gauge for it, invisible.

Code:
<Gauge Name="Retracting Foot Steps Control" Version="1.1">
  <Size X="5" Y="5" />

  <Update Hidden="Yes">
    <!-- 1 SECOND UPDATE -->
    (P:Absolute time,seconds) 1 % 1 > !
    if{
          (* XML script goes in here *)
            (A:EXIT OPEN,percent) 100 ==
               if{ 1 (&gt;L:AVEstepRETRACT, bool)
                       (P:Absolute time,seconds) 7 -
                       and
                 }
               els{ 0 (&gt;L:AVEstepRETRACT,bool) }
                       (P:Absolute time,seconds) 7 -
                       and
                }
  </Update>


 </Gauge>


Note that this has a timer set for 7 seconds. When the doors open, 7 seconds go by since the doors come to the 100% point, at which point, the steps slowly come down.



This is the FS9 Gmax part code for the step, set for slow animation; lag=20.


Code:
<part>
   <name>ave_retracting_step</name>
      <animation>
	<parameter>
	  <code>(L:AVEstepRETRACT, bool) 100 *</code>
 	  <lag>20</lag>
	</parameter>
      </animation>
   <mouserect>
	<cursor>Hand</cursor>
   <tooltip_text>Retracting Foot Step</tooltip_text>
   <callback_code>
     (L:AVEstepRETRACT, bool) ! (>L:AVEstepRETRACT, bool)
               1 (&gt;L:XMLSND73,enum)
   </callback_code>
   </mouserect>
</part>
 
Last edited:
Back
Top