• 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.

FS2004 Analysis required please

Messages
1,468
Country
italy
This problem has been ongoing for a couple of days and I would like someone to analyse the coding to see what's going wrong.
I have 5 variable that all must be anded. If they are all in agreement then 2 other variables are activated. These past couple of days something strange has been happening. Everything seems to work. Tested numerous times and then suddenly only the (L:Sound_Fire,enum) variable works. The only way to rectifiy it is to change the first variable. It works for a while, tested and then only the sound variable works again. So perhaps FS9 is having difficulty in interpreting the coding. so what I need is a cast iron coding that ensures the criteria are met every time.
The vars in green must all agree so that both the vars in red are activated and not just one. Perhaps someone could also explain why always the sound var is activated correctly.
many thanks vololiberista
Code:
<Element>
    <Select>
      <Value>
[COLOR="Lime"](E:LOCAL DAY OF MONTH, enum) 19 == (E:ZULU TIME, hours) 12 > and (A:SIM ON GROUND, bool) 0 == and (L:ENG1 FIRE EXT,bool) 0 == (L:FIRE HANDLE 1 PULLED,number) 0 == and and [/COLOR]if{ [COLOR="Red"]1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum)[/COLOR] } els{ 0 (>L:EF_1,number) }
      </Value>
    </Select>
   </Element>
 
I don't understand the insistence on jamming everthing into one long statement, but by using some carriage returns (Enter key), the pattern is easier to see. Try moving the 'ands' so that they are consistent:

Code:
<Element>
  <Select>
    <Value>
      (E:LOCAL DAY OF MONTH, enum) 19 ==
      (E:ZULU TIME, hours) 12 >
      and
      (A:SIM ON GROUND, bool) 0 ==
      and
      (L:ENG1 FIRE EXT,bool) 0 ==
      and
      (L:FIRE HANDLE 1 PULLED,number) 0 ==
      and
      if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) } 
      els{ 0 (>L:EF_1,number) }
    </Value>
  </Select>
</Element>
 
I'll try that Bill, thanks. What is/was weird that it did work and then didn't. So my feeling was that the code was not being interpreted correctly. Hopefully your "clear" vision will help.
many thanks,
vololiberista
 
Just tried it, but still only the sound var works. Nothing is passed to (L:EF_1,number). I've tried even with blackbox running. So, I can see that all the other vars have the right values. It is a mystery as to why values are not passed to (L:EF_1,number) but always to (L:Sound_Fire,enum). I can't think of another way to write it. Especially as when it is first set up it does work, but then later doesn't only leaving the sound working.
Is this too much for the system to manage?
vololiberista
 
Especially as when it is first set up it does work, but then later doesn't only leaving the sound working.
Is this too much for the system to manage?
vololiberista

Then it is obvious to me that somewhere else the value of (L:EF_1,number) is being set...

What are all the other places where (L:EF_1,number) is used?
 
Then it is obvious to me that somewhere else the value of (L:EF_1,number) is being set...

What are all the other places where (L:EF_1,number) is used?
The only other instance is this:-
Code:
<Element>
      <Select>
         <Value>(L:EF_1,number)</Value>
         <Case Value="1">
            <Image Name="Fire_handles_1_on_test_light.bmp" Bright="Yes"/>
         </Case>
         <Case Value="0">
            <Image Name="SWAP.bmp"/>
         </Case>
      </Select>
   </Element>
However, There is something that may be causing confusion. If you look back to your code example at:-
Code:
(L:ENG1 FIRE EXT,bool) 0 ==
      and
      (L:FIRE HANDLE 1 PULLED,number) 0 ==
These 2 vars are generated by the fire handle and are initially both 0. But once the fire handle is pulled (L:ENG1 FIRE EXT,bool) equals 1 and (L:FIRE HANDLE 1 PULLED,number) equals 0. When the handle is returned (L:FIRE HANDLE 1 PULLED,number) becomes 1 and (L:ENG1 FIRE EXT,bool) becomes 0. They effectively swap 1>0 0>1 whereas the test is only for 0 0
So perhaps that is causing the confusion. I'm going to try just (L:FIRE HANDLE 1 PULLED,number) of the two to see if that works consistently.
vololiberista
 
Well, that didn't work either. It's a mystery why the value 1 is not passed on
even if I try this:-
Code:
<Value>
      (E:LOCAL DAY OF MONTH, enum) 19 ==
      (E:ZULU TIME, hours) 12 >
      and
      (A:SIM ON GROUND, bool) 0 ==
      and     
      (L:ENG1 FIRE EXT,bool) 0 ==
      and
      if{ 1 (>L:EF_1,number) 2 (>L:Sound_Fire,enum) }      
    </Value>
It still only passes the value 2 to the sound var. The other remains 0
vololiberista :mad: :mad: :mad: :mad: :mad:
 
Then you didn't tell us the truth in post #6 - it *is* used elsewhere...
 
Back
Top